From 83eb6400143af69fd47da5dc52fd1f8bb8c26843 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 20 Mar 2020 08:49:25 -0400 Subject: [PATCH] Framework: Migrate apiFetch middlewares initialization to compat (#19178) --- lib/client-assets.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/client-assets.php b/lib/client-assets.php index e90d5afa026d4..a7e3108a0f73f 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -432,19 +432,6 @@ function gutenberg_register_packages_styles( &$styles ) { * @since 0.1.0 */ function gutenberg_enqueue_block_editor_assets() { - wp_add_inline_script( - 'wp-api-fetch', - sprintf( - 'wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( "%s" );' . - 'wp.apiFetch.use( wp.apiFetch.nonceMiddleware );' . - 'wp.apiFetch.nonceEndpoint = "%s";' . - 'wp.apiFetch.use( wp.apiFetch.mediaUploadMiddleware );', - ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ), - admin_url( 'admin-ajax.php?action=gutenberg_rest_nonce' ) - ), - 'after' - ); - if ( defined( 'GUTENBERG_LIVE_RELOAD' ) && GUTENBERG_LIVE_RELOAD ) { $live_reload_url = ( GUTENBERG_LIVE_RELOAD === true ) ? 'http://localhost:35729/livereload.js' : GUTENBERG_LIVE_RELOAD;