Skip to content

Instantly share code, notes, and snippets.

@thebeckyhamm
Last active September 26, 2015 12:18
Show Gist options
  • Save thebeckyhamm/e71d56380cecc4389b07 to your computer and use it in GitHub Desktop.
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
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