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 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 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 | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; | |
} | |
//define the fields |
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 | |
//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 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 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 - 12 into your theme's functions.php or custom plugin | |
function filter_pmpro_default_country( $default_country ) { | |
// Set country code to "AU" for Australia. | |
$default_country = "AU"; | |
return $default_country; | |
} |
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 lines 5 - 14 into your active theme's functions.php or custom plugin. | |
function my_pmpro_remove_dashboard_widget(){ | |
//check if user is not admin, then remove meta boxed | |
if( !current_user_can('manage_options') ) { | |
//remove default WP dashboard activity | |
remove_meta_box('dashboard_activity', 'dashboard', 'normal'); | |
//remove PMPRO dashboard activity |
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 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 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 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-10 to your active theme's functions.php or custom PMPro plugin | |
function my_logout_after_register(){ | |
wp_logout(); | |
wp_redirect( '<SOME URL>' ); exit; //edit this line with the URL for users to be redirected to. | |
} | |
add_action('pmpro_confirmation_url', 'my_logout_after_register'); |