Bundled Theme: Update default themes to use new script function signature.

In WordPress 6.3, the last parameter of `wp_register_script()` and `wp_enqueue_script()` was changed to an array rather than a boolean. While a boolean is still supported for backward compatibility, it makes sense to update the codebase to use the new signature.

The updates are fully backward compatible:
* In places where `true` was provided, `array( 'in_footer' => true )` will still be interpreted as a boolean true in WordPress versions prior to 6.3.
* In places where `false` was provided, the parameter is omitted which will work correctly throughout all WordPress versions given that is and has been the default value anyway.

Props mrinal013, huzaifaalmesbah, niravsherasiya7707, joemcgill.
Fixes #59302.
See #58634.

Built from https://develop.svn.wordpress.org/trunk@56526


git-svn-id: http://core.svn.wordpress.org/trunk@56038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2023-09-06 21:23:20 +00:00
parent 9ebcbfae5c
commit 615996176a
18 changed files with 45 additions and 45 deletions

View File

@ -673,6 +673,6 @@ function twentyeleven_customize_partial_blogdescription() {
* @since Twenty Eleven 1.3 * @since Twenty Eleven 1.3
*/ */
function twentyeleven_customize_preview_js() { function twentyeleven_customize_preview_js() {
wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20150401', true ); wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20150401', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' ); add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' );

View File

@ -444,7 +444,7 @@ function twentyfifteen_scripts() {
wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' ); wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' );
// Skip-link fix is no longer enqueued by default. // Skip-link fix is no longer enqueued by default.
wp_register_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', true ); wp_register_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', array( 'in_footer' => true ) );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'comment-reply' );
@ -454,7 +454,7 @@ function twentyfifteen_scripts() {
wp_enqueue_script( 'twentyfifteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141210' ); wp_enqueue_script( 'twentyfifteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141210' );
} }
wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20221101', true ); wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20221101', array( 'in_footer' => true ) );
wp_localize_script( wp_localize_script(
'twentyfifteen-script', 'twentyfifteen-script',
'screenReaderText', 'screenReaderText',

View File

@ -359,7 +359,7 @@ add_action( 'wp_enqueue_scripts', 'twentyfifteen_color_scheme_css' );
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*/ */
function twentyfifteen_customize_control_js() { function twentyfifteen_customize_control_js() {
wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', true ); wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', array( 'in_footer' => true ) );
wp_localize_script( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes() ); wp_localize_script( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes() );
} }
add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' ); add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' );
@ -370,7 +370,7 @@ add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_contr
* @since Twenty Fifteen 1.0 * @since Twenty Fifteen 1.0
*/ */
function twentyfifteen_customize_preview_js() { function twentyfifteen_customize_preview_js() {
wp_enqueue_script( 'twentyfifteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20141216', true ); wp_enqueue_script( 'twentyfifteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20141216', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' );

View File

@ -367,7 +367,7 @@ function twentyfourteen_scripts() {
} }
if ( is_front_page() && 'slider' === get_theme_mod( 'featured_content_layout' ) ) { if ( is_front_page() && 'slider' === get_theme_mod( 'featured_content_layout' ) ) {
wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20150120', true ); wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20150120', array( 'in_footer' => true ) );
wp_localize_script( wp_localize_script(
'twentyfourteen-slider', 'twentyfourteen-slider',
'featuredSliderDefaults', 'featuredSliderDefaults',
@ -378,7 +378,7 @@ function twentyfourteen_scripts() {
); );
} }
wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230526', true ); wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230526', array( 'in_footer' => true ) );
} }
add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );

View File

