Making WordPress.org


Ignore:
Timestamp:
01/17/2022 01:19:22 PM (3 years ago)
Author:
Otto42
Message:

Support theme: Add no-js swap code to theme, for same reasons as change in [11449]. bbPress also relies on the no-js swap in the theme.

File:
1 edited

Legend:

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

    r11431 r11454  
    2020}
    2121add_action( 'after_setup_theme', 'wporg_support_theme_support' );
     22
     23
     24/**
     25 * Swaps out the no-js for the js body class if the browser supports Javascript.
     26 */
     27function nojs_body_tag() {
     28            echo "<script>document.body.className = document.body.className.replace('no-js','js');</script>\n";
     29}
     30add_action( 'wp_body_open', __NAMESPACE__ . '\nojs_body_tag' );
     31
    2232
    2333/**
Note: See TracChangeset for help on using the changeset viewer.