Skip to content

Commit

Permalink
Avoid duplicate skip-links in WP 5.8+ (#32346)
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath authored May 31, 2021
1 parent 4e0dcea commit 9d382e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/full-site-editing/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,17 @@ function set_unique_slug_on_create_template( $post_id ) {
/**
* Print the skip-link script & styles.
*
* @todo Remove this when WP 5.8 is the minimum required version.
*
* @return void
*/
function gutenberg_the_skip_link() {

// Early exit if on WP 5.8+.
if ( function_exists( 'the_block_template_skip_link' ) ) {
return;
}

// Early exit if not an FSE theme.
if ( ! gutenberg_supports_block_templates() ) {
return;
Expand Down

0 comments on commit 9d382e4

Please sign in to comment.