Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created September 26, 2019 11:09
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/be2723c4f8bf347ebbeaae8213f9aa1c to your computer and use it in GitHub Desktop.
Save Pebblo/be2723c4f8bf347ebbeaae8213f9aa1c to your computer and use it in GitHub Desktop.
<?php // Please do not include the opening PHP tag if you already have one
function tw_ee_add_class_to_hidden_table_rows() {
wp_add_inline_script(
'espresso_events_table_template',
'jQuery(document).ready(function($){
$("#ee_filter_cat, #filter").change(function() {
let ee_filter_table_rows = $(".espresso-table-row");
// console.log(ee_filter_cat_id);
ee_filter_table_rows.each(function() {
if ( $(this).is(":visible") ) {
$(this).removeClass("print-no");
} else {
$(this).addClass("print-no");
}
});
});
});'
);
}
add_action( 'wp_enqueue_scripts', 'tw_ee_add_class_to_hidden_table_rows', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment