Skip to content

Instantly share code, notes, and snippets.

@ronalfy
Created August 31, 2020 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ronalfy/7631f5afdc24ba94ab34e4d09415197e to your computer and use it in GitHub Desktop.
Save ronalfy/7631f5afdc24ba94ab34e4d09415197e to your computer and use it in GitHub Desktop.
Paid Memberships Pro - Move Company Field to Billing
<?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