Theme: Sync SVN commits to canonical Git repo.

r18240-dotorg:
Switch from using `global $pagetitle` to `add_theme_support( 'title-tags' );`.
See ​https://github.com/WordPress/wporg-mu-plugins/issues/44

r18291-dotorg:
Themes: Use a mu-plugin to output consistent skip-to links for all themes.
This is to remove the reliance upon `$wporg_global_header_options`.
See ​https://github.com/WordPress/wporg-mu-plugins/issues/42, ​https://github.com/WordPress/wporg-mu-plugins/pull/70.

r18292-dotorg:
Themes: Don't rely upon the WordPress.org header to switch out the `no-js` for `js` body class.
See ​https://github.com/WordPress/wporg-mu-plugins/issues/42
This commit is contained in:
Dion Hulse 2022-03-17 15:38:06 -07:00 committed by Ian Dunn
parent 174a0381d6
commit 908e0973f3
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
2 changed files with 10 additions and 9 deletions

View file

@ -172,6 +172,14 @@ function custom_body_class( $classes ) {
}
add_filter( 'body_class', __NAMESPACE__ . '\custom_body_class' );
/**
* Swaps out the no-js for the js body class if the browser supports Javascript.
*/
function nojs_body_tag() {
echo "<script>document.body.className = document.body.className.replace('no-js','js');</script>\n";
}
add_action( 'wp_body_open', __NAMESPACE__ . '\nojs_body_tag' );
/**
* Filters an enqueued script & style's fully-qualified URL.
*