get_meta_keys() WordPress Function
The get_meta_keys() function is used to retrieve all the available metadata keys for a given post type. It returns an array of metadata keys, or an empty array if no metadata keys are available.
get_meta_keys() #
Returns a list of previously defined keys.
Return
(string[]) Array of meta key names.
Source
File: wp-admin/includes/post.php
function get_meta_keys() { global $wpdb; $keys = $wpdb->get_col( " SELECT meta_key FROM $wpdb->postmeta GROUP BY meta_key ORDER BY meta_key" ); return $keys; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
1.2.0 | Introduced. |