admin_body_class

admin_body_class

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('admin_body_class') is found 2 times:

  • /wp-admin/admin-header.php line 242
     * @since 2.3.0
     *
     * @param string $classes Space-separated list of CSS classes.
     */
    $admin_body_classes = apply_filters( 'admin_body_class', '' );
    $admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
    ?>
    <body class="wp-admin wp-core-ui no-js <?php echo esc_attr( $admin_body_classes ); ?>">
    <script type="text/javascript">
    	document.body.className = document.body.className.replace('no-js','js');
    </script>
    
  • /wp-admin/includes/template.php line 2189
    	<?php
    	$admin_body_id = isset( $body_id ) ? 'id="' . $body_id . '" ' : '';
    
    	/** This filter is documented in wp-admin/admin-header.php */
    	$admin_body_classes = apply_filters( 'admin_body_class', '' );
    	$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
    	?>
    <body <?php echo $admin_body_id; ?>class="wp-admin wp-core-ui no-js iframe <?php echo esc_attr( $admin_body_classes ); ?>">
    <script type="text/javascript">
    (function(){
    var c = document.body.className;
    

See this hook used in plugins: