File "wpda_rest_api.js"
Full Path: /home/vantageo/public_html/cache/cache/cache/cache/cache/cache/cache/.wp-cli/wp-content/plugins/wp-data-access/assets/js/wpda_rest_api.js
File size: 671 bytes
MIME-type: text/plain
Charset: utf-8
function wpda_rest_api(path, data, callbackOk, callbackError, method = "POST") {
jQuery.ajax({
url: wpApiSettings.root + wpdaApiSettings.path + "/" + path,
method: method,
beforeSend: function (xhr) {
xhr.setRequestHeader("X-WP-Nonce", wpApiSettings.nonce);
},
data: data
}).done(function(response) {
if (callbackOk!==undefined) {
callbackOk(response)
} else {
console.error("Missing API callback. Server response:")
console.error(response)
}
}).fail(function(response) {
if (callbackError!==undefined) {
callbackError(response)
} else {
console.error("Missing API callback. Server response:")
console.error(response)
}
})
}