Created
December 19, 2016 20:33
-
-
Save tomusborne/221ae5b5fc6a106f95b4948e2ce90ca9 to your computer and use it in GitHub Desktop.
Limit taxonomy depth to 1
This file contains hidden or 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
add_filter( 'taxonomy_parent_dropdown_args', 'limit_parents_wpse_tax_page', 10, 2 ); | |
add_filter( 'post_edit_category_parent_dropdown_args', 'limit_parents_wpse_tax_page' ); | |
function limit_parents_wpse_tax_page( $args ) { | |
if ( 'YOUR_TAXONOMY' != $args['taxonomy'] ) return $args; | |
$args['depth'] = '1'; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment