Skip to content

Commit

Permalink
Feat: agora o JS e o CSS do admin só carrega na página do admin
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosViniciusG committed Aug 19, 2024
1 parent 8899ade commit 3735f67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lgbtq_connect/includes/admin/admin_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
9 changes: 9 additions & 0 deletions lgbtq_connect/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
}

Expand Down

0 comments on commit 3735f67

Please sign in to comment.