Created
October 6, 2017 07:21
-
-
Save perezdans/3c9accb62fd9422b981847848e30e055 to your computer and use it in GitHub Desktop.
Cuando tienes varias categorías / sub-categorías y marcas un post como perteneciente a una sub-categoría y lo guardas, WordPress automáticamente te muestra esa sub-categoría la primera y pierdes visualmente la jerarquía. Es decir, no puedes saber visualmente si es categoría principal o tiene una categoría “padre”.
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
// Keep Category Hierarchy | |
function keep_category_hierarchy( $args ) { | |
$args[‘checked_ontop’] = false; | |
return $args; | |
} | |
add_filter( ‘wp_terms_checklist_args’, ‘keep_category_hierarchy’ ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment