Making WordPress.org

Changeset 11449


Ignore:
Timestamp:
01/17/2022 05:36:25 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Don't expect the global header to change the body class from no-js to js for you.

See https://github.com/WordPress/wporg-mu-plugins/issues/42

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r11431 r11449  
    237237
    238238/**
     239 * Swaps out the no-js for the js body class if the browser supports Javascript.
     240 */
     241function nojs_body_tag() {
     242        echo "<script>document.body.className = document.body.className.replace('no-js','js');</script>\n";
     243}
     244add_action( 'wp_body_open', __NAMESPACE__ . '\nojs_body_tag' );
     245
     246/**
    239247 * Append an optimized site name.
    240248 *
Note: See TracChangeset for help on using the changeset viewer.