Skip to content

Commit

Permalink
Framework: Migrate apiFetch middlewares initialization to compat
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 16, 2020
1 parent 8905f96 commit 7049159
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7049159

Please sign in to comment.