get_registered_meta_keys( string $object_type, string $object_subtype = '' )

Retrieves a list of registered meta keys for an object type.


Description Description


Parameters Parameters

$object_type

(string) (Required) The type of object. Post, comment, user, term.

$object_subtype

(string) (Optional) The subtype of the object type.

Default value: ''


Top ↑

Return Return

(array) List of registered meta keys.


Top ↑

Source Source

File: wp-includes/meta.php

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 ];
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.9.8 The $object_subtype parameter was added.
4.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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