Make WordPress Core

Ticket #59505: 59505.diff

File 59505.diff, 1.4 KB (added by sabernhardt, 11 months ago)

moving skip link CSS/JS function to the wp_enqueue_scripts action

  • src/wp-includes/default-filters.php

     
    707707add_filter( 'render_block_context', '_block_template_render_without_post_block_context' );
    708708add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 );
    709709add_action( 'save_post_wp_template_part', 'wp_set_unique_slug_on_create_template_part' );
    710 add_action( 'wp_footer', 'the_block_template_skip_link' );
     710add_action( 'wp_enqueue_scripts', 'the_block_template_skip_link' );
    711711add_action( 'setup_theme', 'wp_enable_block_templates' );
    712712add_action( 'wp_loaded', '_add_template_loader_filters' );
    713713
  • src/wp-includes/theme-templates.php

     
    207207        <?php
    208208        $skip_link_script = wp_remove_surrounding_empty_script_tags( ob_get_clean() );
    209209        $script_handle    = 'wp-block-template-skip-link';
    210         wp_register_script( $script_handle, false );
     210        wp_register_script( $script_handle, false, array(), false, array( 'in_footer' => 'true' ) );
    211211        wp_add_inline_script( $script_handle, $skip_link_script );
    212212        wp_enqueue_script( $script_handle );
    213213}