最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Why aren't sub-categories nested after creating post in the WP Admin?

matteradmin9PV0评论

I have several sub-categories set up. Everything displays properly as far as nesting (see below) when creating a new post.

Category 1

--Sub Category 1

--Sub Category 2

--Sub Category 3

Category 2

etc

After I select a sub-category, then go back and edit a post, the sub category that I check shows up like this (note how it's not nested under Category 1):

(checkmark) Sub Category 2

Category 1

--Sub Category 1

--Sub Category 3

Category 2

etc

Is this a bug in WordPress 3.1.2? Can someone tell me how to fix it? I don't remember it doing this when I was running 3.0.5 (but there's a chance it could have).

I have several sub-categories set up. Everything displays properly as far as nesting (see below) when creating a new post.

Category 1

--Sub Category 1

--Sub Category 2

--Sub Category 3

Category 2

etc

After I select a sub-category, then go back and edit a post, the sub category that I check shows up like this (note how it's not nested under Category 1):

(checkmark) Sub Category 2

Category 1

--Sub Category 1

--Sub Category 3

Category 2

etc

Is this a bug in WordPress 3.1.2? Can someone tell me how to fix it? I don't remember it doing this when I was running 3.0.5 (but there's a chance it could have).

Share Improve this question edited Sep 19, 2011 at 23:30 kaiser 51k27 gold badges151 silver badges245 bronze badges asked May 23, 2011 at 16:14 user1462user1462 1,3043 gold badges17 silver badges23 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 8

This "feature" has been in WP for quite a while.

You can disable it by installing this small plugin:

http://wordpress/extend/plugins/category-checklist-tree/

It was mentioned that scribu's plugin hasn't been updated in four years. However, the plugin is fairly simple and the most important part is this:

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

  return $args;
} );

That's what the plugin mainly does — plus some JavaScript to scroll to the first category checkbox that is checked. But that's just for convenience.

Post a comment

comment list (0)

  1. No comments so far