[wp-trac] [WordPress Trac] #25791: Add a nesting level class to <tr> elements in #the-list

WordPress Trac noreply at wordpress.org
Sun Nov 17 20:39:10 UTC 2013


#25791: Add a nesting level class to <tr> elements in #the-list
-------------------------------------+--------------------
 Reporter:  jhned                    |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  3.8
Component:  Administration           |     Version:  trunk
 Severity:  minor                    |  Resolution:
 Keywords:  needs-testing has-patch  |
-------------------------------------+--------------------
Changes (by nacin):

 * milestone:  Awaiting Review => 3.8


Comment:

 jhned and I worked through this at the WC Orlando contributor day. The
 patch looked good; the concern at that point led to whether the call to
 get_post_ancestors() was a performance hit, in terms of increased queries.

 Normally, we have the full hierarchy already, so there is no penalty. But
 if a search only returns a non-top-level page, we won't yet have its
 ancestors. At this point, we would need to run new queries.

 However, we separately need the ancestors for two other reasons. One, if
 pretty permalinks are turned on, we need them in get_page_uri() for the
 'View' action link. Two, we need to figure out how many levels deep that
 page is so we can properly display its level, via em-dashes. (We also need
 its parent so we can show "Parent Page:", but ancestors are still needed
 for levels.) That particular code is in the
 [https://core.trac.wordpress.org/browser/tags/3.7.1/src/wp-admin/includes
 /class-wp-posts-list-table.php#L531 list table] — $level = 0 but we know
 better, so we need to calculate the depth.

 [attachment:add_nesting_class.diff] is good to go.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25791#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list