Make WordPress Core


Ignore:
Timestamp:
10/13/2023 05:19:31 PM (16 months ago)
Author:
westonruter
Message:

Script Loader: Enqueue inline style for block template skip link in head instead of footer.

  • Introduce wp_enqueue_block_template_skip_link() to replace the_block_template_skip_link(). Add to wp_enqueue_scripts action instead of wp_footer.
  • Keep inline script for skip link in footer.
  • Restore original the_block_template_skip_link() from 6.3 and move to deprecated.php.
  • Preserve back-compat for unhooking skip-link by removing the_block_template_skip_link from wp_footer action.

Follow-up to [56682] and [56687].

Props sabernhardt, plugindevs, westonruter, spacedmonkey.
Fixes #59505.
See #58775.
See #58664.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r56845 r56932  
    717717add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 );
    718718add_action( 'save_post_wp_template_part', 'wp_set_unique_slug_on_create_template_part' );
    719 add_action( 'wp_footer', 'the_block_template_skip_link' );
     719add_action( 'wp_enqueue_scripts', 'wp_enqueue_block_template_skip_link' );
     720add_action( 'wp_footer', 'the_block_template_skip_link' ); // Retained for backwards-compatibility. Unhooked by wp_enqueue_block_template_skip_link().
    720721add_action( 'setup_theme', 'wp_enable_block_templates' );
    721722add_action( 'wp_loaded', '_add_template_loader_filters' );
Note: See TracChangeset for help on using the changeset viewer.