WP_Ability::get_meta_item( string $key, mixed $default_value = null ): mixed

In this article

Retrieves a specific metadata item for the ability.

Parameters

$keystringrequired
The metadata key to retrieve.
$default_valuemixedoptional
The default value to return if the metadata item is not found.

Default:null

Return

mixed The value of the metadata item, or the default value if not found.

Source

public function get_meta_item( string $key, $default_value = null ) {
	return array_key_exists( $key, $this->meta ) ? $this->meta[ $key ] : $default_value;
}

Changelog

VersionDescription
6.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.