get_registered_meta_keys()
Retrieves a list of registered metadata args for an object type, keyed by their meta keys.
Хуков нет.
Возвращает
Массив[]
. List of registered metadata args, keyed by their meta keys.
Использование
get_registered_meta_keys( $object_type, $object_subtype );
- $object_type(строка) (обязательный)
- Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
- $object_subtype(строка)
- The subtype of the object type.
По умолчанию: empty string
Список изменений
С версии 4.6.0 | Введена. |
С версии 4.9.8 | The $object_subtype parameter was added. |
Код get_registered_meta_keys() get registered meta keys WP 6.6.2
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 ]; }