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 | |
/** | |
* This code will add a "Exclude my profile from the member directory" field at membership checkout. | |
* | |
* Requires: Member Directory and Profile Pages Add On - https://www.paidmembershipspro.com/add-ons/pmpro-member-directory/ | |
* Requires: Register Helper Add On - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above. | |
*/ |
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 | |
/** | |
* pmpro_hide_acf_fields This code will filter ACF fields added to custom templates using the post's membership requirements. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* https://www.advancedcustomfields.com/resources/acf-format_value/ | |
* | |
* @param mixed $value Value which was loaded from the database |
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
// Display Advanced Custom Fields for Levels 1 and 2 only. | |
if ( function_exists( 'get_field' ) && function_exists( 'pmpro_hasMembershipLevel' ) ) { | |
if( pmpro_hasMembershipLevel( array('1', '2' ) ) ) { | |
if ( get_field( 'test_field_1' ) ) { | |
the_field( 'test_field_1' ); | |
} | |
if ( get_field( 'test_field_2' ) ) { | |
the_field( 'test_field_2' ); | |
} |
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
$post = get_queried_object(); | |
if ( function_exists( 'pmpro_has_membership_access' ) ) { | |
// Check if the user has access to the post. | |
$hasaccess = pmpro_has_membership_access( $post->ID ); | |
// Display Advanced Custom Fields if the user has access to the post. | |
if( ! empty( $hasaccess ) && function_exists( 'get_field' ) ) { |
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 | |
/** | |
* my_pmpro_member_badge_display This code will display the member badge on the BuddyPress Profile page using the bp_before_member_header_meta hook. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function my_pmpro_member_badge_display( ) { | |
if ( function_exists( 'pmpromb_show_badge' ) && function_exists( 'pmpro_hasMembershipLevel' ) ) { |
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 | |
/** | |
* pmpro_disable_series_new_content_email The gist below disables the user notification sent by the Series Add On for Paid Memberships Pro. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function pmpro_disable_series_new_content_email( $recipient, $email ) { | |
if( $email->template == 'new_content' ) { |
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 | |
/** | |
* pmpro_user_last_order_refunded_check The gist below will stop a user from signing up if their last PMPro order on record was refunded. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function pmpro_user_last_order_refunded_check( $okay ) { |
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 | |
/** | |
* pmpro_user_any_order_refunded_check The gist below will stop a user from signing up if they have ever had a PMPro order refunded. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function pmpro_user_any_order_refunded_check( $okay ) { |
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 | |
/** | |
* pmpro_user_any_order_refunded_last_success_check The gist below will stop a user from signing up if they have ever | |
* had a PMPro order refunded unless their last order was success. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function pmpro_user_any_order_refunded_last_success_check( $okay ) { |
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 //Do not copy this PHP tag into your code. | |
/** | |
* Ensure Paid Memberships Pro compatibility when using Beaver Builder: | |
* https://wordpress.org/plugins/beaver-builder-lite-version/ | |
* | |
* Your administrator-level account must have a Membership Level in order to edit all of the pages assigned | |
* under Memberships > Pages. | |
* | |
* You must also set a Custom Field on the Membership Checkout page with the key 'pmpro_default_level' and | |
* value of a level ID in order to properly edit your Membership Checkout page using Beaver Builder. |