Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable Level Deselection when using PMPro MMPU
<?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
You can’t perform that action at this time.