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
pmprorh_add_checkout_box("personal", "Personal Information"); //order parameter defaults to one more than the last checkout box | |
pmprorh_add_checkout_box("business", "Business Information", "Fields below are optional but will help us in verifying your account."); |
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
$field = new PMProRH_Field("gender", "select", array("options"=>array("" => "", "male"=>"Male", "female"=>"Female"))); | |
pmprorh_add_registration_field("personal", $field); | |
$field = PMProRH_Field("company", "text", array("size"=>40, "class"=>"company", "profile"=>true, "required"=>true)); | |
pmprorh_add_registration_field("business", $field); |
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
/* | |
Shortcode to show a member's expiration date. | |
Add this code to your active theme's functions.php or a custom plugin. | |
Then add the shortcode [pmpro_expiration_date] where you want the current user's | |
expiration date to appear. | |
If the user is logged out or doesn't have an expiration date, then --- is shown. | |
*/ |
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 | |
//Update line 6 below to your preferred dynamic page description. | |
function my_pmpro_filter_wpseo_metadesc($description) { | |
global $pmpro_pages, $pmpro_level; | |
if( is_page($pmpro_pages['checkout']) ) { | |
$description = $pmpro_level->description; | |
} | |
return $description; | |
} | |
add_filter('wpseo_metadesc', 'my_pmpro_filter_wpseo_metadesc'); |
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 | |
//Update line 6 below to your preferred dynamic page title | |
function my_pmpro_filter_wpseo_title($title) { | |
global $pmpro_pages, $pmpro_level; | |
if( is_page($pmpro_pages['checkout']) ) { | |
$title = $pmpro_level->name . ': Complete Your Membership Checkout'; | |
} | |
return $title; | |
} | |
add_filter('wpseo_title', 'my_pmpro_filter_wpseo_title'); |
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 | |
/* | |
*************** !! | |
!! IMPORTANT NOTE: This can more easily be done using the addon maintained here: | |
!! https://github.com/strangerstudios/pmpro-auto-renewal-checkbox | |
*************** !! | |
Allow users to choose to auto renew | |
1. Edit the global variable below to set the renewal amount (can be the same or less) for each level. | |
2. Paste this code into your active theme's functions.php or a custom plugin. |
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 field is for addon packages only. | |
*/ | |
if(!empty($_REQUEST['ap'])) //might want to also look up ap to see if it's active/etc | |
$profile = true; | |
else | |
$profile = 'only_admin'; | |
$fields[] = new PMProRH_Field( |
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
/* | |
Charge different prices for different membership levels. | |
*/ | |
//global var to store the price configurations | |
global $custom_addon_package_prices; | |
$custom_addon_package_prices = array( | |
//post_id => array(level_id => price, level_id => price, ...) | |
353 => array(1 => 1500, 2 => 1000, 3 => 500) | |
); |
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 | |
function my_pmprorh_depends_fields_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; | |
} | |
//add a new "About Your Pets" box on checkout form |
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
/* | |
Run PMPro shortcodes later to avoid issues with the_content filters/etc | |
Add this code to your active theme's functions.php or a custom plugin. | |
You may need to change the priority of the add_filter calls below to get the desired result. | |
*/ | |
//this function removes the shortcodes to keep them from being messed with | |
function pmpro_shortcodes_later_prep($content) { | |
$shortcodes = array('pmpro_account', 'pmpro_billing', 'pmpro_cancel', 'pmpro_checkout', 'pmpro_confirmation', 'pmpro_invoice', 'pmpro_levels'); | |