Last active
September 26, 2015 12:18
-
-
Save thebeckyhamm/e71d56380cecc4389b07 to your computer and use it in GitHub Desktop.
add a column to the user page and adds the data to the column
This file contains hidden or 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
function ms_modify_user_columns($column_headers) { | |
$column_headers['membership'] = 'Membership'; | |
return $column_headers; | |
} | |
add_action('manage_users_columns','ms_modify_user_columns'); | |
function ms_get_user_membership($empty = '', $column_name, $id) { | |
if( $column_name == 'membership' ) { | |
$mem = array(); | |
$mem = get_user_meta($id, "_cmb_membership", true); | |
$mem = implode(", ", (array)$mem); | |
return $mem; | |
} | |
} | |
add_action('manage_users_custom_column', 'ms_get_user_membership', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment