Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/ed98885b6dfa36685017be39e4328e26 to your computer and use it in GitHub Desktop.
Save dwanjuki/ed98885b6dfa36685017be39e4328e26 to your computer and use it in GitHub Desktop.
Hide Group Accounts field on Addon Package Checkout pages
<?php
/**
* Hide Group Accounts field on Addon Package Checkout pages
*
* 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_pmpro_hide_group_field_on_ap_checkout() {
if ( ( isset( $_REQUEST['level'] ) || isset( $_REQUEST['pmpro_level'] ) ) && isset( $_REQUEST['ap'] ) && function_exists( 'pmproap_hasAccess' ) && function_exists( 'pmprogroupacct_checkout_after_level_cost_child' ) ) {
remove_action( 'pmpro_checkout_after_level_cost', 'pmprogroupacct_checkout_after_level_cost_child' );
}
}
add_action( 'init', 'my_pmpro_hide_group_field_on_ap_checkout' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment