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: Restrict administration access | |
Plugin URI: | |
Description: Restrict administration access | |
Author: | |
Version: 1.00 | |
Author URI: | |
*/ |
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 Customizations (Register Helper Example) | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for Paid Memberships Pro (Register Helper Example) | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
//we have to put everything in a function called on init, so we are sure Register Helper is loaded |
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 assign_pmpro_level_to_role($user_id, $role, $old_roles) | |
{ | |
//we found a role related to pmpro level | |
if($role == "pmpro_level_1") | |
{ | |
pmpro_changeMembershipLevel(1, $user_id); | |
} | |
elseif($role == "administrator") | |
{ | |
pmpro_changeMembershipLevel(2, $user_id); //setup level 2 as an all access role or just give them level 1 |
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
/* | |
Set TOS on checkout page. | |
Change the if/else statement below and change the post ids that $tospage is set to. | |
*/ | |
function my_option_pmpro_tospage($tospage) | |
{ | |
global $pmpro_level; | |
if($pmpro_level->id == 2) | |
{ |
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
//Add links to the top of the list | |
function my_pmpro_member_links_top() | |
{ | |
//Add the level IDs here | |
if(pmpro_hasMembershipLevel(array(1,2,3))) | |
{ | |
//Add the links in <li> format here | |
?> | |
<li><a href="/top/">My Member Link Top</a></li> | |
<?php |
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 | |
/* | |
Reorder Levels on Levels Page | |
Adjust this code to your needs (change $levels_order) and | |
add this to your active theme's functions.php or a custom WordPress plugins. | |
*/ | |
function my_pmpro_levels_array($levels) | |
{ | |
//here is where you define the order of levels based on level id | |
$levels_order = array(1,3,2,4); |
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
/* | |
Don't let exisisting members checkout for free level. | |
*/ | |
function my_pmpro_registration_checks($okay) | |
{ | |
//only check if things are okay so far | |
if($okay) | |
{ | |
global $pmpro_level; | |
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 | |
//shop page for add ons | |
function pmpro_addons_shortcode($atts, $content=null, $code="") | |
{ | |
ob_start(); | |
global $wpdb, $post, $current_user, $pmpro_currency_symbol; | |
?> | |
<div id="pmpro_addons"> | |
<?php | |
$count = 0; |
OlderNewer