From 908e0973f3e66ff40280ef44a81f179506e30588 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 17 Mar 2022 15:38:06 -0700 Subject: [PATCH] Theme: Sync SVN commits to canonical Git repo. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- themes/wporg-5ftf/functions.php | 8 ++++++++ themes/wporg-5ftf/header.php | 11 ++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/themes/wporg-5ftf/functions.php b/themes/wporg-5ftf/functions.php index c769c1f..9010367 100644 --- a/themes/wporg-5ftf/functions.php +++ b/themes/wporg-5ftf/functions.php @@ -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 "\n"; +} +add_action( 'wp_body_open', __NAMESPACE__ . '\nojs_body_tag' ); + /** * Filters an enqueued script & style's fully-qualified URL. * diff --git a/themes/wporg-5ftf/header.php b/themes/wporg-5ftf/header.php index 6a7b760..82c250f 100644 --- a/themes/wporg-5ftf/header.php +++ b/themes/wporg-5ftf/header.php @@ -2,18 +2,11 @@ namespace WordPressDotOrg\FiveForTheFuture\Theme; +\WordPressdotorg\skip_to( '#main' ); + if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) { echo do_blocks( '' ); } else { - global $wporg_global_header_options; - $GLOBALS['pagetitle'] = wp_get_document_title(); - - if ( ! isset( $wporg_global_header_options['in_wrapper'] ) ) { - $wporg_global_header_options['in_wrapper'] = ''; - } - - $wporg_global_header_options['in_wrapper'] .= ''; - require WPORGPATH . 'header.php'; }