Created
October 23, 2020 10:34
-
-
Save gausam/f7e91ca2d9841fde25ba79783b396696 to your computer and use it in GitHub Desktop.
Modify the checkout page to show Register Helper fields after Billing Address 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 | |
/** | |
* This recipe modifies the checkout page to show Register Helper fields after Billing Address fields. | |
* | |
* It is intended for use with the Register Helper Add On: | |
* https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprorh_init() { | |
remove_action( 'pmpro_checkout_boxes', 'pmprorh_pmpro_checkout_boxes' ); | |
} | |
add_action( 'init', 'my_pmprorh_init' ); | |
function mypmpro_checkout_after_billing_fields() { | |
add_action( 'pmpro_checkout_boxes', 'pmprorh_pmpro_checkout_boxes' ); | |
do_action( 'pmpro_checkout_boxes' ); | |
} | |
add_action( 'pmpro_checkout_after_billing_fields', 'mypmpro_checkout_after_billing_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment