Opened 4 weeks ago
Last modified 4 weeks ago
#62360 assigned defect (bug)
Child category lost indention (margin-left) when it's checked but its parent not checked
Reported by: | unicornboat | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | trivial | Version: | 6.6.2 |
Component: | Taxonomy | Keywords: | close |
Focuses: | Cc: |
Description
How to replicate:
- have two categories: 1 parent and 1 child
- create a new post. the child category is indented because it's in the <ul> under its parent
- check the child category then save
- after page refreshed. the selected child category lost its indention because it's placed at the at level with its parent in the same <ul>
Change History (4)
#2
@
4 weeks ago
Thanks for testing. I realised that the editor in your test is the block editor and the issue happens when using classic editor. When I switch to the block mode, the issue is gone.
#3
@
4 weeks ago
Hi @unicornboat,
Thank you so much for providing the additional details. I was able to successfully reproduce the issue you described.
After conducting some research and reviewing the core code, I discovered that this behavior is intentional. If you’d like the indentation to remain persistent, you might consider using the wp_terms_checklist_args filter
.
Here is a code snippet that demonstrates how you can achieve this:
add_filter('wp_terms_checklist_args', 'modify_category'); function modify_category($args) { $args['checked_ontop'] = false; return $args; }
Result:
https://postimg.cc/WhmVLzG2
Note: See
TracTickets for help on using
tickets.
Hi @unicornboat,
Thank you for highlighting this issue.
I’ve tried to replicate it with the following steps:
After refreshing, my page appears as shown below:
https://postimg.cc/gwPFhx7Q
For reference, I’m using WordPress version 6.6.2.
Let me know if there are any additional steps I might have missed. Thanks again for your help!