From 10fa996656d068a082393250c5691eee6dd137c9 Mon Sep 17 00:00:00 2001 From: gustavo Date: Mon, 3 Nov 2025 07:57:01 +0000 Subject: [PATCH] ADD class comments --- functions.php | 47 +---------------------- src/Comments.php | 94 +++++++++++++++++++++++++++++++++++++++++++++ src/StarterSite.php | 3 +- 3 files changed, 98 insertions(+), 46 deletions(-) create mode 100644 src/Comments.php diff --git a/functions.php b/functions.php index 2452eba..dc48bd8 100644 --- a/functions.php +++ b/functions.php @@ -14,8 +14,10 @@ use Timber\Timber; require_once __DIR__ . '/src/SMTP.php'; //config email require_once __DIR__ . '/vendor/autoload.php'; // Load Composer dependencies. +require_once __DIR__ . '/src/Comments.php'; // ocultar posibilidad de comentarios Timber::init(); +Comments::init(); $site = new StarterSite(); @@ -66,48 +68,3 @@ foreach(['/es/documentos/page/:paged','/eu/dokumentuak/page/:paged'] as $route) Routes::load('archive-documentos.php', $params, $query, 200); }); } - - -// *************************DEBUGUEANDO................... - -// add_shortcode('test_smtp_db', function() { -// global $wpdb; - -// $output = '

Verificación directa en BD:

'; - -// // Buscar en la tabla wp_options todas las entradas que contengan 'smtp' -// $results = $wpdb->get_results(" -// SELECT option_name, option_value -// FROM {$wpdb->options} -// WHERE option_name LIKE '%smtp%' -// ORDER BY option_name -// "); - -// if ($results) { -// $output .= ''; -// } else { -// $output .= '

❌ No se encontró ninguna opción con "smtp" en la base de datos

'; -// } - -// // Probar diferentes variaciones -// $output .= '

Pruebas de get_option:

'; - -// return $output; -// }); \ No newline at end of file diff --git a/src/Comments.php b/src/Comments.php new file mode 100644 index 0000000..0d19ae2 --- /dev/null +++ b/src/Comments.php @@ -0,0 +1,94 @@ +remove_menu( 'comments' ); + error_log('✅ admin_bar_render'); + + } + + +} + + diff --git a/src/StarterSite.php b/src/StarterSite.php index 5c695da..17e1c7d 100644 --- a/src/StarterSite.php +++ b/src/StarterSite.php @@ -35,7 +35,8 @@ class StarterSite extends Site { add_filter('timber/context', [$this, 'add_global_context']); // variables globales add_filter('timber/twig', [$this, 'add_videos_embed_to_twig']); //videos embed add_action('pre_get_posts', array($this, 'exclude_pages_from_search')); //exclude pages with ACF - + + // función que reconoce los campos ACF en los diferentes idiomas. add_action('init', function() { if (function_exists('pll_current_language')) {