Created
April 4, 2023 05:18
-
-
Save ipokkel/12bfda9cebec8e4a7cf71a8ff7d18d1c to your computer and use it in GitHub Desktop.
Add PMPro User Fields as fields for Add Member from Admin.
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
<?php | |
/** | |
* Set addmember attribute on user fields to true. | |
* | |
* This will add the field to the Add Member from Admin page in the | |
* administration area. | |
* | |
* 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/ | |
*/ | |
function my_pmpro_set_user_field_addmember( $field, $where ) { | |
$field->addmember = true; | |
return $field; | |
} | |
add_filter( 'pmpro_add_user_field', 'my_pmpro_set_user_field_addmember', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment