函数原型
get_registered_meta_keys( string $object_type, string $object_subtype = ” ): array[]
函数描述
Retrieves a list of registered metadata args for an object type, keyed by their meta keys.
是否弃用
未弃用
函数参数
-
$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:
''
函数返回值
array[] List of registered metadata args, keyed by their meta keys.
函数位置
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 ];
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.9.8 | The $object_subtype parameter was added. |
| 4.6.0 | Introduced. |

