Created
August 13, 2020 19:24
-
-
Save MaryOJob/bbec79fd13dd1a0541c949bab5dafa98 to your computer and use it in GitHub Desktop.
Disable Level Deselection when using PMPro MMPU
This file contains 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 | |
/** | |
* MMPU - Prevent user from de-selecting a level if they have previously checked out for level. | |
*/ | |
function pmpro_output_level_jquery_mmpu_disable() { | |
if ( wp_script_is( 'jquery', 'done' ) && is_page( 'membership-levels' ) ) { | |
?> | |
<script> | |
jQuery( '.pmpro_level-select-current input' ).prop( 'disabled', 'disabled' ); | |
</script> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'pmpro_output_level_jquery_mmpu_disable' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment