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 shortcode to display a list of sponsored children. | |
* | |
* @param array $atts { | |
* Attributes for the shortcode. | |
* | |
* @type int $user_id The user ID of the sponsor. | |
* } | |
* |
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 | |
/** | |
* Allow users with set custom roles access to the WordPress dashboard when users | |
* that also has a "Subscriber" role is being blocked if the Restrict Dashboard Access | |
* has been set on the Memberships > Settings > Advanced page. | |
* | |
* This should be helpful if users have multiple roles. | |
* | |
* 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. |
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 changing the group (location ) to add a user field to. | |
* | |
* "$where" locations available on the checkout page are: | |
* - after_pricing_fields | |
* - after_username | |
* - after_password | |
* - after_email | |
* - checkout_boxes |
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 | |
/** | |
* Toggle the Payment Type user field on the checkout page when using the Pay by Check gateway. | |
* The Payment Type field is moved to below the Choose Your Payment Method part on the checkout page. | |
* | |
* This is a partner recipe for the guide | |
* Let Users Select Offline Payment Methods Using the “Pay by Check” Gateway | |
* @link https://www.paidmembershipspro.com/let-users-select-offline-payment-methods-using-the-pay-by-check-gateway/ | |
* | |
* This recipe assumes the following: |
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... | |
/** | |
* Prevent users from cancelling their membership or checking out for a new one. | |
*/ | |
function my_pmpro_redirect_cancel_to_stripe() { | |
global $pmpro_pages; | |
if ( ! empty( $pmpro_pages['cancel'] ) && is_page( $pmpro_pages['cancel'] ) ) { |
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. | |
/** | |
* Do not update user's first and last name while on the PMPro Checkout page. | |
* Useful if you do not want the user's billing name to be the name on the account. | |
*/ | |
function my_pmpro_prevent_name_save_at_checkout( $check, $object_id, $meta_key ) { | |
if ( $meta_key === 'first_name' || $meta_key === 'last_name' ) { |
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 //do not copy | |
/** | |
* This recipe adds the pmpro_pending_approval class to the pmpro_content_message | |
* element if the current user is pending approval. | |
* | |
* 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 | |
/** | |
* Remove the gift aid text from the checkout page for specified membership levels. | |
* | |
* 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 | |
/** | |
* This recipe makes the !!renewaldate!! variable available for use in all Paid Memberships Pro emails. | |
* When the variable is empty it will display nothing instead of the !!renewaldate!! email variable | |
* | |
* Notice the array key does not include the !!s | |
* | |
* 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. |
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 extending a user field to add a depends | |
* | |
* This recipe assumes a checkbox field with the name my_checkbox was created. | |
* This recipe assumes a textarea field with the name my_textarea was created. | |
* | |
* 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. |