Skip to content

Instantly share code, notes, and snippets.

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/c7d1cb21ed7f4b582058f25c395b90dc to your computer and use it in GitHub Desktop.
Save Pebblo/c7d1cb21ed7f4b582058f25c395b90dc to your computer and use it in GitHub Desktop.
Example of how to hide the ticket details of a ticket if the details of another are set to display.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'wp_enqueue_scripts', 'tw_ee_hide_tkt_details_when_showing_others', 20);
function tw_ee_hide_tkt_details_when_showing_others() {
$js =
"jQuery('.display-the-hidden').on( 'click', function(e) {
jQuery('.hide-the-displayed:visible').each(function(){
jQuery(this).click();
});
});";
wp_add_inline_script('ticket_selector', $js);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment