Created
February 29, 2016 12:34
-
-
Save strangerstudios/35407b65e37e6e75c633 to your computer and use it in GitHub Desktop.
Add extra column to Members List for user field added via Register Helper
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
//Add 'Company' Column to Members List Header | |
function my_pmpro_memberslist_extra_cols_header($theusers) | |
{ | |
?> | |
<th><?php _e('Company', 'pmpro');?></th> | |
<?php | |
} | |
add_action('pmpro_memberslist_extra_cols_header', 'my_pmpro_memberslist_extra_cols_header'); | |
//Add 'Company' Column to Members List Rows | |
function my_pmpro_memberslist_extra_cols_body($theuser) | |
{ | |
?> | |
<td> | |
<?php | |
if(!empty($theuser->company)) | |
echo $theuser->company; | |
?> | |
</td> | |
<?php | |
} | |
add_action('pmpro_memberslist_extra_cols_body', 'my_pmpro_memberslist_extra_cols_body'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment