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 | |
| /** | |
| * Mark a member "paused" and deny access to members-only content. | |
| * Show a message that the account is paused containing alink to the contact page. | |
| * | |
| * Requires Paid Memberships Pro and the Register Helper Add On. | |
| * | |
| */ | |
| function my_pmprorh_init_pause_access() { |
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 | |
| /** | |
| * 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 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 | |
| /** | |
| * Get array of settings needed to make API calls. | |
| * | |
| * Update the remotesite, APIUSER, and APIPASS settings | |
| * as required for the remote site you will be testing against. | |
| */ | |
| function pmprorad_get_options() { | |
| return array( | |
| 'localsite' => site_url(), |
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 | |
| /** | |
| * Show the user's avatar before the menu area in the Log In Form widget for PMPro v2.3+ | |
| * | |
| */ | |
| function my_pmpro_log_in_form_widget_avatar() { | |
| global $current_user; | |
| echo get_avatar( $current_user->ID, '80', '', $current_user->display_name ); | |
| } | |
| add_action( 'pmpro_logged_in_welcome_before_menu', 'my_pmpro_log_in_form_widget_avatar' ); |
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 | |
| /** | |
| * 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 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 | |
| /** | |
| * Edit Teaser Messages Depending on Content | |
| * | |
| */ | |
| function pmpro_pmpro_not_logged_in_text_filter( $text ) { | |
| global $post; | |
| $access = pmpro_has_membership_access( $post->ID, NULL, true ); | |
| $level_ids = $access[1]; |
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 | |
| /** | |
| * Bulk update all users with "subscriber" role to their membership level's custom role. | |
| * Loops through all users and checks their membership level. If level is set, checks if custom role for their level exists. | |
| * Updates the role for all members excluding users with the $ignored_roles as defined in the array. | |
| * This recipe is designed for sites that want to use the Roles for Membership Levels Add On on a site with existing members. | |
| * Visit /?updateroles=1 when logged in as an admin to have existing users updated. | |
| * Remove this code when finished. | |
| * | |
| **/ |
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 | |
| /** | |
| * Redirect members on login to a specific page based on their 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 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 | |
| /** | |
| * Block dashboard access for custom roles pmpro_role_1 and pmpro_role_2. | |
| * | |
| * 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/ | |
| * | |
| */ |