Created
April 7, 2025 08:37
-
-
Save dwanjuki/ed98885b6dfa36685017be39e4328e26 to your computer and use it in GitHub Desktop.
Hide Group Accounts field on Addon Package Checkout pages
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 | |
/** | |
* 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