refactor: Remove legacy roi_get_option() calls from Inc/ files

- Clean Inc/adsense-delay.php
- Clean Inc/category-badge.php
- Clean Inc/enqueue-scripts.php
- Clean Inc/featured-image.php
- Clean Inc/social-share.php
- Clean sidebar.php - use roi_render_component('table-of-contents')
- Add roi_get_component_setting() helper to functions-addon.php

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-11-26 21:58:44 -06:00
parent 7a8daa72c6
commit 8878afe168
7 changed files with 117 additions and 120 deletions

View File

@@ -20,16 +20,10 @@ if ( ! is_active_sidebar( 'sidebar-1' ) ) {
/**
* Display Table of Contents (TOC) on single posts
* Issue #86 - TOC should be displayed in sidebar
* Clean Architecture: Usa TableOfContentsRenderer
*/
if (is_single() && function_exists('roi_extract_headings') && function_exists('roi_generate_toc')) {
global $post;
if (!empty($post->post_content)) {
$headings = roi_extract_headings($post->post_content);
$toc_html = roi_generate_toc($headings);
if (!empty($toc_html)) {
echo $toc_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
if (is_single() && function_exists('roi_render_component')) {
echo roi_render_component('table-of-contents'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>