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 | |
| /** | |
| * Restrict specific pages in your WordPress site for logged in users only. | |
| * | |
| */ | |
| function my_restricted_pages_require_user_login() { | |
| global $current_user; | |
| // Allow logged in users. | |
| if ( is_user_logged_in() ) { |
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 | |
| /** | |
| * Duplicate TEAE usermeta fields to xProfile Fields | |
| * | |
| */ | |
| function teae_duplicate_usermeta_to_xprofile( ) { | |
| global $wpdb; | |
| $fields = array( | |
| 'alternate_phone'=>'261', | |
| 'body_number_(jal/sal)_1'=>'205', |
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 | |
| // Register Helper Custom Fields for PMPro | |
| function aatherapy_pmprorh_init() { | |
| //don't break if Register Helper is not loaded | |
| if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
| return false; | |
| } | |
| //define the fields | |
| $fields = array(); |
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 | |
| // Display membership pricing along with regular pricing. | |
| function my_woocommerce_get_price_html($price, $product) { | |
| // Get all levels. | |
| $all_levels = pmpro_getAllLevels(true, true); | |
| // Get original price. | |
| $reg_price = wc_price($product->get_regular_price()); |
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 | |
| /** | |
| * Add myCred points at checkout based on membership level ID. | |
| * Optionally apply points only to members that select a recurring membership. | |
| * | |
| */ | |
| function add_my_cred_to_pmpro_checkout( $user_id, $morder ) { | |
| // Bail if myCred doesn't exist. | |
| if ( ! function_exists( 'mycred_add' ) ) { |
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 | |
| /** | |
| * Filter to add additional post types for protection and individual sale using Addon Packages for Paid Memberships Pro. | |
| * You should also install the Custom Post Type (CPT) Membership Access Add On so that your CPT can be properly restricted. | |
| * https://www.paidmembershipspro.com/add-ons/custom-post-type-membership-access/ | |
| * | |
| */ | |
| function add_new_cpts_pmproap_supported_post_types( $post_types ) { | |
| $post_types[] = 'custom_courses'; | |
| return $post_types; |
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 | |
| /** | |
| * Hide the "Membership Required:" and level names from the [download] shortcode output | |
| * when using Download Monitor and the Download Monitor Integration for Paid Memberships Pro Add On. | |
| * | |
| */ | |
| add_filter( 'pmprodlm_shortcode_download_show_membership_required_filter', '__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
| /* General Table Styles Adjustments */ | |
| .pmpro_table { | |
| border: none; | |
| } | |
| .pmpro_table th, | |
| .pmpro_table td { | |
| border: none; | |
| padding: 10px 0; | |
| } | |
| .pmpro_table td { |
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 | |
| /** | |
| * Use a custom shortcode with the Social Login Add On for Paid Memberships Pro (Requires v.3 or above) | |
| * | |
| */ | |
| function my_pmprosl_custom_shortcode( $shortcode ) { | |
| // Edit this line to change the shortcode displayed on the checkout page. | |
| return '[TheChamp-Login title="Use your Social Account to Login"]'; | |
| } | |
| add_filter( 'pmprosl_login_shortcode', 'my_pmprosl_custom_shortcode' ); |
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 | |
| /** | |
| * 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/ | |
| */ |