Summery Summery

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

Syntax Syntax

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

Parameters Parameters


(string) (Required) Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.


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

Default value: ''

Return Return

(string[]) List of registered meta keys.

Source Source

File: wp-includes/meta.php

	$object_subtype = ! empty( $args['object_subtype'] ) ? $args['object_subtype'] : '';

	// If `auth_callback` is not provided, fall back to `is_protected_meta()`.
	if ( empty( $args['auth_callback'] ) ) {
		if ( is_protected_meta( $meta_key, $object_type ) ) {
			$args['auth_callback'] = '__return_false';
		} else {
			$args['auth_callback'] = '__return_true';


Changelog Changelog

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


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.