WordPress как на ладони
Шаблоны, плагины и темы для настоящих поклонников Elementor. От TemplateMonster.com wordpress jino
функция не описана

get_registered_metadata() WP 4.6.0

Retrieves registered metadata for a specified object.

The results include both meta that is registered specifically for the object's subtype and meta that is registered for the entire object type.

Хуков нет.

Возвращает

Разное. A single value or array of values for a key if specified. An array of all registered keys and values for an object ID if not. False if a given $meta_key is not registered.

Использование

get_registered_metadata( $object_type, $object_id, $meta_key );
$object_type(строка) (обязательный)
Type of object to request metadata for. (e.g. comment, post, term, user)
$object_id(число) (обязательный)
ID of the object the metadata is for.
$meta_key(строка)
Registered metadata key. If not specified, retrieve all registered metadata for the specified object.
По умолчанию: ''

Код get_registered_metadata: wp-includes/meta.php VER 4.9.8

<?php
function get_registered_metadata( $object_type, $object_id, $meta_key = '' ) {
	$object_subtype = get_object_subtype( $object_type, $object_id );

	if ( ! empty( $meta_key ) ) {
		if ( ! empty( $object_subtype ) && ! registered_meta_key_exists( $object_type, $meta_key, $object_subtype ) ) {
			$object_subtype = '';
		}

		if ( ! registered_meta_key_exists( $object_type, $meta_key, $object_subtype ) ) {
			return false;
		}

		$meta_keys     = get_registered_meta_keys( $object_type, $object_subtype );
		$meta_key_data = $meta_keys[ $meta_key ];

		$data = get_metadata( $object_type, $object_id, $meta_key, $meta_key_data['single'] );

		return $data;
	}

	$data = get_metadata( $object_type, $object_id );
	if ( ! $data ) {
		return array();
	}

	$meta_keys = get_registered_meta_keys( $object_type );
	if ( ! empty( $object_subtype ) ) {
		$meta_keys = array_merge( $meta_keys, get_registered_meta_keys( $object_type, $object_subtype ) );
	}

	return array_intersect_key( $data, $meta_keys );
}