@ -142,7 +142,7 @@ function twentyfourteen_sanitize_layout( $layout ) {
* @since Twenty Fourteen 1.0 * @since Twenty Fourteen 1.0
*/ */
function twentyfourteen_customize_preview_js() { function twentyfourteen_customize_preview_js() {
wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20141015', true ); wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20141015', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' );

View File

@ -434,7 +434,7 @@ class Featured_Content {
* @since Twenty Fourteen 1.0 * @since Twenty Fourteen 1.0
*/ */
public static function enqueue_scripts() { public static function enqueue_scripts() {
wp_enqueue_script( 'featured-content-suggest', get_template_directory_uri() . '/js/featured-content-admin.js', array( 'jquery', 'suggest' ), '20211130', true ); wp_enqueue_script( 'featured-content-suggest', get_template_directory_uri() . '/js/featured-content-admin.js', array( 'jquery', 'suggest' ), '20211130', array( 'in_footer' => true ) );
} }
/** /**

View File

@ -259,8 +259,8 @@ function twentynineteen_scripts() {
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' ); wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
if ( has_nav_menu( 'menu-1' ) ) { if ( has_nav_menu( 'menu-1' ) ) {
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '20200129', true ); wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '20200129', array( 'in_footer' => true ) );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '20230621', true ); wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '20230621', array( 'in_footer' => true ) );
} }
wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' ); wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );

View File

@ -125,7 +125,7 @@ function twentynineteen_customize_partial_blogdescription() {
* Bind JS handlers to instantly live-preview changes. * Bind JS handlers to instantly live-preview changes.
*/ */
function twentynineteen_customize_preview_js() { function twentynineteen_customize_preview_js() {
wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true ); wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );
@ -133,7 +133,7 @@ add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );
* Load dynamic logic for the customizer controls area. * Load dynamic logic for the customizer controls area.
*/ */
function twentynineteen_panels_js() { function twentynineteen_panels_js() {
wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true ); wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', array( 'in_footer' => true ) );
} }
add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' ); add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );

View File

@ -477,16 +477,16 @@ function twentyseventeen_scripts() {
wp_script_add_data( 'html5', 'conditional', 'lt IE 9' ); wp_script_add_data( 'html5', 'conditional', 'lt IE 9' );
// Skip-link fix is no longer enqueued by default. // Skip-link fix is no longer enqueued by default.
wp_register_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', true ); wp_register_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', array( 'in_footer' => true ) );
wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', true ); wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', array( 'in_footer' => true ) );
$twentyseventeen_l10n = array( $twentyseventeen_l10n = array(
'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), 'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ),
); );
if ( has_nav_menu( 'top' ) ) { if ( has_nav_menu( 'top' ) ) {
wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '20210122', true ); wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '20210122', array( 'in_footer' => true ) );
$twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' );
$twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' );
$twentyseventeen_l10n['icon'] = twentyseventeen_get_svg( $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg(
@ -499,7 +499,7 @@ function twentyseventeen_scripts() {
wp_localize_script( 'twentyseventeen-global', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n ); wp_localize_script( 'twentyseventeen-global', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n );
wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.3', true ); wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.3', array( 'in_footer' => true ) );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'comment-reply' );

View File

@ -245,7 +245,7 @@ function twentyseventeen_is_view_with_layout_option() {
* Bind JS handlers to instantly live-preview changes. * Bind JS handlers to instantly live-preview changes.
*/ */
function twentyseventeen_customize_preview_js() { function twentyseventeen_customize_preview_js() {
wp_enqueue_script( 'twentyseventeen-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview' ), '20161002', true ); wp_enqueue_script( 'twentyseventeen-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview' ), '20161002', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' );
@ -253,6 +253,6 @@ add_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' );
* Load dynamic logic for the customizer controls area. * Load dynamic logic for the customizer controls area.
*/ */
function twentyseventeen_panels_js() { function twentyseventeen_panels_js() {
wp_enqueue_script( 'twentyseventeen-customize-controls', get_theme_file_uri( '/assets/js/customize-controls.js' ), array(), '20161020', true ); wp_enqueue_script( 'twentyseventeen-customize-controls', get_theme_file_uri( '/assets/js/customize-controls.js' ), array(), '20161020', array( 'in_footer' => true ) );
} }
add_action( 'customize_controls_enqueue_scripts', 'twentyseventeen_panels_js' ); add_action( 'customize_controls_enqueue_scripts', 'twentyseventeen_panels_js' );

View File

@ -413,7 +413,7 @@ function twentysixteen_scripts() {
wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' ); wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' );
// Skip-link fix is no longer enqueued by default. // Skip-link fix is no longer enqueued by default.
wp_register_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', true ); wp_register_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', array( 'in_footer' => true ) );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'comment-reply' );
@ -423,7 +423,7 @@ function twentysixteen_scripts() {
wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20170530' ); wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20170530' );
} }
wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230629', true ); wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230629', array( 'in_footer' => true ) );
wp_localize_script( wp_localize_script(
'twentysixteen-script', 'twentysixteen-script',

View File

@ -486,7 +486,7 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_color_scheme_css' );
* @since Twenty Sixteen 1.0 * @since Twenty Sixteen 1.0
*/ */
function twentysixteen_customize_control_js() { function twentysixteen_customize_control_js() {
wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20170530', true ); wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20170530', array( 'in_footer' => true ) );
wp_localize_script( 'color-scheme-control', 'colorScheme', twentysixteen_get_color_schemes() ); wp_localize_script( 'color-scheme-control', 'colorScheme', twentysixteen_get_color_schemes() );
} }
add_action( 'customize_controls_enqueue_scripts', 'twentysixteen_customize_control_js' ); add_action( 'customize_controls_enqueue_scripts', 'twentysixteen_customize_control_js' );
@ -497,7 +497,7 @@ add_action( 'customize_controls_enqueue_scripts', 'twentysixteen_customize_contr
* @since Twenty Sixteen 1.0 * @since Twenty Sixteen 1.0
*/ */
function twentysixteen_customize_preview_js() { function twentysixteen_customize_preview_js() {
wp_enqueue_script( 'twentysixteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20170530', true ); wp_enqueue_script( 'twentysixteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20170530', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' );

View File

@ -321,7 +321,7 @@ function twentythirteen_scripts_styles() {
} }
// Loads JavaScript file with functionality specific to Twenty Thirteen. // Loads JavaScript file with functionality specific to Twenty Thirteen.
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230526', true ); wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20230526', array( 'in_footer' => true ) );
// Add Source Sans Pro and Bitter fonts, used in the main stylesheet. // Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
$font_version = ( 0 === strpos( (string) twentythirteen_fonts_url(), get_template_directory_uri() . '/' ) ) ? '20230328' : null; $font_version = ( 0 === strpos( (string) twentythirteen_fonts_url(), get_template_directory_uri() . '/' ) ) ? '20230328' : null;
@ -843,7 +843,7 @@ function twentythirteen_customize_partial_blogdescription() {
* @since Twenty Thirteen 1.0 * @since Twenty Thirteen 1.0
*/ */
function twentythirteen_customize_preview_js() { function twentythirteen_customize_preview_js() {
wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20200516', true ); wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20200516', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );

View File

@ -188,7 +188,7 @@ function twentytwelve_scripts_styles() {
} }
// Adds JavaScript for handling the navigation menu hide-and-show behavior. // Adds JavaScript for handling the navigation menu hide-and-show behavior.
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20141205', true ); wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20141205', array( 'in_footer' => true ) );
$font_url = twentytwelve_get_font_url(); $font_url = twentytwelve_get_font_url();
if ( ! empty( $font_url ) ) { if ( ! empty( $font_url ) ) {
@ -692,7 +692,7 @@ function twentytwelve_customize_partial_blogdescription() {
* @since Twenty Twelve 1.0 * @since Twenty Twelve 1.0
*/ */
function twentytwelve_customize_preview_js() { function twentytwelve_customize_preview_js() {
wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20200516', true ); wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20200516', array( 'in_footer' => true ) );
} }
add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' ); add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );

View File

@ -213,7 +213,7 @@ function twentytwenty_register_scripts() {
wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'comment-reply' );
} }
wp_enqueue_script( 'twentytwenty-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version, false ); wp_enqueue_script( 'twentytwenty-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version );
wp_script_add_data( 'twentytwenty-js', 'async', true ); wp_script_add_data( 'twentytwenty-js', 'async', true );
} }
@ -431,7 +431,7 @@ function twentytwenty_block_editor_styles() {
} }
// Enqueue the editor script. // Enqueue the editor script.
wp_enqueue_script( 'twentytwenty-block-editor-script', get_theme_file_uri( '/assets/js/editor-script-block.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), true ); wp_enqueue_script( 'twentytwenty-block-editor-script', get_theme_file_uri( '/assets/js/editor-script-block.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) );
} }
add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 ); add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
@ -625,13 +625,13 @@ function twentytwenty_customize_controls_enqueue_scripts() {
$theme_version = wp_get_theme()->get( 'Version' ); $theme_version = wp_get_theme()->get( 'Version' );
// Add main customizer js file. // Add main customizer js file.
wp_enqueue_script( 'twentytwenty-customize', get_template_directory_uri() . '/assets/js/customize.js', array( 'jquery' ), $theme_version, false ); wp_enqueue_script( 'twentytwenty-customize', get_template_directory_uri() . '/assets/js/customize.js', array( 'jquery' ), $theme_version );
// Add script for color calculations. // Add script for color calculations.
wp_enqueue_script( 'twentytwenty-color-calculations', get_template_directory_uri() . '/assets/js/color-calculations.js', array( 'wp-color-picker' ), $theme_version, false ); wp_enqueue_script( 'twentytwenty-color-calculations', get_template_directory_uri() . '/assets/js/color-calculations.js', array( 'wp-color-picker' ), $theme_version );
// Add script for controls. // Add script for controls.
wp_enqueue_script( 'twentytwenty-customize-controls', get_template_directory_uri() . '/assets/js/customize-controls.js', array( 'twentytwenty-color-calculations', 'customize-controls', 'underscore', 'jquery' ), $theme_version, false ); wp_enqueue_script( 'twentytwenty-customize-controls', get_template_directory_uri() . '/assets/js/customize-controls.js', array( 'twentytwenty-color-calculations', 'customize-controls', 'underscore', 'jquery' ), $theme_version );
wp_localize_script( 'twentytwenty-customize-controls', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() ); wp_localize_script( 'twentytwenty-customize-controls', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );
} }
@ -647,7 +647,7 @@ add_action( 'customize_controls_enqueue_scripts', 'twentytwenty_customize_contro
function twentytwenty_customize_preview_init() { function twentytwenty_customize_preview_init() {
$theme_version = wp_get_theme()->get( 'Version' ); $theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, true ); wp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, array( 'in_footer' => true ) );
wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() ); wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );
wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() ); wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() );

