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 expiration time for a member's level on the Membership Account page. | |
| * Useful for sites that offer hourly membership. | |
| * Requires PMPro v2.6+ | |
| * | |
| * 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 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 | |
| /** | |
| * Include Lessons in search results using the default module in the Courses for Membership Add On for Paid Memberships Pro. | |
| * | |
| * 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. | |
| * | |
| */ | |
| function include_pmpro_courses_lessons_in_search($args, $post_type) { | |
| if ( $post_type == 'pmpro_lesson' ){ |
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
| <!-- Example of the Membership Card Shortcode for Paid Memberships Pro --> | |
| [pmpro_membership_card print_size="small,medium"] |
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 the display name as the entered username for all users created through a Paid Memberships Pro checkout. | |
| * | |
| * 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. | |
| * | |
| */ | |
| function set_display_name_to_username_new_user_array( $new_user_array ) { | |
| $new_user_array['display_name'] = $new_user_array['user_login']; |
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 | |
| /* | |
| * Change the display name to default to just the first name using the Force First Last WordPress plugin. | |
| * https://wordpress.org/plugins/force-first-last/ | |
| * | |
| * 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. | |
| */ | |
| function my_ffl_display_name_just_first( $display_name_order, $first_name, $last_name ) { | |
| $display_name_order = array( $first_name ,'' ); |
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 | |
| /** | |
| * Dynamically display certain levels on the Membership Levels page based on the current user's active level | |
| * This example allows you to show/hide specific levels on the Membership Levels page. | |
| */ | |
| /** | |
| * Dynamically display certain levels on the Membership Levels page based on the current user's active level | |
| * This example allows you to show/hide specific levels on the Membership Levels page. | |
| */ | |
| function dynamic_pmpro_levels_array( $levels ) { |
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 | |
| /* | |
| * Don't show confirm password or email fields on the checkout page. | |
| * | |
| * 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/ | |
| */ | |
| add_filter( 'pmpro_checkout_confirm_password', '__return_false' ); |
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 member away from the Member Profile page if they do not have access to view this member's profile. | |
| * | |
| */ | |
| function my_template_redirect_member_profile_permissions() { | |
| global $pmpro_pages; | |
| if ( empty( $pmpro_pages ) || empty( $pmpro_pages['profile'] ) || ! is_page( $pmpro_pages['profile'] ) ){ | |
| return; |
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 | |
| /* | |
| * Adjust the size of the QR code on Membership Card. | |
| * | |
| * 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 custom_pmpro_membership_card_qr_code_size( $size ) { |