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.
*

View file

@ -2,18 +2,11 @@
namespace WordPressDotOrg\FiveForTheFuture\Theme;
\WordPressdotorg\skip_to( '#main' );
if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
echo do_blocks( '<!-- wp:wporg/global-header /-->' );
} 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'] .= '<a class="skip-link screen-reader-text" href="#main">' . esc_html__( 'Skip to content', 'wporg-5ftf' ) . '</a>';
require WPORGPATH . 'header.php';
}