wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_registered_meta_keys › WordPress Function

Od4.6.0
Przestarzałyn/a
get_registered_meta_keys ( $object_type, $object_subtype = '' )
Parametry: (2)
  • (string) $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
    Wymagane: Tak
  • (string) $object_subtype Optional. The subtype of the object type. Default empty string.
    Wymagane: Nie
    Domyślny: (puste)
Powrót:
  • (array[]) List of registered metadata args, keyed by their meta keys.
Zdefiniowane na:
Codex:
Dziennik zmian:
  • 4.9.8

Retrieves a list of registered metadata args for an object type, keyed by their meta keys.



Źródło

function get_registered_meta_keys( $object_type, $object_subtype = '' ) {
	global $wp_meta_keys;

	if ( ! is_array( $wp_meta_keys ) || ! isset( $wp_meta_keys[ $object_type ] ) || ! isset( $wp_meta_keys[ $object_type ][ $object_subtype ] ) ) {
		return array();
	}

	return $wp_meta_keys[ $object_type ][ $object_subtype ];
}