From 6be292e08500769452125fce52e66cdc7ce0c493 Mon Sep 17 00:00:00 2001 From: FrankZamora Date: Sat, 6 Dec 2025 18:17:48 -0600 Subject: [PATCH] chore: eliminar related-posts.php legacy (plan 101 fase 3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - eliminar inc/related-posts.php (reemplazado por relatedpostrenderer) - eliminar require en functions.php 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Inc/related-posts.php | 294 ------------------------------------------ functions.php | 2 +- 2 files changed, 1 insertion(+), 295 deletions(-) delete mode 100644 Inc/related-posts.php diff --git a/Inc/related-posts.php b/Inc/related-posts.php deleted file mode 100644 index a8ea3688..00000000 --- a/Inc/related-posts.php +++ /dev/null @@ -1,294 +0,0 @@ - 'post', - 'post_status' => 'publish', - 'posts_per_page' => $posts_per_page, - 'post__not_in' => array($post_id), - 'category__in' => $categories, - 'orderby' => 'rand', - 'no_found_rows' => true, - 'update_post_meta_cache' => false, - 'update_post_term_cache' => false, - ); - - // Allow filtering of query args - $args = apply_filters('roi_related_posts_args', $args, $post_id); - - // Get related posts - $related_query = new WP_Query($args); - - return $related_query->have_posts() ? $related_query : false; -} - -/** - * Display related posts section - * - * @param int|null $post_id Optional. Post ID. Default is current post. - * @return void - */ -function roi_display_related_posts($post_id = null) { - // Get post ID - if (!$post_id) { - $post_id = get_the_ID(); - } - - // Check if related posts are enabled - $enabled = get_option('roi_related_posts_enabled', true); - if (!$enabled) { - return; - } - - // Get related posts - $related_query = roi_get_related_posts($post_id); - - if (!$related_query) { - return; - } - - // Get configuration options - $title = get_option('roi_related_posts_title', __('Related Posts', 'roi-theme')); - $columns = get_option('roi_related_posts_columns', 3); - $show_excerpt = get_option('roi_related_posts_show_excerpt', true); - $show_date = get_option('roi_related_posts_show_date', true); - $show_category = get_option('roi_related_posts_show_category', true); - $excerpt_length = get_option('roi_related_posts_excerpt_length', 20); - $background_colors = get_option('roi_related_posts_bg_colors', array( - '#1a73e8', // Blue - '#e91e63', // Pink - '#4caf50', // Green - '#ff9800', // Orange - '#9c27b0', // Purple - '#00bcd4', // Cyan - )); - - // Calculate Bootstrap column class - $col_class = roi_get_column_class($columns); - - // Start output - ?> - - - true, - 'roi_related_posts_title' => __('Related Posts', 'roi-theme'), - 'roi_related_posts_count' => 3, - 'roi_related_posts_columns' => 3, - 'roi_related_posts_show_excerpt' => true, - 'roi_related_posts_excerpt_length' => 20, - 'roi_related_posts_show_date' => true, - 'roi_related_posts_show_category' => true, - 'roi_related_posts_bg_colors' => array( - '#1a73e8', // Blue - '#e91e63', // Pink - '#4caf50', // Green - '#ff9800', // Orange - '#9c27b0', // Purple - '#00bcd4', // Cyan - ), - ); - - foreach ($defaults as $option => $value) { - if (get_option($option) === false) { - add_option($option, $value); - } - } -} -add_action('after_setup_theme', 'roi_related_posts_default_options'); diff --git a/functions.php b/functions.php index 97040a0b..d946a389 100644 --- a/functions.php +++ b/functions.php @@ -50,7 +50,7 @@ require_once get_template_directory() . '/Inc/featured-image.php'; require_once get_template_directory() . '/Inc/category-badge.php'; require_once get_template_directory() . '/Inc/adsense-delay.php'; require_once get_template_directory() . '/Inc/adsense-placement.php'; -require_once get_template_directory() . '/Inc/related-posts.php'; +// ELIMINADO: Inc/related-posts.php (Plan 101 - usa RelatedPostRenderer) // ELIMINADO: Inc/toc.php (FASE 6 - Clean Architecture: usa TableOfContentsRenderer) require_once get_template_directory() . '/Inc/apu-tables.php'; require_once get_template_directory() . '/Inc/search-disable.php';