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 | |
// Copy from below here... | |
/* | |
* Changes membership manager so that they can only view | |
* the members list and add new members via PMPro Add Member. | |
* | |
* Can customize using your own caps from here: | |
* https://github.com/strangerstudios/pmpro-membership-manager-role/blob/35725b5cc9d7fd403255e4143a5bd5f1564b022d/pmpro-membership-manager-role.php#L16-L42 | |
*/ |
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 a hidden field in Ninja Forms to capture Membership Level (if user is logged in). | |
* | |
* For Ninja Forms version 3 and higher. | |
*/ | |
// Create Membership Level field for Ninja Forms | |
add_filter( 'ninja_forms_register_fields', function( $fields ) { | |
if ( class_exists( 'PMProMembershipLevelNFInput' ) ) { | |
$fields['pmpromembershiplevel'] = new PMProMembershipLevelNFInput; |
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 | |
/** | |
* Redirect non-members to the Membership Levels page if they do not have a membership level. | |
* | |
* 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/ | |
* | |
*/ |
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 | |
/** | |
* The function below will disable any email sent to the Member/User by Paid Memberships Pro. | |
* The admin emails will still be sent as intended. | |
* | |
* 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/ | |
*/ |
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 | |
/** | |
* Example of how to add links to the Member Links list on the Membership Account page. | |
* | |
*/ | |
// Add links to the top of the list | |
function my_pmpro_member_links_top() { | |
//Add the level IDs here | |
if ( pmpro_hasMembershipLevel( array(1,2,3 ) ) ) { |
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 Website and Biographical Info to Membership Checkout | |
*/ | |
function my_default_wp_user_checkout_fields() { | |
if ( class_exists( 'PMProRH_Field') ) { | |
pmprorh_add_checkout_box( 'additional', 'Additional Information' ); | |
$fields = array(); | |
//user_url field |
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 | |
/** | |
* Call to http://yoursite.com/[email protected]&secret=SOMESECRETHERE to check the membership level of a user. | |
*/ | |
function my_init_pmpro_mini_api() { | |
if ( function_exists( 'pmpro_getMembershipLevelForUser' ) && | |
! empty( $_REQUEST[ 'verify' ] ) && | |
! empty( $_REQUEST[ 'secret' ] ) ) | |
{ | |
if ( $_REQUEST[ 'secret' ] != 'SOMESECRETHERE' ) { |
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
/** | |
* Retroactively assign a user to a Parent account when using the Sponsored Members Add On. | |
* Enter the user ID of parent account in the "Assign to Parent Account" on the "Edit Profile" screen. | |
* | |
* Note: The user's active Membership Level must be the correct "Child" level for that Parent/Child relationship. | |
* | |
*/ | |
function pmprosm_assign_child_members( $profileuser ) { | |
if ( function_exists( 'pmprosm_getSponsor' ) && current_user_can( 'edit_users' ) ) { |
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 a custom column to the Memberships > Members admin page for a user field | |
* added via Register Helper using the PMPro hook method. | |
* | |
* 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/ | |
*/ |