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 | |
| /** | |
| * On login, redirect to the last post viewed or custom page if no last page available. | |
| * Add this code into a custom plugin. | |
| * Note that many themes and plugins hook into login_redirect. | |
| * Whichever hook has the highest priority will be the last call | |
| * on where to redirect. The priority below is set to 20. | |
| * Note also that some URLs/pages may note be "posts" | |
| * and may not have an ID we can track. |
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 recipe makes required Register Helper fields added to the profile | |
| * required in the user edit profile form. | |
| * | |
| * Requires the Register Helper field atributes profile and required set to true, e.g. | |
| * 'profile' => true, | |
| * 'required' => true, | |
| * |
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 | |
| /** | |
| * 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. |
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 | |
| /* | |
| * 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 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 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 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 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 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 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 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 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 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 //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 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 // 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 |