categories - Category tree is flattened inside admin upon saving

Is there a way to avoid WordPress "flattening" the category tree when a child category is selected?This applie

Is there a way to avoid WordPress "flattening" the category tree when a child category is selected?

This applies to both custom taxonomies and WP's built in "category" taxonomy.

To explain further, say I have the following category tree:

Parent
    Child
        Grandchild
Another parent
    Another child
    Another child
A third parent

If I then select "Grandchild" as my category, the tree will now look like this upon saving:

Grandchild
Parent
    Child
Another parent
    Another child
    Another child
A third parent

This makes it very hard for authors to remember which grandchild belongs to which parent and imo makes absolutely zero sense. I guess one reason for this might be so that the selected category is always in the top of the list, but I would very much like to disable this behaviour.

Also see attached image.

Please note that this is not theme or plugin-related. I tried this with a completely fresh WP-install with zero plugins and the default theme.

Is there a way to avoid WordPress "flattening" the category tree when a child category is selected?

This applies to both custom taxonomies and WP's built in "category" taxonomy.

To explain further, say I have the following category tree:

Parent
    Child
        Grandchild
Another parent
    Another child
    Another child
A third parent

If I then select "Grandchild" as my category, the tree will now look like this upon saving:

Grandchild
Parent
    Child
Another parent
    Another child
    Another child
A third parent

This makes it very hard for authors to remember which grandchild belongs to which parent and imo makes absolutely zero sense. I guess one reason for this might be so that the selected category is always in the top of the list, but I would very much like to disable this behaviour.

Also see attached image.

Please note that this is not theme or plugin-related. I tried this with a completely fresh WP-install with zero plugins and the default theme.

Share Improve this question asked Jan 3, 2017 at 14:05 powerbuoypowerbuoy 8421 gold badge7 silver badges15 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

I haven't fully tested this, but it may be helpful: Categories in Hierarchical Order plugin at https://wordpress/plugins/categories-in-hierarchical-order/

The plugin can be resumed to this simple code:

add_filter( 'wp_terms_checklist_args', function( $args ) {
    $args['checked_ontop'] = false;
    return $args;
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745649115a4638151.html

相关推荐

  • categories - Category tree is flattened inside admin upon saving

    Is there a way to avoid WordPress "flattening" the category tree when a child category is selected?This applie

    22天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信