View File

@ -69,7 +69,7 @@ class Twenty_Twenty_One_Dark_Mode {
get_template_directory_uri() . '/assets/js/dark-mode-toggler.js', get_template_directory_uri() . '/assets/js/dark-mode-toggler.js',
array(), array(),
'1.0.0', '1.0.0',
true array( 'in_footer' => true )
); );
wp_enqueue_script( wp_enqueue_script(
@ -77,7 +77,7 @@ class Twenty_Twenty_One_Dark_Mode {
get_template_directory_uri() . '/assets/js/editor-dark-mode-support.js', get_template_directory_uri() . '/assets/js/editor-dark-mode-support.js',
array( 'twentytwentyone-dark-mode-support-toggle' ), array( 'twentytwentyone-dark-mode-support-toggle' ),
'1.0.0', '1.0.0',
true array( 'in_footer' => true )
); );
} }
@ -115,7 +115,7 @@ class Twenty_Twenty_One_Dark_Mode {
get_template_directory_uri() . '/assets/js/customize.js', get_template_directory_uri() . '/assets/js/customize.js',
array( 'customize-base', 'customize-controls', 'underscore', 'jquery', 'twentytwentyone-customize-helpers' ), array( 'customize-base', 'customize-controls', 'underscore', 'jquery', 'twentytwentyone-customize-helpers' ),
'1.0.0', '1.0.0',
true array( 'in_footer' => true )
); );
} }

