WordPress/wp-includes/js/api-request.min.js

2 lines
944 B
JavaScript
Raw Normal View History

/*! This file is auto-generated */
!function(w){var c=window.wpApiSettings;function n(e){return e=n.buildAjaxOptions(e),n.transport(e)}n.buildAjaxOptions=function(e){var n,t,o,r,p,a,i=e.url,d=e.path,s=e.method;if("string"==typeof e.namespace&&"string"==typeof e.endpoint&&(n=e.namespace.replace(/^\/|\/$/g,""),d=(t=e.endpoint.replace(/^\//,""))?n+"/"+t:n),"string"==typeof d&&(o=c.root,d=d.replace(/^\//,""),"string"==typeof o&&-1!==o.indexOf("?")&&(d=d.replace("?","&")),i=o+d),p=!(e.data&&e.data._wpnonce),r=e.headers||{},p)for(a in r)if(r.hasOwnProperty(a)&&"x-wp-nonce"===a.toLowerCase()){p=!1;break}return p&&(r=w.extend({"X-WP-Nonce":c.nonce},r)),"string"==typeof s&&("PUT"!==(s=s.toUpperCase())&&"DELETE"!==s||(r=w.extend({"X-HTTP-Method-Override":s},r),s="POST")),delete(e=w.extend({},e,{headers:r,url:i,method:s})).path,delete e.namespace,delete e.endpoint,e},n.transport=w.ajax,window.wp=window.wp||{},window.wp.apiRequest=n}(jQuery);