WordPress plugin intelligence profile

Enhanced Body Class

WordPress plugin to add user-related classes to body tag, allowing you to easily customize styling by role or specific user.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.8
Current version1.0.8
WordPress coverageTested up to WordPress 6.8
Minimum stackWP 4.6 · PHP 5.6.40
Directory statusactive
Last directory update25 Apr 20251y ago
Active installationsNewAdoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Enhanced Body Class version 1.0.8 as active, updated 1y ago and tested up to WordPress 6.8.

Overview

About this plugin

WordPress plugin to add user-related classes to the body tag. This can be enabled on the frontend and backend of the site.

The css classes allow you to easily customize styling by role or a specific user.

Features

  • Toggle display on frontend and admin pages
  • Toggle classes for role, user name and user id
  • Template hinting to load custom theme css files for frontend and admin

Stylesheets

  • Add to theme folder (optional): enhanced-body-class-frontend.css
  • Add to theme folder (optional): enhanced-body-class-admin.css

Scripts

  • Add to theme folder (optional): enhanced-body-class-frontend.js
  • Add to theme folder (optional): enhanced-body-class-admin.js

Styles

user-role-author

user-name-bobdobbs

user-id-1

Usage

After activating the class on the body tag, it will be up to you to use css or javascript to customize the display.

  • Activate ‘User Role’ on ‘Admin Pages’ in plugin settings
  • Observe classes on BODY tag by viewing the webpage source. You may need to refresh the page to see the updated class.
  • Navigate to current theme and create file enhanced-body-class-admin.css

-

css and add the following:

user-role-administrator { background-color: cyan; }

Refresh the page. You should now see a cyan background. You can now update the css to change the display of specific

page elements.

Real Usage

This plugin was developed to hide certain elements in a popular photo gallery from users with a specific role.

css

`

user-role-contributor #updategallery #gallerydiv { display: none; }

`

js

`

ready(function($) {

attr(‘disabled’, ‘disabled’);

});

`

About This Plugin

This plugin was created by Noah J. Stewart in response to a specific problem. In January 2019,

Noah Stewart was contacted by his father Jim Stewart regarding a WordPress photo gallery plugin

that his astronomy club was using. They were having trouble customizing a few of the role-based

options in a popular gallery plugin. Like any good graphic artist, Jim was trying to improve

the interface for the site users. The simplest approach to the problem was to use css to

selectively hide certain elements, ie. invisible content users with the author role that

should be visible to users with the administrator role.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • body class style
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.8

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.8.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.8
Minimum requirementsWordPress 4.6 · PHP 5.6.40
Update activity25 Apr 20251y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.