View File

@ -421,7 +421,7 @@ function twenty_twenty_one_scripts() {
get_template_directory_uri() . '/assets/js/polyfills.js', get_template_directory_uri() . '/assets/js/polyfills.js',
array(), array(),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
// Register the IE11 polyfill loader. // Register the IE11 polyfill loader.
@ -430,7 +430,7 @@ function twenty_twenty_one_scripts() {
null, null,
array(), array(),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
wp_add_inline_script( wp_add_inline_script(
'twenty-twenty-one-ie11-polyfills', 'twenty-twenty-one-ie11-polyfills',
@ -449,7 +449,7 @@ function twenty_twenty_one_scripts() {
get_template_directory_uri() . '/assets/js/primary-navigation.js', get_template_directory_uri() . '/assets/js/primary-navigation.js',
array( 'twenty-twenty-one-ie11-polyfills' ), array( 'twenty-twenty-one-ie11-polyfills' ),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
} }
@ -459,7 +459,7 @@ function twenty_twenty_one_scripts() {
get_template_directory_uri() . '/assets/js/responsive-embeds.js', get_template_directory_uri() . '/assets/js/responsive-embeds.js',
array( 'twenty-twenty-one-ie11-polyfills' ), array( 'twenty-twenty-one-ie11-polyfills' ),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
} }
add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' ); add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' );
@ -473,7 +473,7 @@ add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' );
*/ */
function twentytwentyone_block_editor_script() { function twentytwentyone_block_editor_script() {
wp_enqueue_script( 'twentytwentyone-editor', get_theme_file_uri( '/assets/js/editor.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), true ); wp_enqueue_script( 'twentytwentyone-editor', get_theme_file_uri( '/assets/js/editor.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), array( 'in_footer' => true ) );
} }
add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' ); add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' );
@ -565,7 +565,7 @@ function twentytwentyone_customize_preview_init() {
get_theme_file_uri( '/assets/js/customize-helpers.js' ), get_theme_file_uri( '/assets/js/customize-helpers.js' ),
array(), array(),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
wp_enqueue_script( wp_enqueue_script(
@ -573,7 +573,7 @@ function twentytwentyone_customize_preview_init() {
get_theme_file_uri( '/assets/js/customize-preview.js' ), get_theme_file_uri( '/assets/js/customize-preview.js' ),
array( 'customize-preview', 'customize-selective-refresh', 'jquery', 'twentytwentyone-customize-helpers' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery', 'twentytwentyone-customize-helpers' ),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
} }
add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' ); add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' );
@ -592,7 +592,7 @@ function twentytwentyone_customize_controls_enqueue_scripts() {
get_theme_file_uri( '/assets/js/customize-helpers.js' ), get_theme_file_uri( '/assets/js/customize-helpers.js' ),
array(), array(),
wp_get_theme()->get( 'Version' ), wp_get_theme()->get( 'Version' ),
true array( 'in_footer' => true )
); );
} }
add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' ); add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' );

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56525'; $wp_version = '6.4-alpha-56526';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.