Can we add a class of ".child" to WordPress admin Pages table?
-
I work with WordPress a lot, both in development and in content entry. Doing content entry on sites that have > 100 pages can be rough, and I sometimes style the WordPress admin through the admin_head hook to help set different sections apart as I’m scrolling quickly through the list of pages or posts.
One thing I’d like to style but haven’t yet been able to are child– there’s no class on the tr in #the-list to differentiate a child page and a top-level page. The — is ok, but not if you’re going through it quickly.
Adding a class to child page list items is as simple as dropping this code into class-wp-posts-list-table.php on line 493:
if ( $post->post_parent != 0 ) { $classes .= ' child'; }
This is inelegant, as it does not account for how many levels deep the child page is nested. If anyone has suggestions on how to efficiently achieve that, I’d love to hear it.
Josh
- The topic ‘Can we add a class of ".child" to WordPress admin Pages table?’ is closed to new replies.