Skip to content

Instantly share code, notes, and snippets.

@w3guy
Forked from zourbuth/user_meta_key.php
Created July 20, 2020 10:42
Show Gist options
  • Save w3guy/00f5af91a5d833c5cbe5879bae62b7e5 to your computer and use it in GitHub Desktop.
Save w3guy/00f5af91a5d833c5cbe5879bae62b7e5 to your computer and use it in GitHub Desktop.
Get All WordPress User Meta Keys
<?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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment