/**
* TESTE WPCode - Magazine Amaro
* Objetivo: confirmar se o PHP do WPCode está carregando no site
* Pode remover/desativar depois do teste.
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Força não cachear enquanto testa.
*/
add_action('init', function () {
if (is_admin() || wp_doing_ajax()) {
return;
}
if (!defined('DONOTCACHEPAGE')) {
define('DONOTCACHEPAGE', true);
}
if (!defined('DONOTCACHEOBJECT')) {
define('DONOTCACHEOBJECT', true);
}
if (!defined('DONOTCACHEDB')) {
define('DONOTCACHEDB', true);
}
nocache_headers();
if (!headers_sent()) {
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
}
}, 1);
/**
* Adiciona uma classe no body.
*/
add_filter('body_class', function ($classes) {
$classes[] = 'ma-wpcode-teste-ativo';
return $classes;
});
/**
* Teste visual no HEAD.
*/
add_action('wp_head', function () {
if (is_admin()) {
return;
}
?>