Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/67cc6b7b8094a71f6a52a93eab222904 to your computer and use it in GitHub Desktop.
Save kimwhite/67cc6b7b8094a71f6a52a93eab222904 to your computer and use it in GitHub Desktop.
Load custom CSS for Membership Checkout for specific level - Paid Memberships Pro
<?php
/**
* When a Level is check only and PayPal Express options still displays.
* Change the array on line 13 to your levels
* Load custom CSS on checkoutpage for specific membership level in Paid Memberships Pro.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function load_css_for_level_checkout(){
global $pmpro_pages;
// Change your membership level ID here.
if ( is_page( $pmpro_pages['checkout'] ) && isset( $_REQUEST['level'] ) && in_array( $_REQUEST['level'], array( 2,3 ) )) {
?>
/* Add Custom CSS below */
<style type="text/css">
div.hide_for_2 {display: none !important;}
</style>
<?php
}
}
add_action( 'wp_footer', 'load_css_for_level_checkout', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment