Created
November 25, 2016 17:45
-
-
Save joshfeck/abebd6fb3cdc796bf1f913de6c6d1816 to your computer and use it in GitHub Desktop.
You can put this code snippet on your site and it will disable the EE4 registration form field inputs for First Name, Last Name, and Email if the user is logged into the website. Useful with the WP User add-on.
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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
function ee_custom_disable_specific_questions() { | |
if ( is_user_logged_in() ) { | |
wp_add_inline_script( | |
'ee_form_section_validation', | |
'jQuery( document ).ready(function($) { | |
$("input[id$=-fname],input[id$=-lname],input[id$=-email]").prop( "readonly", true ); | |
});' | |
); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'ee_custom_disable_specific_questions', 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment