Plugin info

Total downloads: 2,566
Active installs: 10
Total reviews: 1
Average rating: 5
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 5/15/2015 (3883 days ago)
Added to WordPress: 2/25/2012 (13 years old)
Minimum WordPress version: 3.1
Tested up to WordPress version: 4.2.39
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 3883 days ago • 1 reviews

22/100

Is Add Custom Post Type Slugs to Admin Body Class abandoned?

Possibly abandoned (last update 3883 days ago).

Compatibility

Requires WordPress: 3.1
Tested up to: 4.2.39
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Custom Body Class
Rating 5.0/5 (21 reviews)Active installs 10,000
Add Custom Body Class
Rating 5.0/5 (8 reviews)Active installs 1,000
Add URL Slugs as Body Classes
Rating 4.8/5 (5 reviews)Active installs 800
Slug as body class
Rating 5.0/5 (6 reviews)Active installs 100
LH Add Roles to Body Class
Rating 5.0/5 (1 reviews)Active installs 30
OS Adder
Rating 0.0/5 (0 reviews)Active installs 10

Description

When in Admin mode, this plug-in adds classes to the tag to let
your CSS know where you are.

For example, if you are viewing the list of all your Posts, you would get this additional class:
edit-list-post
And, when you are editing a Post, something like this:
edit-page-post

Alternatively, for custom posts, for example “movie”, you would see either:
edit-list-movie
or:
edit-page-movie

This allows you to write custom CSS and JS to interact with these varying edit pages within WP.

Please let me know if you have any questions/suggestions/thoughts,
Atg

Installation

  1. Download the ZIP
  2. Unzip the ZIP
  3. Copy/paste the unzipped files into your WP plug-in directory (/wp-content/plugins/)
  4. From within WP’s Plugin Admin panel, Activate the plug-in
  5. Write some wicked CSS and JS to amaze your friends and befuddle your enemies!

Frequently Asked Questions

What does this do, exactly?

  • Additional CSS classes are added to the HTML body tag when certain pages load in Admin mode

What classes?

  • If you are in WP Admin, if you click Posts, you will see a list of all your Posts, and the CSS class edit-list-post
    will be added to the HTML body tag. If you click a specific Post, you will enter the edit page for that Post,
    and the CSS class edit-page-post will be added to the HTML body tag. Note the difference between the two:
    edit-list-post vs. edit-page-post, list vs. page
    Similarly, if you click Pages, the same thing as above will happen, except the word post will be replaced with
    the word page in each of the CSS classes. Futher, if you have custom post types, the word post will be replaced
    with whatever your custom post type is, so a custom post type called “Movies” will results in the following CSS classes
    being added:
    edit-list-movie vs. edit-page-movie

Why would I want to do this?

  • Really only if you used some custom CSS or JS in your WP Admin. You could color the List or Edit headers or
    backgrounds differently, add custom validation to some fields, etc. Maybe when you are viewing the list of Posts,
    you want to see red column and field headers, blue when viewing Pages, and green when viewing Movies, and for the
    Movies Edit page, you have a custom field that you want to validate as some specific format, like a date or number,
    you could add custom JS just for that page, all based on these new classes on the HTML body tag.

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.3

2015-05-15:
* Tested in 4.2.2, plus added a few FAQs to better explain what this plugin does and why it might be useful

1.2

2015-03-13:
* Slight mod to make this only run in admin pages, and makes sure it is a posts list page

1.0

2012-02-24:
* Well, this is the first version, so… here it is!