Changeset 44949
- Timestamp:
- 03/20/2019 08:52:08 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/misc.php
r44788 r44949 1083 1083 // Refresh the Rest API nonce. 1084 1084 $response['rest_nonce'] = wp_create_nonce( 'wp_rest' ); 1085 // TEMPORARY: Compat with api-fetch library1086 $response['rest-nonce'] = $response['rest_nonce'];1087 1085 1088 1086 // Refresh the Heartbeat nonce. -
trunk/src/wp-includes/script-loader.php
r44812 r44949 522 522 global $wp_locale; 523 523 524 if ( isset( $scripts->registered['wp-api-fetch'] ) ) { 525 $scripts->registered['wp-api-fetch']->deps[] = 'wp-hooks'; 526 } 524 527 $scripts->add_inline_script( 525 528 'wp-api-fetch', 526 529 sprintf( 527 'wp.apiFetch.use( wp.apiFetch.createNonceMiddleware( "%s" ) );', 530 implode( 531 "\n", 532 array( 533 '( function() {', 534 ' var nonceMiddleware = wp.apiFetch.createNonceMiddleware( "%s" );', 535 ' wp.apiFetch.use( nonceMiddleware );', 536 ' wp.hooks.addAction(', 537 ' "heartbeat.tick",', 538 ' "core/api-fetch/create-nonce-middleware",', 539 ' function( response ) {', 540 ' if ( response[ "rest_nonce" ] ) {', 541 ' nonceMiddleware.nonce = response[ "rest_nonce" ];', 542 ' }', 543 ' }', 544 ' );', 545 '} )();', 546 ) 547 ), 528 548 ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ) 529 549 ),
Note: See TracChangeset
for help on using the changeset viewer.