Created
September 26, 2019 11:09
-
-
Save Pebblo/be2723c4f8bf347ebbeaae8213f9aa1c to your computer and use it in GitHub Desktop.
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 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