WP_Ability::get_meta_item
Retrieves a specific metadata item for the ability.
Method of the class: WP_Ability{}
No Hooks.
Returns
Mixed. The value of the metadata item, or the default value if not found.
Usage
$WP_Ability = new WP_Ability(); $WP_Ability->get_meta_item( $key, $default_value );
- $key(string) (required)
- The metadata key to retrieve.
- $default_value(mixed)
- The default value to return if the metadata item is not found.
Default:null
Changelog
| Since 6.9.0 | Introduced. |
WP_Ability::get_meta_item() WP Ability::get meta item code WP 6.9.1
public function get_meta_item( string $key, $default_value = null ) {
return array_key_exists( $key, $this->meta ) ? $this->meta[ $key ] : $default_value;
}