WP_Dependencies::get_data() WordPress Method

The WP_Dependencies::get_data() method is used to get the data for a given dependency. This data includes the version, URL, and other information about the dependency.

WP_Dependencies::get_data( string $handle, string $key ) #

Get extra item data.


Description

Gets data associated with a registered item.


Top ↑

Parameters

$handle

(string)(Required)Name of the item. Should be unique.

$key

(string)(Required)The data key.


Top ↑

Return

(mixed) Extra item data (string), false otherwise.


Top ↑

Source

File: wp-includes/class.wp-dependencies.php

	public function get_data( $handle, $key ) {
		if ( ! isset( $this->registered[ $handle ] ) ) {
			return false;
		}

		if ( ! isset( $this->registered[ $handle ]->extra[ $key ] ) ) {
			return false;
		}

		return $this->registered[ $handle ]->extra[ $key ];
	}

Top ↑

Changelog

Changelog
VersionDescription
3.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.