Created
October 17, 2012 07:39
-
-
Save zourbuth/3904247 to your computer and use it in GitHub Desktop.
Get All WordPress User Meta Keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns all unique meta key from user meta database | |
* | |
* @param no parameter right now | |
* @retun std Class | |
* @todo do what you do for each meta key. | |
*/ | |
function get_user_meta_key() { | |
global $wpdb; | |
$select = "SELECT distinct $wpdb->usermeta.meta_key FROM $wpdb->usermeta"; | |
$usermeta = $wpdb->get_results($select); | |
return $usermeta; | |
} |
Thanks for the function, works great. 🤙
What do you think about
@return stdClass[]
as return comment line instead of@retun std Class
?
Hey, if you don't want stdClass to return, check this out :
https://gist.github.com/mehdi-eybak/7a17e022e73f8a9f73e016958e29bb8a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the function, works great. 🤙
What do you think about
@return stdClass[]
as return comment line instead of@retun std Class
?