Created
August 31, 2020 14:14
-
-
Save ronalfy/7631f5afdc24ba94ab34e4d09415197e to your computer and use it in GitHub Desktop.
Paid Memberships Pro - Move Company Field to Billing
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 | |
/** | |
* Move custom company field to the top of the billing information section if it exists. | |
*/ | |
function pmpro_move_company_to_billing() { | |
if ( is_page( 'paiement-dadhesion' ) && wp_script_is( 'jquery', 'done' ) ) { | |
?> | |
<script> | |
jQuery( '#company_div' ).prependTo( '.pmpro_checkout-field-bfirstname' ); | |
</script> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'pmpro_move_company_to_billing' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment