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 | |
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
add_filter( 'gettext', 'change_my_cost_example', 20, 3 ); | |
/** | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
add_filter( 'gettext', 'change_my_cost_example', 20, 3 ); | |
/** |
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 | |
/* | |
* Add WP User Avatar from Register Helper field during checkout. | |
*/ | |
function my_updated_user_meta( $meta_id, $user_id, $meta_key, $meta_value ) { | |
// Change user_avatar to your Register Helper file upload name. | |
if ( 'user_avatar' == $meta_key ) { | |
$filename = $meta_value['fullpath']; | |
$filetype = wp_check_filetype( basename( $filename ), null ); |
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 // Do NOT copy this line | |
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
add_action( 'pmpro_invoice_bullets_bottom', 'my_pmpro_invoice_address' ); | |
function my_pmpro_invoice_address() { | |
?> | |
<li><strong><?php _e( 'Paid To', 'pmpro-customizations' ); ?>:</strong><br />My Business<br />123 The Street<br />City, XX 12345 USA</li> | |
<li><strong><?php _e( 'VAT Number', 'pmpro-customizations' ); ?>:</strong> BG999999999</li> | |
<?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 //Do NOT copy this line | |
/* Hide "View all Membership Options" link */ | |
add_filter( 'gettext', 'my_gettext_pmpro_hide_view_membership_options', 10, 3 ); | |
function my_gettext_pmpro_hide_view_membership_options( $translated_text, $text, $domain ) { | |
if ( $pmpro_pages['account'] && 'paid-memberships-pro' == $domain && 'View all Membership Options' == $text ) { | |
$translated_text = ''; | |
} | |
return $translated_text; | |
} |
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 | |
/** | |
* This recipe creates a [my_pmpro_series] shortcode | |
* to display a specific series post list. | |
* | |
* This shortcode requires that a Series (Post) ID is provided. | |
* | |
* To obtain the Post ID for a series, from the | |
* WordPress dashboard navigate to Series > Series, | |
* click on the series name, in the edit page URL |
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 | |
/** | |
* Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order. | |
* Add this code recipe to a PMPro Customization Plugin - Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order | |
* Various classes added to strings to allow for styling - ".pmpro-discorig-message", ".pmpro-orginal-price", ".pmpro-discount-price", ".pmpro-save-price" | |
* | |
* [my_pmpro_applydiscountcode_return_js] Display original price and discount when a discount code is applied. | |
* @param string $discount_code [description] | |
* @param integer $discount_code_id [description] |
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 | |
/** | |
* This code gist illustrates a way to customize the format of your members phone number. | |
* | |
* In this example, we will change the PMPro phone number from | |
* | |
* (123)456-7890 | |
* to 1234567890 | |
* | |
* Adjust this code gist to suit your needs for phone number. |
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 | |
/* | |
This code example serves as an experimental example. | |
The preferred method of showing custom fields in the signup shortcode is to use the shortcode attribute custom_fields | |
[pmpro_signup submit_button="Unlock this Post Now!" level="1" login="1" redirect="referrer" custom_fields="true"] | |
See - https://www.paidmembershipspro.com/add-ons/pmpro-signup-shortcode/ | |
*/ |
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 | |
/* | |
* Redirects members-only content to the Membership Levels page if a user is logged out or not a member. | |
*/ | |
function my_template_redirect_require_membership_access() { | |
if ( function_exists( 'pmpro_has_membership_access' ) && ! pmpro_has_membership_access() ) { | |
if ( ! is_multisite() && ! function_exists( 'pmpro_multisite_membership_init' ) ) { | |
wp_safe_redirect( pmpro_url( 'levels' ) ); | |
exit; |
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 | |
/** | |
* Redirect user's to a new URL instead of the 'levels' page in PMPro. | |
* Add this code to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function redirect_users_to_a_new_page( $url ){ | |
return home_url('my-landing-page-slug'); //change this to the page slug you would like to redirect your user's to. |