Changeset 42854 for branches/4.9
- Timestamp:
- 03/18/2018 08:03:59 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-includes/js/wp-api.js
r42853 r42854 849 849 } 850 850 851 if ( _.isFunction( model.nonce ) && ! _.is Undefined( model.nonce() ) && ! _.isNull( model.nonce() ) ) {851 if ( _.isFunction( model.nonce ) && ! _.isEmpty( model.nonce() ) ) { 852 852 beforeSend = options.beforeSend; 853 853 … … 993 993 options = options || {}; 994 994 995 if ( _.isFunction( model.nonce ) && ! _.is Undefined( model.nonce() ) && ! _.isNull( model.nonce() ) ) {995 if ( _.isFunction( model.nonce ) && ! _.isEmpty( model.nonce() ) ) { 996 996 beforeSend = options.beforeSend; 997 997 … … 1491 1491 * 1492 1492 * @param {object} [args] 1493 * @param {string} [args.nonce] The nonce. Optional, defaults to wpApiSettings.nonce. 1493 1494 * @param {string} [args.apiRoot] The api root. Optional, defaults to wpApiSettings.root. 1494 1495 * @param {string} [args.versionString] The version string. Optional, defaults to wpApiSettings.root. … … 1499 1500 1500 1501 args = args || {}; 1501 attributes.nonce = args.nonce || wpApiSettings.nonce || '';1502 attributes.nonce = _.isString( args.nonce ) ? args.nonce : ( wpApiSettings.nonce || '' ); 1502 1503 attributes.apiRoot = args.apiRoot || wpApiSettings.root || '/wp-json'; 1503 1504 attributes.versionString = args.versionString || wpApiSettings.versionString || 'wp/v2/';
Note: See TracChangeset
for help on using the changeset viewer.