get_registered_meta_keys

Advertisement

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

$object_type

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

$object_subtype

(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';

Advertisement

Changelog Changelog

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

Advertisement

Leave a Reply

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