Last active
May 9, 2023 14:47
-
-
Save kimwhite/3241c08ab1fb8da53a807c45f60f5d86 to your computer and use it in GitHub Desktop.
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
<? | |
/** | |
* This recipe will change add a Payment type column to your members Export CSV | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// add the code below - you may add other columns similarly | |
function my_pmpro_members_list_csv_extra_columns($columns) | |
{ | |
$columns["Payment"] = "my_extra_column_payment"; | |
return $columns; | |
} | |
add_filter("pmpro_members_list_csv_extra_columns", "my_pmpro_members_list_csv_extra_columns", 10, 2); | |
function my_extra_column_payment($user) | |
{ | |
$last_order = new MemberOrder(); | |
$last_order->getLastMemberOrder($user->ID); | |
$gateway = ''; | |
if(!empty($last_order->gateway)) | |
$gateway = $last_order->gateway; | |
return $gateway; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment