WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/15/2021 08:50:26 AM (3 months ago)
Author:
youknowriad
Message:

Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.

This includes:

Various

Template Editor

Widgets Editor

Global Styles (theme.json)

Performance

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme-templates.php

    r51144 r51149  
    7777function the_block_template_skip_link() {
    7878
    79     // Early exit if not an FSE theme.
     79    // Early exit if not a block theme.
    8080    if ( ! current_theme_supports( 'block-templates' ) ) {
     81        return;
     82    }
     83
     84    // Early exit if not a block template.
     85    global $_wp_current_template_content;
     86    if ( ! $_wp_current_template_content ) {
    8187        return;
    8288    }
     
    138144        // Get the site wrapper.
    139145        // The skip-link will be injected in the beginning of it.
    140         parentEl = document.querySelector( '.wp-site-blocks' ) || document.body,
     146        parentEl = document.querySelector( '.wp-site-blocks' );
     147
     148        // Early exit if the root element was not found.
     149        if ( ! parentEl ) {
     150            return;
     151        }
    141152
    142153        // Get the skip-link target's ID, and generate one if it doesn't exist.
Note: See TracChangeset for help on using the changeset viewer.