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 | |
| /* | |
| Paste this code into active theme's functions.php or custom plugin. | |
| */ | |
| function my_pmprorh_init() | |
| { | |
| //don't break if Register Helper is not loaded | |
| if(!function_exists("pmprorh_add_registration_field")) | |
| { | |
| 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 | |
| //paste lines 5-39 in your functions.php or custom PMPRO plugin | |
| function my_pmprorh_init() | |
| { | |
| //don't break if Register Helper is not loaded | |
| if(!function_exists("pmprorh_add_registration_field")) | |
| { | |
| 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 | |
| //copy lines 4 - 9 into custom plugins file or functions.php | |
| function pmpro_show_login_form(){ | |
| //show a simple login form if users are logged out and a post/page requires membership | |
| return wp_login_form(); | |
| } | |
| add_filter('pmpro_not_logged_in_text_filter', 'pmpro_show_login_form'); |
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 | |
| //Please copy line 5-22 into your active themes functions.php or custom plugin | |
| //code to assign specific WP user role when cancelling | |
| function my_pmpro_after_cancel_change_role($level_id, $user_id) | |
| { | |
| //get user object | |
| $wp_user_object = new WP_User($user_id); | |
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 | |
| //copy lines 5-19 to your active themes functions.php file or custom plugin | |
| //use the shortcode [members_details] to show information on your post/page | |
| function pmpro_members_details_shortcode( $atts ){ | |
| if(is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel()){ | |
| global $current_user; | |
| $user_name = $current_user->display_name; | |
| $level_name = $current_user->membership_level->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 | |
| /* | |
| This will hide all default menu links inside your WP dashboard. You are able to hide custom pages by adding 'remove_menu_page(<custom_post_url>); inside the function' | |
| Copy lines 10-28 into your active theme's function.php or custom plugin. | |
| */ | |
| function remove_my_menu_pages() { |
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 template for displaying all pages. | |
| * | |
| * Please create this as a custom page template in WordPress by simply adding this (page.php) to your active child theme's directory. | |
| * | |
| * @package Betheme | |
| * @author Muffin group | |
| * @link http://muffingroup.com | |
| */ |
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 | |
| // Copy lines 5-25 to your active theme's functions.php or custom plugin. | |
| function change_discount_code_text( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'Discount Code' : | |
| $translated_text = __( 'Promotional Code', 'pmpro' ); | |
| break; |
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 this code to your active theme's function.php or custom plugin. (Copy lines 6 - 33 only) | |
| */ | |
| function my_pmpro_last_login( $user_login, $theusers ) { | |
| //get user meta 'my_pmpro_last_login' on login and add time() to it. | |
| update_user_meta( $theusers->ID, 'my_pmpro_last_login', time() ); | |
| } | |
| add_action( 'wp_login', 'my_pmpro_last_login', 10, 2 ); |