admin_body_class
Filters the CSS classes for the body tag in the admin.
Description
Parameters (1)
- 0. $wp_widgets_access_body_class (string) =>
'wp_widgets_access_body_class'
- The
wp
widgets access body class.
Usage
- To run the hook, copy the example below.
- $wp_widgets_access_body_class = apply_filters( 'admin_body_class', $wp_widgets_access_body_class );
- if ( !empty( $wp_widgets_access_body_class ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the admin_body_class callback
- function filter_admin_body_class( $wp_widgets_access_body_class ) {
- // make filter magic happen here...
- return $wp_widgets_access_body_class;
- };
- // add the filter
- add_filter( 'admin_body_class', 'filter_admin_body_class', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'admin_body_class', 'filter_admin_body_class', 10, 1 );
Defined (2)
The filter is defined in the following location(s).
- /wp-admin/widgets.php
- add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
- /wp-admin/nav-menus.php
- add_filter('admin_body_class', 'wp_nav_menu_max_depth');