Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/hostinge.../src/js
File: global-scripts.js
document.addEventListener('DOMContentLoaded', function() {
[0] Fix | Delete
[1] Fix | Delete
const pluginSplitClose = document.getElementById('plugin-split-close');
[2] Fix | Delete
[3] Fix | Delete
if(pluginSplitClose) {
[4] Fix | Delete
pluginSplitClose.addEventListener('click', function () {
[5] Fix | Delete
let nonceElement = document.getElementById('hts_close_plugin_split_nonce');
[6] Fix | Delete
[7] Fix | Delete
if (!nonceElement) {
[8] Fix | Delete
console.error('Nonce element not found.');
[9] Fix | Delete
return;
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
let nonce = nonceElement.value;
[13] Fix | Delete
[14] Fix | Delete
fetch(ajaxurl, {
[15] Fix | Delete
method: 'POST',
[16] Fix | Delete
headers: {
[17] Fix | Delete
'Content-Type': 'application/x-www-form-urlencoded',
[18] Fix | Delete
},
[19] Fix | Delete
body: new URLSearchParams({
[20] Fix | Delete
'action': 'hostinger_dismiss_plugin_split_notice',
[21] Fix | Delete
'nonce': nonce
[22] Fix | Delete
}),
[23] Fix | Delete
})
[24] Fix | Delete
.then(response => {
[25] Fix | Delete
if (!response.ok) {
[26] Fix | Delete
throw new Error('Network response was not ok ' + response.statusText);
[27] Fix | Delete
}
[28] Fix | Delete
return response.json();
[29] Fix | Delete
})
[30] Fix | Delete
.then(data => {
[31] Fix | Delete
document.getElementById('hostinger-plugin-split-notice').style.display = 'none';
[32] Fix | Delete
})
[33] Fix | Delete
.catch(error => {
[34] Fix | Delete
console.error('Error:', error);
[35] Fix | Delete
});
[36] Fix | Delete
});
[37] Fix | Delete
}
[38] Fix | Delete
});
[39] Fix | Delete
[40] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function