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 | |
/* | |
* This is demo content for the Sitewide Sale Add On for Paid Memberships Pro. | |
* You can view a live preview of this content in the "Ocean" Sale Template here: | |
* https://demo.memberlitetheme.com/membership/sitewide-sales/sample-sale-3/ | |
* | |
* Remove this comment and place the content below into the "Sale Content" field of your Sitewide Sale. | |
*/ | |
?> | |
<div class="text-center"> |
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 | |
/* | |
* This is demo content for the Sitewide Sale Add On for Paid Memberships Pro. | |
* You can view a live preview of this content in the "Photo" Sale Template here: | |
* https://demo.memberlitetheme.com/membership/sitewide-sales/sample-sale-4/ | |
* | |
* Remove this comment and place the content below into the "Sale Content" field of your Sitewide Sale. | |
*/ | |
?> | |
<h1>Quit Clowning Around</h1> |
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 | |
/* | |
* This is demo content for the Sitewide Sale Add On for Paid Memberships Pro. | |
* You can view a live preview of this content in the "Scroll" Sale Template here: | |
* https://demo.memberlitetheme.com/membership/sitewide-sales/sample-sale-5/ | |
* | |
* Remove this comment and place the content below into the "Sale Content" field of your Sitewide Sale. | |
*/ | |
?> | |
<div class="sws-banner"> |
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 | |
/* | |
* Filters the array of available templates for Sitewide Sales Add On for Paid Memberships Pro. | |
* | |
* @param array $templates The default list of available templates. | |
*/ | |
function add_custom_pmpro_sws_landing_page_templates( $templates ) { | |
$templates['black-friday'] = 'Black Friday'; // This is how you add a new template to the array. | |
//unset( $templates['neon'] ); // This is how you unset an included template from the array. | |
return $templates; |
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 | |
/** | |
* Hide the PMPro pricing box at checkout and replace with our own. | |
* | |
* Requires Paid Memberships Pro v1.9.5.6+ and the Sitewide Sales Add On v1.0+ | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function maybe_add_choose_level_section( $include_pricing_fields ) { | |
global $wpdb, $pmpro_level; |
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 | |
/* | |
* Add a radio box to the Sitewide Sale Landing Page that dynamically pulls in that sale's discount code and | |
* draws a radio selection for each level the code applies to. | |
* Shows the modify level cost text based on the applied discount code for each level. | |
*/ | |
/** | |
* We need to set $_REQUEST['level'] early on our | |
* sitewide sales pages to support other customizations. |
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 | |
/* | |
* Add this code into a custom plugin. Combine this with the pmpro-set-expiration-date and/or pmpro-subscription-delay plugins | |
* to have memberships expire/renew on the same date, e.g. Y2-01-01 to expire/renew on Jan 1 next year. | |
* | |
* You can update the logic to check for different months or adjust the price in a different way. The code below divides the | |
* initial payment by 2 July 1 through Dec 31. | |
*/ | |
function pmpro_checkout_level_half_off_mid_year( $level ) { | |
$month = date( 'n', current_time( 'timestamp' ) ); |
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 | |
/** | |
* Custom downgrade on membership cancellation code for sabbella ticket. | |
*/ | |
function sabbella_pmpro_after_change_membership_level_downgrades( $level_id, $user_id ) { | |
// if we see this global set, then another gist is planning to give the user their level back | |
global $pmpro_next_payment_timestamp; | |
if ( ! empty( $pmpro_next_payment_timestamp ) ) { | |
return; |
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 | |
/* | |
* Add the 'pmpro-checkout' body class to Sitewide Sales landing pages. | |
* | |
*/ | |
function add_pmpro_checkout_body_class_sws( $classes ) { | |
// See if any Sitewide Sale CPTs have this post ID set as the Landing Page. | |
$sitewide_sale_id = get_post_meta( get_queried_object_id(), 'pmpro_sws_sitewide_sale_id', true ); | |
if ( ! empty( $sitewide_sale_id ) ) { | |
$classes[] = 'pmpro-checkout'; |
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 | |
/** | |
* Gift Levels Example for thehawaiiherald.com | |
*/ | |
global $pmprogl_gift_levels; | |
$pmprogl_gift_levels = array( | |
// Set level 2 as a "Purchase Gift" membership level to create a gift code for "Basic Online" membership for 1 year. | |
2 => array( // "Purchase Gift" level ID | |
'level_id' => 1, // Membership Level ID of the gift membership level. |