[wp-trac] [WordPress Trac] #35010: Quick Edit: do not apply level to non-hierarchical post types
WordPress Trac
noreply at wordpress.org
Fri Dec 11 11:53:45 UTC 2015
#35010: Quick Edit: do not apply level to non-hierarchical post types
-------------------------------+-----------------------------
Reporter: Offereins | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 3.0
Severity: normal | Keywords:
Focuses: administration |
-------------------------------+-----------------------------
'''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
[https://core.trac.wordpress.org/changeset/21192 '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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35010>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list