Make the Event Categories' sub-categories expanded by default on the Community Events form
<?php
/**
* From https://gist.github.com/cliffordp/96c7522622380888b44bd19abed88897
*
* Make the Event Categories' sub-categories expanded by default on the Community Events form
* The initial CE form appears like this without this snippet in effect: http://cl.ly/3a0U430s1u3R
*
*/
add_action( 'tribe_events_community_after_the_categories', 'cliff_tribe_community_events_form_taxonomies_expanded' );
function cliff_tribe_community_events_form_taxonomies_expanded() {
?>
<script>
jQuery( document ).ready( function() {
jQuery( "#tribe-community-events #event-categories ul.tribe-categories-with-children > li" ).addClass( "tribe-expanded" );
});
</script>
<?php
}