From 3735f6747c364368ab80634b2bd1d9287da531a2 Mon Sep 17 00:00:00 2001 From: MarcosViniciusG Date: Mon, 19 Aug 2024 17:05:13 -0300 Subject: [PATCH] =?UTF-8?q?Feat:=20agora=20o=20JS=20e=20o=20CSS=20do=20adm?= =?UTF-8?q?in=20s=C3=B3=20carrega=20na=20p=C3=A1gina=20do=20admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lgbtq_connect/includes/admin/admin_script.js | 7 ------- lgbtq_connect/index.php | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lgbtq_connect/includes/admin/admin_script.js b/lgbtq_connect/includes/admin/admin_script.js index 5eef9223..187bec73 100644 --- a/lgbtq_connect/includes/admin/admin_script.js +++ b/lgbtq_connect/includes/admin/admin_script.js @@ -800,11 +800,4 @@ document.querySelectorAll('.ver-mais-btn').forEach(function (button) { // Inicializa o mapa e os botões de ordenação quando a página carrega window.onload = function () { initMapAdmin(); -}; - -// Exporta as classes -module.exports = { - Filtro, - Ordenador, - Tabela }; \ No newline at end of file diff --git a/lgbtq_connect/index.php b/lgbtq_connect/index.php index 28df4218..dcf70b9b 100644 --- a/lgbtq_connect/index.php +++ b/lgbtq_connect/index.php @@ -50,6 +50,11 @@ function load_meu_plugin_styles() { } function enfileirar_scripts_admin() { + // Se a página não for a de admin, então sai da função + if (!is_admin() || !(isset($_GET['page']) && $_GET['page'] === 'lc_admin')) { + return; + } + global $wpdb; // Obtém os formulários aprovados $formularios_aprovados = obter_formularios_aprovados($wpdb); @@ -85,6 +90,10 @@ function enfileirar_scripts_admin() { function enfileirar_styles_admin() { + // Se a página não for a de admin, então sai da função + if (!is_admin() || !(isset($_GET['page']) && $_GET['page'] === 'lc_admin')) { + return; + } wp_enqueue_style('admin-style', plugin_dir_url(__FILE__) . 'includes/admin/style-admin.css', array(), '1.0'); }