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 | |
| //Disables the pmpro redirect to levels page when user tries to register | |
| add_filter("pmpro_login_redirect", "__return_false"); |
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 recipe will add an textare field to a PMPro Checkout. The field is labelled "Additional Information" and is located after the default billing fields. | |
| * | |
| * This code recipe requires Paid Memberships Pro and the PMPro - Register Helper Add On to be installed and activated. | |
| * Register Helper - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
| * | |
| * After Register Helper is installed and activated. Add this code recipe to a PMPro Customizations Add On - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-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 | |
| /** | |
| * This allows PMPro Series to take new post types, such as a Custom Post Type. | |
| * Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_add_post_type_to_series( $post_types ) { | |
| $post_types[] = 'my_cpt_name'; | |
| return $post_types; |
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 // NB* - Do not copy this tag over. | |
| /* | |
| * Register Helper Example for Specific Use case - not for general use. | |
| * Copy code after this comment. */ | |
| function my_pmprorh_init() | |
| { |
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 // NB* - Do not copy this tag over. | |
| /* | |
| * Register Helper Example for Specific Use case - not for general use. | |
| * Copy code after this comment. */ | |
| function my_pmprorh_init() | |
| { |
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 tag to your PMPro customization plugin | |
| function my_pmprorh_init() | |
| { | |
| //don't break if Register Helper is not loaded | |
| if(!function_exists( 'pmprorh_add_registration_field' )) { | |
| return false; | |
| } | |
| //define the fields |
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 | |
| /* Example code to add a placeholder to your field and remove the label(Title) from the field */ | |
| function my_pmprorh_init() | |
| { | |
| //don't break if Register Helper is not loaded | |
| if(!function_exists( 'pmprorh_add_registration_field' )) { | |
| return false; | |
| } |
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 | |
| /* | |
| * Example of how to add Placeholder text to a field AND remove the label from the field | |
| * To keep both replace the label value "false" with desired label name, example: "Company" | |
| */ | |
| $fields[] = new PMProRH_Field( | |
| 'text_example', // input name, will also be used as meta key | |
| 'text', // type of 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
| <?php //Do not copy this tag to your PMPro Customizations Plugin. | |
| /** | |
| * Adds custom fields to Paid Memberships Pro checkout page. | |
| * Requires Paid Memberships Pro and the PMPro Register Helper Add On. | |
| * Add this code to a PMPro Customizations Plugin or the Code Snippets plugin. | |
| */ | |
| function pmpro_add_fields_to_checkout(){ | |
| //don't break if Register Helper is not loaded |