Created
September 21, 2016 20:40
-
-
Save bappi-d-great/0c22d09668a53b849a8a538d7136d5b0 to your computer and use it in GitHub Desktop.
WPMU Membership 2: Adding more column in member table
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 | |
/** | |
* Example: User ID | |
*/ | |
add_filter( 'ms_helper_listtable_member_get_columns', function( $columns ) { | |
$columns['user_id'] = 'User ID'; | |
return $columns; | |
}, 10, 1 ); | |
add_filter( 'ms_helper_listtable_member_default_value', function( $html, $member, $column_name ) { | |
return $column_name == 'user_id' ? $member->id : $html; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment