Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active June 16, 2020 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/cfc2e072a97dbb3243fe166f1a831164 to your computer and use it in GitHub Desktop.
Save Pebblo/cfc2e072a97dbb3243fe166f1a831164 to your computer and use it in GitHub Desktop.
Example of how to hide the Personal information question group's email question using CSS if the current user is logged in.
<?php //Please do not include the opneing PHP tag if you already have one.
function tw_ee_hide_primary_email(){
if( is_user_logged_in() ) {
wp_add_inline_style(
'single_page_checkout',
'div[id*="ee-reg-form-qstn-grp-personal-information"] .ee-reg-qstn-email {
display: none;
}'
);
}
}
add_action( 'wp_enqueue_scripts', 'tw_ee_hide_primary_email', 50 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment