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 <[email protected]> | |
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
/* | |
Send Gift Certificate email at checkout. | |
Requirements: | |
1. Paid Memberships Pro | |
2. The PMPro Gift Levels Addon | |
3. Register Helper Add On with a "gift_certificate_email" field added via custom code. | |
***MODIFIED*** | |
Adds the email shortcode !!code_url!! so we can potentially use it in a custom email template with PMPro Email Templates plugin. |
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 |
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
function my_pmpro_add_cols_header($order_ids) { | |
ob_start(); ?> | |
<th>Discount Code</th><?php | |
return ob_get_clean(); | |
} | |
add_filter('pmpro_orders_extra_cols_header', 'my_pmpro_add_cols_header'); | |
function my_pmpro_add_cols_body($order) { |