Opened 9 years ago
Closed 9 years ago
#35010 closed enhancement (fixed)
Quick Edit: do not apply level to non-hierarchical post types
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
Context
In my code I have set my non-hierarchical post type unit
to have a Page as a parent page (using the wp_insert_post_parent
filter). That way I have ensured that all units
will have the same parent in the site's hierarchy.
Issue
When viewing the units
in the wp-admin/edit.php post list table, everything is fine. But when I'm updating a unit
through the Quick Edit function, the updated row returns with a padded title, like — — Unit 13
. While it correctly represents the hierarchy sitewide, the padding is irrelevant in the post list table, as all other units
do not have such padded titles. Now those non-hierarchical posts are visually demoted. I would expect to have this behavior only apply to hierarchical post types. (Though the same issue might appear when the site's hierarchy spans beyond that very post type.)
Solution
The solution lies in wp_ajax_inline_save()
, where the $level
parameter is passed to the display method of the post list table class. I suggest the Two patches are attached to provide a solution. Patch 1 solves this issue just for non-hierarchical post types, and patch 2 extends 1) with only applying $level
for the same post type.
Attachments (2)
Change History (10)
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
#5
follow-up:
↓ 7
@
9 years ago
- Milestone changed from Future Release to 4.6
I'll clean this patch up on Friday night.
Do not apply level for non-hierarchical post types