Changeset 46253 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 09/23/2019 05:46:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r46239 r46253 652 652 $scripts->add_inline_script( 653 653 'wp-api-fetch', 654 sprintf( 655 implode( 656 "\n", 657 array( 658 '( function() {', 659 ' var nonceMiddleware = wp.apiFetch.createNonceMiddleware( "%s" );', 660 ' wp.apiFetch.use( nonceMiddleware );', 661 ' wp.hooks.addAction(', 662 ' "heartbeat.tick",', 663 ' "core/api-fetch/create-nonce-middleware",', 664 ' function( response ) {', 665 ' if ( response[ "rest_nonce" ] ) {', 666 ' nonceMiddleware.nonce = response[ "rest_nonce" ];', 667 ' }', 668 ' }', 669 ' );', 670 '} )();', 671 ) 654 join( 655 array( 656 sprintf( 657 'wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( "%s" );', 658 ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ) 659 ), 660 'wp.apiFetch.use( wp.apiFetch.nonceMiddleware );', 661 sprintf( 662 'wp.apiFetch.nonceEndpoint = "%s";', 663 admin_url( 'admin-ajax.php?action=rest-nonce' ) 664 ), 672 665 ), 673 ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' )666 "\n" 674 667 ), 675 668 'after'
Note: See TracChangeset
for help on using the changeset viewer.