Skip to content

Automatically toggle parent/child terms of WordPress taxonomies

License

Notifications You must be signed in to change notification settings

mischnu/wp-tax-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wp-tax-toggle

Automatically toggle parent/child terms of WordPress taxonomies

How it works

On a hireachical taxonomy…

  • when checking any term then the script will check all its parent terms as well
  • when unchecking any term then the script will uncheck all its child terms as well

Demo

How to use

Place toggle-parent-child-terms.js in js directory and enqueue script in your functions.php like this:

function enqueue_admin_scripts( $hook ) {
  if ( $hook == 'post-new.php' || $hook == 'post.php' ) :
    wp_enqueue_script( 'toggle_parent_child_terms', get_stylesheet_directory_uri() . '/js/toggle-parent-child-terms.js', array( 'jquery' ) );
  endif;
}
add_action( 'admin_enqueue_scripts', 'enqueue_admin_scripts', 10, 1 );

About

Automatically toggle parent/child terms of WordPress taxonomies

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published