From 704915963a5b5f8892c51e9dcc671d8abe70d6f8 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 16 Dec 2019 11:50:57 -0500 Subject: [PATCH] Framework: Migrate apiFetch middlewares initialization to compat --- lib/client-assets.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/client-assets.php b/lib/client-assets.php index 9b5db194d202e2..092b3d88c0edbc 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;