IP : 18.118.115.222Hostname : server86.web-hosting.comKernel : Linux server86.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64Disable Function : None :) OS : Linux
PATH:
/
home/
servlmvm/
puppiesoftexas.com/
./
wp-includes/
js/
api-request.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;
// 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 ); }