From 0dcfbcca36232a2af46bf530ddc250dac43210f5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 11 Nov 2019 15:13:02 +0000 Subject: [PATCH] Script Loader: In `wp_default_packages_inline_scripts()`, make sure the root URL middleware is registered before using the media middleware. This allows for requests to retry post-processing large images using the `post-process` REST API endpoint to work as expected. Reviewed by johnbillion, youknowriad, SergeyBiryukov. Props azaozz, mikeschroder, TimothyBlynJacobs, epiqueras, johnbillion, youknowriad. Merges [46703] to the 5.3 branch. Fixes #48542. Built from https://develop.svn.wordpress.org/branches/5.3@46704 git-svn-id: http://core.svn.wordpress.org/branches/5.3@46504 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 17 ++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 1ec800f8e3..550cb0e3d5 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -649,6 +649,14 @@ function wp_default_packages_inline_scripts( &$scripts ) { if ( isset( $scripts->registered['wp-api-fetch'] ) ) { $scripts->registered['wp-api-fetch']->deps[] = 'wp-hooks'; } + $scripts->add_inline_script( + 'wp-api-fetch', + sprintf( + 'wp.apiFetch.use( wp.apiFetch.createRootURLMiddleware( "%s" ) );', + esc_url_raw( get_rest_url() ) + ), + 'after' + ); $scripts->add_inline_script( 'wp-api-fetch', implode( @@ -668,15 +676,6 @@ function wp_default_packages_inline_scripts( &$scripts ) { ), 'after' ); - $scripts->add_inline_script( - 'wp-api-fetch', - sprintf( - 'wp.apiFetch.use( wp.apiFetch.createRootURLMiddleware( "%s" ) );', - esc_url_raw( get_rest_url() ) - ), - 'after' - ); - $scripts->add_inline_script( 'wp-data', implode( diff --git a/wp-includes/version.php b/wp-includes/version.php index b3eae65c65..678d1993e9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-RC4-46699'; +$wp_version = '5.3-RC4-46704'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.