get_registered_meta_keys

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

Description

(array) get_registered_meta_keys( (string) $object_type ); 

Returns (array)

List of registered meta keys.

Parameters (1)

0. $object_type (string)
The type of object. Post, comment, user, term.

Usage

  1. if ( !function_exists( 'get_registered_meta_keys' ) ) { 
  2. require_once ABSPATH . WPINC . '/meta.php'; 
  3.  
  4. // The type of object. Post, comment, user, term. 
  5. $object_type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_registered_meta_keys($object_type); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/meta.php  
  1. function get_registered_meta_keys( $object_type ) { 
  2. global $wp_meta_keys; 
  3.  
  4. if ( ! is_array( $wp_meta_keys ) || ! isset( $wp_meta_keys[ $object_type ] ) ) { 
  5. return array(); 
  6.  
  7. return $wp_meta_keys[ $object_type ];