Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save JarrydLong/5ed360a8f3cc8008493268f2cd132f9c to your computer and use it in GitHub Desktop.

Select an option

Save JarrydLong/5ed360a8f3cc8008493268f2cd132f9c to your computer and use it in GitHub Desktop.
<?php //do not copy
function my_pmpro_members_list_csv_extra_columns( $columns ) {
$columns["member_profile_url"] = "my_extra_column_member_url";
return $columns;
}
add_filter("pmpro_members_list_csv_extra_columns", "my_pmpro_members_list_csv_extra_columns", 10);
function my_extra_column_member_url($user){
global $pmpro_pages;
$profile_url = ! empty( $pmpro_pages['profile'] ) ? get_permalink( $pmpro_pages['profile'] ) : '';
if( empty( $profile_url ) ) {
return '-';
}
if( ! function_exists( 'pmpromd_build_profile_url' ) ) {
return '-';
}
return pmpromd_build_profile_url( $user, $profile_url ) ;
}
function my_pmpro_memberslist_extra_cols_header(){
?>
<th><?php _e('Member Profile URL', 'pmpro');?></th>
<?php
}
add_action("pmpro_memberslist_extra_cols_header", "my_pmpro_memberslist_extra_cols_header");
function my_pmpro_memberslist_extra_cols_body($theuser){
global $pmpro_pages;
$profile_url = ! empty( $pmpro_pages['profile'] ) ? get_permalink( $pmpro_pages['profile'] ) : '';
?>
<td>
<?php
if( empty( $profile_url ) ) {
echo '-';
}
if( ! function_exists( 'pmpromd_build_profile_url' ) ) {
echo '-';
}
echo pmpromd_build_profile_url( $theuser, $profile_url ) ;
?>
</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