Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active May 17, 2016 04:26
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 cliffordp/96c7522622380888b44bd19abed88897 to your computer and use it in GitHub Desktop.
Save cliffordp/96c7522622380888b44bd19abed88897 to your computer and use it in GitHub Desktop.
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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment