WordPress.org

Make WordPress Core

Ticket #17473: 17473.diff

File 17473.diff, 728 bytes (added by jacobwg, 4 years ago)

Adds body class and JS code necessary for the hide-if-js and hide-if-no-js classes to function

  • wp-admin/includes/media.php

     
    337337        do_action( "admin_head_{$content_func}" ); 
    338338?> 
    339339</head> 
    340 <body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?>> 
     340<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="no-js"> 
     341<script type="text/javascript"> 
     342//<![CDATA[ 
     343(function(){ 
     344var c = document.body.className; 
     345c = c.replace(/no-js/, 'js'); 
     346document.body.className = c; 
     347})(); 
     348//]]> 
     349</script> 
    341350<?php 
    342351        $args = func_get_args(); 
    343352        $args = array_slice($args, 1);