Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dwanjuki/c2fe0a5c12bb37c1c393cdadde344c73 to your computer and use it in GitHub Desktop.

Select an option

Save dwanjuki/c2fe0a5c12bb37c1c393cdadde344c73 to your computer and use it in GitHub Desktop.
Show Payment Plans after Membership Information on checkout page.
<?php // copy form below.
/**
* Show Payment Plans after Membership Information on checkout page.
*
* 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_pmpropp_show_plans_after_pricing_fields() {
if ( has_action( 'pmpro_checkout_boxes', 'pmpropp_render_payment_plans_checkout', 10 ) ) {
// Unhook pmpropp_render_payment_plans_checkout from checkout boxes.
remove_action( 'pmpro_checkout_boxes', 'pmpropp_render_payment_plans_checkout', 10 );
// Add back pmpropp_render_payment_plans_checkout below Membership Information.
add_action( 'pmpro_checkout_after_pricing_fields', 'pmpropp_render_payment_plans_checkout', 5 );
}
}
add_action( 'init', 'my_pmpropp_show_plans_after_pricing_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment