HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/appointmentbook.me/wp-content/themes/astra/inc/assets/js/custom-fields-priority.js
/**
 * custom-fields-priority.js
 *
 * Provide more preferences to Astra meta setting so wordpress custom field not causing any kind of conflicts.
 *
 * @package Astra
 */
function removeMetaBoxSection() {
	document.getElementById("the-list").remove();
}

function buttonClickEvent() {
	[...document.querySelectorAll('.editor-post-publish-button')].forEach(element => element.addEventListener('click', function (event) {
		removeMetaBoxSection();

	}));

	[...document.querySelectorAll('.editor-post-publish-panel__toggle')].forEach(element => element.addEventListener('click', function (event) {
		removeMetaBoxSection();
	}));
}

function DOMContentLoaded() {
	const elementMetaBox = document.getElementById("the-list");
	if (elementMetaBox != null) {
		setTimeout(buttonClickEvent, 2000);
	}
}

document.addEventListener('DOMContentLoaded', DOMContentLoaded, false);