• 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • You might want to have a look at the MP6 plugin. It’s slated to be added to core in WP 3.8, so if you get involved in the discussions now, you might get your suggestions rolled into the plugin and then into core.

    Longer term, I know there is a drive to try and make the admin area far more easily theme-able, so anything that you can add to this now could help further down the line.

    Thread Starter jhned

    (@jhned)

    Oh, really? I’ve been using the MP6 plugin, but I thought it was only for CSS modifications, not PHP modifications. I think I’ll probably just write a patch for it, but wanted to see if anybody else has tried it before first– from my research, it looks like it hasn’t come up yet.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can we add a class of ".child" to WordPress admin Pages table?’ is closed to new replies.