View my_pmpro_custom_tax_example.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
<?php | |
/* | |
Custom Tax Example. | |
- Requires PMPro 1.3.13 or higher. | |
- Leave the tax fields blank in the payment settings. | |
- Level 1 has no tax. | |
- Other levels have 7.25% tax for CA customers only. | |
- We update the price description to include the tax amount. | |
*/ | |
function my_pmpro_tax($tax, $values, $order) |
View heartbeat-api-demo.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
<?php | |
/* | |
Plugin Name: Heartbeat API Demo | |
Plugin URI: http://www.strangerstudios.com/wp/heartbeat-api-demo | |
Description: Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6. | |
Version: .1 | |
Author: strangerstudios | |
If logged in as a user and viewing the frontend of your website, | |
every 15 seconds you should see the following in your Javascript console: |
View my_pmpro_default_registration_level.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
<?php | |
/** | |
* When registering, add the member to a specific membership level | |
* @param integer $user_id | |
**/ | |
//Disables the pmpro redirect to levels page when user tries to register | |
add_filter("pmpro_login_redirect", "__return_false"); | |
function my_pmpro_default_registration_level($user_id) { |
View my_pmpro_member_links
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 |
View assign_pmpro_level_to_role.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
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 |
View my_gettext_pmpro_mailchimp.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 wording in PMPro MailChimp Opt In Box | |
Add this code to your active theme's functions.php or a custom plugin. | |
Change the $translated_text = lines to the text you want. | |
*/ | |
function my_gettext_pmpro_mailchimp($translated_text, $text, $domain) | |
{ | |
if($domain == "pmpro" && $text == "Join one or more of our mailing lists.") | |
$translated_text = "Join one or more of our newsletters."; | |
elseif($domain == "pmpro" && $text == "Join our mailing list.") |
View pmpro_clear_all_data_init.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
/* | |
Clear out all PMPro member and report data. (Back up your database first. Use at your own risk!!!) | |
This will delete all orders, members/level data, and reporting data. | |
Your levels, discount codes, and settings will remain in place. | |
All users will remain users (without memberships). | |
All subscriptions at the gateway will remain active. | |
To Use: | |
* Copy this code into your active theme's functions.php or a custom WP plugin. | |
* Navigate to /wp-admin/?pmprocleardata=1 when logged in as an admin. |
View coming_soon.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
/* | |
1. Create a page called "Coming Soon" with the slug "coming-soon". | |
If you use something different, be sure to update the code below. | |
2. Copy just one of the blocks of code below to a custom plugin or your active theme's functions.php. | |
*/ | |
//redirect non-users to the coming soon page | |
function coming_soon_redirect() | |
{ |
View pmpro_after_checkout_gift_level_set_expiration.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
/* | |
Define Gift Levels | |
*/ | |
function init_gift_level() | |
{ | |
//define the levels | |
global $pmprogl_gift_levels; | |
$pmprogl_gift_levels = array( | |
4 => array( // "Purchase Gift" level ID | |
'level_id' => 1, // Membership Level ID of the gift membership level. |
NewerOlder