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 | |
/** | |
* Use a custom shortcode with the Social Login Add On for Paid Memberships Pro (Requires v.3 or above) | |
* | |
*/ | |
function my_pmprosl_custom_shortcode( $shortcode ) { | |
// Edit this line to change the shortcode displayed on the checkout page. | |
return '[TheChamp-Login title="Use your Social Account to Login"]'; | |
} | |
add_filter( 'pmprosl_login_shortcode', 'my_pmprosl_custom_shortcode' ); |
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 | |
// Display membership pricing along with regular pricing. | |
function my_woocommerce_get_price_html($price, $product) { | |
// Get all levels. | |
$all_levels = pmpro_getAllLevels(true, true); | |
// Get original price. | |
$reg_price = wc_price($product->get_regular_price()); |
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 will show '0/X spots available.' on membership level if a limit is set from (https://www.paidmembershipspro.com/limit-number-members-membership-level/) | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* For help, post a support thread on www.paidmembershipspro.com | |
*/ | |
function pmpro_show_spots_available( $expiration_text, $level ) { | |
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
<?php | |
/** | |
* Add a Custom Report to the Memberships > Reports Screen in Paid Memberships Pro. | |
* | |
* For each report, add a line like: | |
* global $pmpro_reports; | |
* $pmpro_reports['slug'] = 'Title'; | |
* | |
* For each report, also write two functions: | |
* pmpro_report_{slug}_widget() to show up on the report homepage. |
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 filter will send additional user meta fields to contacts in GetResponse. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* @param array $fields the array of fields to send | |
* @param object $user what is written in the code that we want to change | |
*/ |
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
# BACKUP FIRST | |
# This will remove any expiration date on | |
# every member in your database. | |
# BACKUP FIRST | |
UPDATE wp_pmpro_memberships_users | |
SET enddate = '0000-00-00 00:00:00' | |
WHERE status = 'active' |
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. |
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 Register Helper fields for donteatthat thread on price-adjusting fields. | |
*/ | |
function donteatthat_pmprorh_init() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} |