PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-includes
/
js
/** * Thin jQuery.ajax wrapper for WP REST API requests. * * Currently only applies to requests that do not use the `wp-api.js` Backbone * client library, though this may change. Serves several purposes: * * - Allows overriding these requests as needed by customized WP installations. * - Sends the REST API nonce as a request header. * - Allows specifying only an endpoint namespace/path instead of a full URL. * * @since 4.9.0 * @since 5.6.0 Added overriding of the "PUT" and "DELETE" methods with "POST". * Added an "application/json" Accept header to all requests. * @output wp-includes/js/api-request.js */ ( function( $ ) { var wpApiSettings = window.wpApiSettings; function apiRequest( options ) { options = apiRequest.buildAjaxOptions( options ); return apiRequest.transport( options ); } apiRequest.buildAjaxOptions = function( options ) { var url = options.url; var path = options.path; var method = options.method; var namespaceTrimmed, endpointTrimmed, apiRoot; var headers, addNonceHeader, addAcceptHeader, headerName; if ( typeof options.namespace === 'string' && typeof options.endpoint === 'string' ) { namespaceTrimmed = options.namespace.replace( /^\/|\/$/g, '' ); endpointTrimmed = options.endpoint.replace( /^\//, '' ); if ( endpointTrimmed ) { path = namespaceTrimmed + '/' + endpointTrimmed; } else { path = namespaceTrimmed; } } if ( typeof path === 'string' ) { apiRoot = wpApiSettings.root; path = path.replace( /^\//, '' ); // API root may already include query parameter prefix // if site is configured to use plain permalinks. if ( 'string' === typeof apiRoot && -1 !== apiRoot.indexOf( '?' ) ) { path = path.replace( '?', '&' ); } url = apiRoot + path; } // If ?_wpnonce=... is present, no need to add a nonce header. addNonceHeader = ! ( options.data && options.data._wpnonce ); addAcceptHeader = true; headers = options.headers || {}; for ( headerName in headers ) { if ( ! headers.hasOwnProperty( headerName ) ) { continue; } // If an 'X-WP-Nonce' or 'Accept' header (or any case-insensitive variation // thereof) was specified, no need to add the header again. switch ( headerName.toLowerCase() ) { case 'x-wp-nonce': addNonceHeader = false; break; case 'accept': addAcceptHeader = false; break; } } if ( addNonceHeader ) { // Do not mutate the original headers object, if any. headers = $.extend( { 'X-WP-Nonce': wpApiSettings.nonce }, headers ); } if ( addAcceptHeader ) { headers = $.extend( { 'Accept': 'application/json, */*;q=0.1' }, headers ); } if ( typeof method === 'string' ) { method = method.toUpperCase(); if ( 'PUT' === method || 'DELETE' === method ) { headers = $.extend( { 'X-HTTP-Method-Override': method }, headers ); method = 'POST'; } } // Do not mutate the original options object. options = $.extend( {}, options, { headers: headers, url: url, method: method } ); delete options.path; delete options.namespace; delete options.endpoint; return options; }; apiRequest.transport = $.ajax; /** @namespace wp */ window.wp = window.wp || {}; window.wp.apiRequest = apiRequest; } )( jQuery );
[-] wp-backbone.js
[edit]
[-] wp-pointer.js
[edit]
[-] media-views.min.js
[edit]
[-] wp-custom-header.js
[edit]
[-] underscore.js
[edit]
[-] api-request.min.js
[edit]
[-] media-grid.js
[edit]
[-] underscore.min.js
[edit]
[-] wp-embed-template.min.js
[edit]
[-] media-models.min.js
[edit]
[-] admin-bar.min.js
[edit]
[-] twemoji.js
[edit]
[-] backbone.min.js
[edit]
[-] wplink.min.js
[edit]
[-] admin-bar.js
[edit]
[-] clipboard.js
[edit]
[-] customize-models.js
[edit]
[-] mce-view.min.js
[edit]
[-] wp-util.min.js
[edit]
[+]
dist
[-] customize-views.js
[edit]
[-] wp-emoji-release.min.js
[edit]
[-] clipboard.min.js
[edit]
[-] json2.min.js
[edit]
[-] customize-models.min.js
[edit]
[-] wp-list-revisions.js
[edit]
[-] comment-reply.min.js
[edit]
[-] customize-loader.js
[edit]
[-] wpdialog.min.js
[edit]
[-] wp-lists.js
[edit]
[-] twemoji.min.js
[edit]
[-] customize-preview.js
[edit]
[-] autosave.js
[edit]
[-] wp-list-revisions.min.js
[edit]
[-] wp-emoji.min.js
[edit]
[-] wp-api.js
[edit]
[-] tw-sack.js
[edit]
[-] media-audiovideo.js
[edit]
[-] wp-api.min.js
[edit]
[-] media-models.js
[edit]
[-] autosave.min.js
[edit]
[-] customize-preview-widgets.js
[edit]
[-] quicktags.min.js
[edit]
[-] wplink.js
[edit]
[-] customize-base.js
[edit]
[+]
jcrop
[-] zxcvbn.min.js
[edit]
[+]
plupload
[-] heartbeat.js
[edit]
[-] swfobject.js
[edit]
[-] quicktags.js
[edit]
[-] wp-lists.min.js
[edit]
[-] json2.js
[edit]
[-] wp-embed-template.js
[edit]
[-] utils.js
[edit]
[-] mce-view.js
[edit]
[-] wp-backbone.min.js
[edit]
[-] media-grid.min.js
[edit]
[-] wp-auth-check.min.js
[edit]
[-] wp-sanitize.js
[edit]
[-] media-audiovideo.min.js
[edit]
[-] customize-selective-refresh.js
[edit]
[+]
mediaelement
[-] wp-pointer.min.js
[edit]
[-] backbone.js
[edit]
[-] customize-preview-nav-menus.min.js
[edit]
[-] zxcvbn-async.min.js
[edit]
[-] tw-sack.min.js
[edit]
[-] customize-preview-widgets.min.js
[edit]
[-] customize-selective-refresh.min.js
[edit]
[+]
swfupload
[+]
crop
[-] wp-sanitize.min.js
[edit]
[+]
tinymce
[-] wp-ajax-response.min.js
[edit]
[-] wp-emoji.js
[edit]
[-] utils.min.js
[edit]
[-] comment-reply.js
[edit]
[-] colorpicker.js
[edit]
[-] wp-auth-check.js
[edit]
[-] masonry.min.js
[edit]
[-] wp-embed.min.js
[edit]
[-] wpdialog.js
[edit]
[+]
..
[-] media-editor.min.js
[edit]
[+]
jquery
[-] hoverIntent.min.js
[edit]
[-] media-views.js
[edit]
[-] heartbeat.min.js
[edit]
[-] shortcode.js
[edit]
[-] imagesloaded.min.js
[edit]
[-] customize-preview.min.js
[edit]
[-] customize-views.min.js
[edit]
[-] swfobject.min.js
[edit]
[+]
thickbox
[-] zxcvbn-async.js
[edit]
[-] shortcode.min.js
[edit]
[-] api-request.js
[edit]
[-] customize-loader.min.js
[edit]
[-] wp-util.js
[edit]
[-] wp-ajax-response.js
[edit]
[+]
codemirror
[-] wp-emoji-loader.min.js
[edit]
[-] wp-custom-header.min.js
[edit]
[+]
imgareaselect
[-] hoverIntent.js
[edit]
[-] wp-emoji-loader.js
[edit]
[-] customize-base.min.js
[edit]
[-] media-editor.js
[edit]
[-] hoverintent-js.min.js
[edit]
[-] customize-preview-nav-menus.js
[edit]
[-] wp-embed.js
[edit]
[-] colorpicker.min.js
[edit]