Last active
March 15, 2021 13:18
-
-
Save shanebp/574ce3b95e33cb5bcad2c823bb666a00 to your computer and use it in GitHub Desktop.
BP - show xprofile data on Pending Users screen
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 | |
// add the custom column header | |
function philopress_modify_user_columns($column_headers) { | |
$column_headers['extended'] = 'Meta Fields'; | |
return $column_headers; | |
} | |
add_action('manage_users_page_bp-signups_columns','philopress_modify_user_columns'); | |
// dump all the pending user's meta data in the custom column | |
function philopress_signup_custom_column( $str, $column_name, $signup_object ) { | |
if ( $column_name == 'extended' ) | |
return print_r( $signup_object->meta, true ); | |
//If you only want to show specific meta fields, you need to know the field id(s). Then you could do this: | |
//return $signup_object->meta['field_4472']; | |
return $str; | |
} | |
add_filter( 'bp_members_signup_custom_column', 'philopress_signup_custom_column', 1, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi - how would I make this sortable?