This file contains hidden or 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 | |
/* | |
Only allow users to use the trial level once. | |
Add this code to your active theme's functions.php | |
or a custom plugin. | |
Be sure to change the $trial_level_id variable in multiple places. | |
*/ | |
//record when users gain the trial level | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ |
This file contains hidden or 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 | |
/** | |
* Change membership level for users expiring from startup level, moving them to primary level. | |
* Users can cancel their membership level after their before or after the membership level change. | |
*/ | |
function wbon_change_default_level_when_expiring_startup( $user_id, $level_id ) { | |
global $wpdb; |
This file contains hidden or 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
/* | |
If a parent account checks out and distributes the discount code to 3/10 of its child accounts, | |
the parent account should still have 7 remaining. This 7 remaining uses should persist after a | |
renewal by the parent account. | |
By default the discount codes have an expiration period of one year. | |
Even if they renew, the discount code expiration date is not updated. | |
We are hard coding the start and end date of the discount code itself in the function pmprosm_createSponsorCode() |
This file contains hidden or 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
header.entry-header { | |
position: absolute !important; | |
height: 1px; | |
width: 1px; | |
overflow: hidden; | |
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ | |
clip: rect(1px, 1px, 1px, 1px); | |
} | |
body #page { |
This file contains hidden or 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
/** | |
* BLOCK: gtm-audio-block | |
* | |
* Registering a basic block with Gutenberg. | |
* Simple block, renders and saves the same content without any interactivity. | |
*/ | |
// Import CSS. | |
import './style.scss'; | |
import './editor.scss'; |
This file contains hidden or 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
/* | |
Setup Level 3 to start next Monday and end the following Monday | |
Requires PMPro 1.8.9 or higher. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
//startdate | |
function my_pmpro_checkout_start_date($enddate, $user_id, $level) { | |
if($level->id == 3) |
This file contains hidden or 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 the global array below for your main accounts and sponsored levels. | |
Array keys should be the main account level. | |
*/ | |
global $pmprosm_sponsored_account_levels; | |
$pmprosm_sponsored_account_levels = array( | |
//set 5 seats at checkout | |
1 => array( | |
'main_level_id' => 1, //redundant but useful | |
'sponsored_level_id' => array(1,2), //array or single id |
This file contains hidden or 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: Paid Memberships Pro: Extend membership by new level duration | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: On change of level, modify the end date to add the new level's time | |
Version: 1.0 | |
Requires: 4.5.3 | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
*/ |