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 | |
/** | |
* Ensure Paid Memberships Pro compatibility when using the Elementor Page Builder: | |
* https://wordpress.org/plugins/elementor/ | |
* | |
* You must also set a Custom Field on the Membership Checkout page with the key | |
* 'pmpro_default_level' and value of a level ID in order to properly design your | |
* Membership Checkout page using Elementor. | |
*/ | |
function elementor_compatibility_for_pmpro() { |
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
remove_filter( 'wp_mail_content_type', 'pmpro_wp_mail_content_type' ); |
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
/* | |
Change currencies depending on Paid Memberships Pro level. | |
Add this code to your active theme's functions.php or a custom plugin. | |
This is just an example that will need to be tweaked for your needs. | |
Other places to look into swapping currencies: | |
* Levels page. | |
* Invoices page. | |
* In emails. | |
* In membership levels table in admin. |
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 | |
/* | |
Save this file to /themes/{active theme}/paid-memberships-pro/member-directory/tempaltes/directory.php | |
*/ | |
/* | |
This shortcode will display the members list and additional content based on the defined attributes. | |
*/ | |
function pmpromd_shortcode($atts, $content=null, $code="") | |
{ | |
// $atts ::= array of attributes |
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
/* | |
Lock site down to just our IP | |
Create a file /maintenance.html that explains that maintenance mode is on. | |
Update your IP address in the line below. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function mainenance_mode_on() { | |
if($_SERVER['REMOTE_ADDR'] == 'YOURIPADDRESSHERE') //find your IP and edit here | |
return; |
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 mailpoet_subscribe($list_ids = array()) { | |
$current_user = wp_get_current_user(); | |
$helper_user = WYSIJA::get('user','helper'); | |
$helper_user->addSubscriber([ | |
'user' => [ | |
'email' => $current_user->user_email, | |
'firstname' => $current_user->user_firstname, | |
'lastname' => $current_user->user_lastname |
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_init_email_as_username() | |
{ | |
//check for level as well to make sure we're on checkout page | |
if(empty($_REQUEST['level'])) | |
return; | |
$random_username = pmpro_getDiscountCode(); | |
if(!empty($_REQUEST['bemail'])) |
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 | |
/* | |
Plugin Name: PMPro/BuddyPress members only access | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Limit access to BuddyPress pages/components for non-members. | |
Version: .1 | |
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com> | |
Author URI: http://www.eighty20results.com/thomas-sjolshagen | |
*/ |
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
/* | |
Sync PMPro fields to BuddyPress profile fields. | |
*/ | |
function pmprobuddy_update_user_meta($meta_id, $object_id, $meta_key, $meta_value) | |
{ | |
//make sure buddypress is loaded | |
do_action('bp_init'); | |
//array of user meta to mirror | |
$um = array( |
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 | |
/* | |
Filter the BuddyPress Registration page to the Membership Levels page. | |
*/ | |
function my_bp_get_signup_page( $page ) | |
{ | |
//is PMPro activated? | |
if(defined('PMPRO_VERSION')) | |
{ | |
//filter the BuddyPress registration page to PMPro levels page |