Changeset 3463974
- Timestamp:
- 02/18/2026 06:33:05 AM (6 weeks ago)
- Location:
- easy-table-of-contents/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (2 diffs)
-
changelog.txt (modified) (1 diff)
-
easy-table-of-contents.php (modified) (7 diffs)
-
includes/class-eztoc-option.php (modified) (2 diffs)
-
includes/class-eztoc-post.php (modified) (3 diffs)
-
includes/class-eztoc-widgetsticky.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-table-of-contents/trunk/README.txt
r3429975 r3463974 6 6 Tested up to: 6.9 7 7 Requires PHP: 5.6.20 8 Stable tag: 2.0.8 08 Stable tag: 2.0.81 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 136 136 == Changelog == 137 = 2.0.81 18/02/2026 = 138 * Fixed: Make "Exclude Headings by Class" work if class is contained inside the heading #941 139 * Fixed: CSRF vulnerabilty in <= 2.0.80 reported by Patchstack (Mike Montoya) 140 * Fixed: Import not working #938 141 * Compatibility: Compatibility with hubbub pro #939 142 137 143 = 2.0.80 31/12/2025 = 138 144 * Fixed: Alternate heading option is not working #932 -
easy-table-of-contents/trunk/changelog.txt
r3429975 r3463974 1 1 == Changelog == 2 = 2.0.81 18/02/2026 = 3 * Fixed: Make "Exclude Headings by Class" work if class is contained inside the heading #941 4 * Fixed: CSRF vulnerabilty in <= 2.0.80 reported by Patchstack (Mike Montoya) 5 * Fixed: Import not working #938 6 * Compatibility: Compatibility with hubbub pro #939 7 2 8 = 2.0.80 31/12/2025 = 3 9 * Fixed: Alternate heading option is not working #932 -
easy-table-of-contents/trunk/easy-table-of-contents.php
r3429975 r3463974 4 4 * Plugin URI: https://tocwp.com/ 5 5 * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content. 6 * Version: 2.0.8 06 * Version: 2.0.81 7 7 * Author: Magazine3 8 8 * Author URI: https://tocwp.com/ … … 29 29 * @category Plugin 30 30 * @author Magazine3 31 * @version 2.0.8 031 * @version 2.0.81 32 32 */ 33 33 … … 53 53 * @var string 54 54 */ 55 const VERSION = '2.0.8 0';55 const VERSION = '2.0.81'; 56 56 57 57 /** … … 1422 1422 if ( 'ez-toc-widget-sticky' == $tag ) { 1423 1423 1424 // Check which attributes were actually provided before shortcode_atts sets defaults 1425 $has_title = isset( $atts['title'] ); 1426 $has_title_font_size = isset( $atts['title_font_size'] ); 1427 $has_title_font_size_unit = isset( $atts['title_font_size_unit'] ); 1428 $has_title_font_weight = isset( $atts['title_font_weight'] ); 1429 $has_title_font_color = isset( $atts['title_font_color'] ); 1430 $has_text_font_size = isset( $atts['text_font_size'] ); 1431 $has_text_font_size_unit = isset( $atts['text_font_size_unit'] ); 1432 $has_text_font_weight = isset( $atts['text_font_weight'] ); 1433 $has_text_font_color = isset( $atts['text_font_color'] ); 1434 $has_scroll_fixed_position = isset( $atts['scroll_fixed_position'] ); 1435 $has_toc_background_color = isset( $atts['toc_background_color'] ); 1436 $has_toc_title_background_color = isset( $atts['toc_title_background_color'] ); 1437 1424 1438 extract( shortcode_atts( array( 1425 1439 'highlight_color' => '#ededed', … … 1442 1456 'text_font_weight' => '400', 1443 1457 'text_font_color' => '', 1458 'toc_background_color' => '', 1459 'toc_title_background_color' => '', 1444 1460 'ez_toc_widget_sticky_before_widget_container' => '', 1445 1461 'ez_toc_widget_sticky_before_widget' => '', … … 1455 1471 1456 1472 $instance = array( 1457 'title' => ( ! empty ( $title ) ) ? $title : '',1458 'sidebar_sticky_title' => ( ! empty ( $title ) ) ? $title : '',1473 'title' => ( $has_title && ! empty ( $title ) ) ? $title : ezTOC_Option::get( 'heading_text', 'Table of Contents' ), 1474 'sidebar_sticky_title' => ( $has_title && ! empty ( $title ) ) ? $title : ezTOC_Option::get( 'heading_text', 'Table of Contents' ), 1459 1475 'highlight_color' => ( ! empty ( $highlight_color ) ) ? $highlight_color : '#ededed', 1460 1476 'advanced_options' => ( ! empty ( $advanced_options ) ) ? $advanced_options : '', 1461 'scroll_fixed_position' => ( ! empty ( $scroll_fixed_position ) ) ? ( int ) $scroll_fixed_position : 30,1477 'scroll_fixed_position' => ( $has_scroll_fixed_position && ! empty ( $scroll_fixed_position ) ) ? ( int ) $scroll_fixed_position : (int) ezTOC_Option::get( 'smooth_scroll_offset', 30 ), 1462 1478 'sidebar_width' => ( ! empty ( $sidebar_width ) ) ? ( 'auto' == $sidebar_width ) ? $sidebar_width : ( int ) wp_strip_all_tags ( $sidebar_width ) : 'auto', 1463 1479 'sidebar_width_size_unit' => ( ! empty ( $sidebar_width_size_unit ) ) ? $sidebar_width_size_unit : 'none', … … 1467 1483 'scroll_max_height' => ( ! empty ( $scroll_max_height ) ) ? ( 'auto' == $scroll_max_height ) ? $scroll_max_height : ( int ) wp_strip_all_tags ( $scroll_max_height ) : 'auto', 1468 1484 'scroll_max_height_size_unit' => ( ! empty ( $scroll_max_height_size_unit ) ) ? $scroll_max_height_size_unit : 'none', 1469 'sidebar_sticky_title_size' => ( ! empty ( $title_font_size ) ) ? ( 'auto' == $title_font_size ) ? $title_font_size : ( int ) wp_strip_all_tags ( $title_font_size ) : '120', 1470 'sidebar_sticky_title_size_unit' => ( ! empty ( $title_font_size_unit ) ) ? $title_font_size_unit : '%', 1471 'sidebar_sticky_title_weight' => ( ! empty ( $title_font_weight ) ) ? $title_font_weight : '600', 1472 'sidebar_sticky_title_color' => ( ! empty ( $title_font_color ) ) ? $title_font_color : '', 1473 'sidebar_sticky_size' => ( ! empty ( $text_font_size ) ) ? ( 'auto' == $text_font_size ) ? $text_font_size : ( int ) wp_strip_all_tags ( $text_font_size ) : '100', 1474 'sidebar_sticky_size_unit' => ( ! empty ( $text_font_size_unit ) ) ? $text_font_size_unit : '%', 1475 'sidebar_sticky_weight' => ( ! empty ( $text_font_weight ) ) ? $text_font_weight : '400', 1476 'sidebar_sticky_color' => ( ! empty ( $text_font_color ) ) ? $text_font_color : '', 1485 'sidebar_sticky_title_size' => ( $has_title_font_size && ! empty ( $title_font_size ) ) ? ( 'auto' == $title_font_size ) ? $title_font_size : ( int ) wp_strip_all_tags ( $title_font_size ) : (int) ezTOC_Option::get( 'title_font_size', 120 ), 1486 'sidebar_sticky_title_size_unit' => ( $has_title_font_size_unit && ! empty ( $title_font_size_unit ) ) ? $title_font_size_unit : ezTOC_Option::get( 'title_font_size_units', '%' ), 1487 'sidebar_sticky_title_weight' => ( $has_title_font_weight && ! empty ( $title_font_weight ) ) ? $title_font_weight : ezTOC_Option::get( 'title_font_weight', '600' ), 1488 'sidebar_sticky_title_color' => ( $has_title_font_color && ! empty ( $title_font_color ) ) ? $title_font_color : ezTOC_Option::get( 'custom_title_colour', '' ), 1489 'sidebar_sticky_size' => ( $has_text_font_size && ! empty ( $text_font_size ) ) ? ( 'auto' == $text_font_size ) ? $text_font_size : ( int ) wp_strip_all_tags ( $text_font_size ) : (int) ezTOC_Option::get( 'font_size', 95 ), 1490 'sidebar_sticky_size_unit' => ( $has_text_font_size_unit && ! empty ( $text_font_size_unit ) ) ? $text_font_size_unit : ezTOC_Option::get( 'font_size_units', '%' ), 1491 'sidebar_sticky_weight' => ( $has_text_font_weight && ! empty ( $text_font_weight ) ) ? $text_font_weight : ezTOC_Option::get( 'font_weight', '400' ), 1492 'sidebar_sticky_color' => ( $has_text_font_color && ! empty ( $text_font_color ) ) ? $text_font_color : ezTOC_Option::get( 'custom_link_colour', '' ), 1493 'toc_background_color' => ( $has_toc_background_color && ! empty ( $toc_background_color ) ) ? $toc_background_color : ezTOC_Option::get( 'custom_background_colour', '' ), 1494 'toc_title_background_color' => ( $has_toc_title_background_color && ! empty ( $toc_title_background_color ) ) ? $toc_title_background_color : ezTOC_Option::get( 'custom_title_background', '' ), 1477 1495 'show_toggle' => ( ! empty ( $show_toggle ) ) ? $show_toggle : '', 1478 1496 'device_target' => ( ! empty ( $device_target ) ) ? $device_target : '' -
easy-table-of-contents/trunk/includes/class-eztoc-option.php
r3414473 r3463974 96 96 // Code to settings backup file 97 97 $uploaded_file_settings = array(); 98 $import_error = false; 99 $import_success = false; 100 98 101 //phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason : Nonce is already verified in the settings page 99 if(isset($_FILES['eztoc_import_backup']) ){102 if(isset($_FILES['eztoc_import_backup']) && !empty($_FILES['eztoc_import_backup']['name'])){ 100 103 //phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason : Nonce is already verified in the settings page 101 $eztoc_import_backup_name = isset($_FILES['eztoc_import_backup']['name']) ?esc_url_raw(wp_unslash($_FILES["eztoc_import_backup"]["name"])):''; 102 $fileInfo = wp_check_filetype(basename($eztoc_import_backup_name)); 103 if (!empty($fileInfo['ext']) && $fileInfo['ext'] == 'json') { 104 $file_error = isset($_FILES['eztoc_import_backup']['error']) ? $_FILES['eztoc_import_backup']['error'] : UPLOAD_ERR_NO_FILE; 105 106 // Check for file upload errors 107 if($file_error !== UPLOAD_ERR_OK){ 108 $error_messages = array( 109 UPLOAD_ERR_INI_SIZE => esc_html__('The uploaded file exceeds the upload_max_filesize directive in php.ini.', 'easy-table-of-contents'), 110 UPLOAD_ERR_FORM_SIZE => esc_html__('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', 'easy-table-of-contents'), 111 UPLOAD_ERR_PARTIAL => esc_html__('The uploaded file was only partially uploaded.', 'easy-table-of-contents'), 112 UPLOAD_ERR_NO_FILE => esc_html__('No file was uploaded.', 'easy-table-of-contents'), 113 UPLOAD_ERR_NO_TMP_DIR => esc_html__('Missing a temporary folder.', 'easy-table-of-contents'), 114 UPLOAD_ERR_CANT_WRITE => esc_html__('Failed to write file to disk.', 'easy-table-of-contents'), 115 UPLOAD_ERR_EXTENSION => esc_html__('A PHP extension stopped the file upload.', 'easy-table-of-contents'), 116 ); 117 $error_message = isset($error_messages[$file_error]) ? $error_messages[$file_error] : esc_html__('Unknown upload error.', 'easy-table-of-contents'); 118 add_settings_error('ez-toc-settings', 'import_file_error', esc_html__('Import failed: ', 'easy-table-of-contents') . $error_message, 'error'); 119 $import_error = true; 120 } else { 104 121 //phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason : Nonce is already verified in the settings page 105 $eztoc_import_backup_tmpname = isset($_FILES['eztoc_import_backup']['tmp_name']) ?esc_url_raw(wp_unslash($_FILES["eztoc_import_backup"]["tmp_name"])):''; 106 if(!empty($eztoc_import_backup_tmpname)){ 122 $eztoc_import_backup_name_original = isset($_FILES['eztoc_import_backup']['name']) ? wp_unslash($_FILES["eztoc_import_backup"]["name"]) : ''; 123 $eztoc_import_backup_name = sanitize_file_name($eztoc_import_backup_name_original); 124 125 // Check file extension directly (more reliable than wp_check_filetype for JSON) 126 // Check both original and sanitized filename to be safe 127 $file_extension = strtolower(pathinfo($eztoc_import_backup_name_original, PATHINFO_EXTENSION)); 128 if (empty($file_extension)) { 129 $file_extension = strtolower(pathinfo($eztoc_import_backup_name, PATHINFO_EXTENSION)); 130 } 131 132 // Check file extension 133 if (empty($file_extension) || $file_extension !== 'json') { 134 add_settings_error('ez-toc-settings', 'import_file_type', sprintf(esc_html__('Import failed: Please upload a valid JSON file. File extension must be .json (detected extension: %s)', 'easy-table-of-contents'), $file_extension ? $file_extension : esc_html__('none', 'easy-table-of-contents')), 'error'); 135 $import_error = true; 136 } else { 107 137 //phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason : Nonce is already verified in the settings page 108 $uploaded_file_settings = json_decode(eztoc_read_file_contents($eztoc_import_backup_tmpname), true); 109 } 110 } 111 } 112 if(!empty($uploaded_file_settings) && is_array($uploaded_file_settings) && count($uploaded_file_settings) >= 40){ 113 $etoc_default_settings = self::getDefaults(); 114 if(!empty($etoc_default_settings) && is_array($etoc_default_settings)){ 115 // Pro Options 116 $etoc_default_settings['exclude_by_class'] = ''; 117 $etoc_default_settings['exclude_by_shortcode'] = ''; 118 $etoc_default_settings['fixedtoc'] = false; 119 $etoc_default_settings['highlightheadings'] = false; 120 $etoc_default_settings['shrinkthewidth'] = false; 121 $etoc_default_settings['acf-support'] = false; 122 $etoc_default_settings['gp-premium-element-support'] = false; 123 $exported_array = array(); 124 foreach ($etoc_default_settings as $inkey => $invalue) { 125 foreach ($uploaded_file_settings as $ufs_key => $ufs_value) { 126 if($inkey == $ufs_key){ 127 if(is_array($ufs_value)){ 128 $exported_array[$inkey] = array_map('sanitize_text_field', $ufs_value); 129 }else{ 130 $exported_array[$inkey] = sanitize_text_field($ufs_value); 138 $eztoc_import_backup_tmpname = isset($_FILES['eztoc_import_backup']['tmp_name']) ? sanitize_text_field(wp_unslash($_FILES["eztoc_import_backup"]["tmp_name"])) : ''; 139 140 if(empty($eztoc_import_backup_tmpname)){ 141 add_settings_error('ez-toc-settings', 'import_file_empty', esc_html__('Import failed: File is empty or could not be read.', 'easy-table-of-contents'), 'error'); 142 $import_error = true; 143 } else { 144 // Read file contents 145 $file_contents = eztoc_read_file_contents($eztoc_import_backup_tmpname); 146 147 if($file_contents === false){ 148 add_settings_error('ez-toc-settings', 'import_file_read', esc_html__('Import failed: Could not read the uploaded file.', 'easy-table-of-contents'), 'error'); 149 $import_error = true; 150 } else { 151 // Decode JSON 152 $uploaded_file_settings = json_decode($file_contents, true); 153 $json_error = json_last_error(); 154 155 if($json_error !== JSON_ERROR_NONE){ 156 $json_error_messages = array( 157 JSON_ERROR_DEPTH => esc_html__('Maximum stack depth exceeded.', 'easy-table-of-contents'), 158 JSON_ERROR_STATE_MISMATCH => esc_html__('Underflow or the modes mismatch.', 'easy-table-of-contents'), 159 JSON_ERROR_CTRL_CHAR => __('Unexpected control character found.', 'easy-table-of-contents'), 160 JSON_ERROR_SYNTAX => esc_html__('Syntax error, malformed JSON.', 'easy-table-of-contents'), 161 JSON_ERROR_UTF8 => esc_html__('Malformed UTF-8 characters, possibly incorrectly encoded.', 'easy-table-of-contents'), 162 ); 163 $json_error_message = isset($json_error_messages[$json_error]) ? $json_error_messages[$json_error] : esc_html__('Unknown JSON error.', 'easy-table-of-contents'); 164 add_settings_error('ez-toc-settings', 'import_json_error', esc_html__('Import failed: Invalid JSON format. ', 'easy-table-of-contents') . $json_error_message, 'error'); 165 $import_error = true; 166 } elseif(empty($uploaded_file_settings) || !is_array($uploaded_file_settings)){ 167 add_settings_error('ez-toc-settings', 'import_json_empty', esc_html__('Import failed: JSON file is empty or invalid.', 'easy-table-of-contents'), 'error'); 168 $import_error = true; 169 } elseif(count($uploaded_file_settings) < 40){ 170 add_settings_error('ez-toc-settings', 'import_settings_count', esc_html__('Import failed: The file does not contain enough settings (minimum 40 required). This may not be a valid Easy TOC settings file.', 'easy-table-of-contents'), 'error'); 171 $import_error = true; 172 } else { 173 // Validate and process settings 174 $etoc_default_settings = self::getDefaults(); 175 if(!empty($etoc_default_settings) && is_array($etoc_default_settings)){ 176 // Pro Options 177 $etoc_default_settings['exclude_by_class'] = ''; 178 $etoc_default_settings['exclude_by_shortcode'] = ''; 179 $etoc_default_settings['fixedtoc'] = false; 180 $etoc_default_settings['highlightheadings'] = false; 181 $etoc_default_settings['shrinkthewidth'] = false; 182 $etoc_default_settings['acf-support'] = false; 183 $etoc_default_settings['gp-premium-element-support'] = false; 184 $exported_array = array(); 185 186 foreach ($etoc_default_settings as $inkey => $invalue) { 187 foreach ($uploaded_file_settings as $ufs_key => $ufs_value) { 188 if($inkey == $ufs_key){ 189 if(is_array($ufs_value)){ 190 $exported_array[$inkey] = array_map('sanitize_text_field', $ufs_value); 191 }else{ 192 $exported_array[$inkey] = sanitize_text_field($ufs_value); 193 } 194 } 195 } 196 } 197 198 if(count($exported_array) >= 40){ 199 $input = array(); 200 $input = $exported_array; 201 $import_success = true; 202 add_settings_error('ez-toc-settings', 'import_success', esc_html__('Settings imported successfully!', 'easy-table-of-contents'), 'updated'); 203 } else { 204 add_settings_error('ez-toc-settings', 'import_validation', esc_html__('Import failed: Could not match enough valid settings from the imported file.', 'easy-table-of-contents'), 'error'); 205 $import_error = true; 206 } 207 } else { 208 add_settings_error('ez-toc-settings', 'import_defaults', esc_html__('Import failed: Could not load default settings for validation.', 'easy-table-of-contents'), 'error'); 209 $import_error = true; 210 } 131 211 } 132 } 133 } 134 } 135 if(count($exported_array) >= 40){ 136 $input = array(); 137 $input = $exported_array; 138 } 139 } 140 } 212 } 213 } 214 } 215 } 216 } 141 217 142 218 $registered = self::getRegistered(); … … 2720 2796 */ 2721 2797 public static function eztoc_reset_options_to_default() { 2722 if( isset($_POST['eztoc_security_nonce']) && !wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['eztoc_security_nonce'] ) ), 'eztoc_ajax_check_nonce' ) ) 2798 2799 if( !isset($_POST['eztoc_security_nonce']) || !wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['eztoc_security_nonce'] ) ), 'eztoc_ajax_check_nonce' ) ) 2723 2800 { 2724 2801 return esc_html__('Security Alert: nonce not verified!', 'easy-table-of-contents' ); -
easy-table-of-contents/trunk/includes/class-eztoc-post.php
r3429975 r3463974 369 369 $content = apply_filters( 'ez_toc_modify_process_page_content', $this->post->post_content ); //phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Legacy hook name. 370 370 //This is the new hook , it should be used instead of the legacy one. 371 $content = apply_filters( 'eztoc_modify_process_page_content', $ this->post->post_content );371 $content = apply_filters( 'eztoc_modify_process_page_content', $content ); 372 372 373 373 // Fix for wordpress category pages showing wrong toc if they have description … … 502 502 $selectors = apply_filters( 'ez_toc_exclude_by_selector', array( '.ez-toc-exclude-headings' ), $content ); //phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Legacy hook name. 503 503 //This is the new hook , it should be used instead of the legacy one. 504 $selectors = apply_filters( 'eztoc_exclude_by_selector', array( '.ez-toc-exclude-headings' ), $content );504 $selectors = apply_filters( 'eztoc_exclude_by_selector', $selectors, $content ); 505 505 $selectors = ! is_array( $selectors ) ? [] : $selectors; // In case we get string instead of array 506 506 $nodes = $html->Find( implode( ',', $selectors ) ); … … 616 616 private function inExcludedNode( $string ) { 617 617 618 foreach ( $this->excludedNodes as $node ) { 619 620 if ( empty( $node ) || empty( $string ) ) { 621 622 return false; 623 } 624 625 if ( false !== strpos( $node, $string ) ) { 626 627 return true; 628 } 629 } 630 631 return false; 618 return apply_filters('eztoc_pro_excluded_node_check', false , $this->excludedNodes, $string); 632 619 } 633 620 -
easy-table-of-contents/trunk/includes/class-eztoc-widgetsticky.php
r3414473 r3463974 387 387 color: <?php echo esc_attr ( isset($instance[ 'active_section_text_color' ]) ? $instance[ 'active_section_text_color' ] : '' ); ?>; 388 388 } 389 <?php if (!empty($instance['toc_background_color'])): ?> 390 .ez-toc-widget-sticky-container-<?php echo esc_attr($this->id) ?> { background-color: <?php echo esc_attr($instance['toc_background_color']); ?> !important; } 391 .ez-toc-widget-sticky-container-<?php echo esc_attr($this->id) ?> .ez-toc-sidebar { background-color: <?php echo esc_attr($instance['toc_background_color']); ?> !important; } 392 <?php endif; ?> 393 <?php if (!empty($instance['toc_title_background_color'])): ?> 394 .ez-toc-widget-sticky-container-<?php echo esc_attr($this->id) ?> .ez-toc-widget-sticky-title-container { background-color: <?php echo esc_attr($instance['toc_title_background_color']); ?> !important; } 395 .ez-toc-widget-sticky-container-<?php echo esc_attr($this->id) ?> .ez-toc-sticky-title-container { background-color: <?php echo esc_attr($instance['toc_title_background_color']); ?> !important; } 396 <?php endif; ?> 389 397 </style> 390 398 <?php … … 526 534 $instance[ 'sidebar_sticky_weight' ] = wp_strip_all_tags ( $new_instance[ 'sidebar_sticky_weight' ] ); 527 535 $instance[ 'sidebar_sticky_color' ] = wp_strip_all_tags ( $new_instance[ 'sidebar_sticky_color' ] ); 536 $instance[ 'toc_background_color' ] = wp_strip_all_tags ( $new_instance[ 'toc_background_color' ] ); 537 $instance[ 'toc_title_background_color' ] = wp_strip_all_tags ( $new_instance[ 'toc_title_background_color' ] ); 528 538 $instance[ 'heading_label_tag' ] = wp_strip_all_tags ( $new_instance[ 'heading_label_tag' ] ); 529 539 } else … … 538 548 $instance[ 'sidebar_sticky_weight' ] = '400'; 539 549 $instance[ 'sidebar_sticky_color' ] = 'inherit'; 550 $instance[ 'toc_background_color' ] = ''; 551 $instance[ 'toc_title_background_color' ] = ''; 540 552 $instance[ 'heading_label_tag' ] = 'default'; 541 553 } … … 598 610 'sidebar_sticky_weight' => '500', 599 611 'sidebar_sticky_color' => '', 612 'toc_background_color' => '', 613 'toc_title_background_color' => '', 600 614 'sidebar_width' => 'auto', 601 615 'sidebar_width_size_unit' => 'none', … … 615 629 $title_color = esc_attr ( $instance[ 'sidebar_sticky_title_color' ] ); 616 630 $text_color = esc_attr ( $instance[ 'sidebar_sticky_color' ] ); 631 $toc_background_color = esc_attr ( $instance[ 'toc_background_color' ] ); 632 $toc_title_background_color = esc_attr ( $instance[ 'toc_title_background_color' ] ); 617 633 ?> 618 634 <p> … … 700 716 <label for="<?php echo esc_attr($this->get_field_id( 'active_section_text_color' )); ?>" style="margin-right: 12px;"><?php esc_html_e ( 'Active Section Text Color:', 'easy-table-of-contents' ); ?></label><br> 701 717 <input type="text" name="<?php echo esc_attr($this->get_field_name( 'active_section_text_color' )); ?>" class="color-picker" id="<?php echo esc_attr($this->get_field_id( 'active_section_text_color' )); ?>" value="<?php echo esc_attr($active_section_text_color); ?>" data-default-color="<?php echo esc_attr($defaults[ 'active_section_text_color' ]); ?>" /> 718 </p> 719 720 <p class="ez-toc-widget-form-group" style="margin: 0;margin-top: 7px;"> 721 <label for="<?php echo esc_attr($this->get_field_id( 'toc_background_color' )); ?>" style="margin-right: 12px;"><?php esc_html_e ( 'TOC Background Color:', 'easy-table-of-contents' ); ?></label><br> 722 <input type="text" name="<?php echo esc_attr($this->get_field_name( 'toc_background_color' )); ?>" class="color-picker" id="<?php echo esc_attr($this->get_field_id( 'toc_background_color' )); ?>" value="<?php echo esc_attr($toc_background_color); ?>" data-default-color="<?php echo esc_attr($defaults[ 'toc_background_color' ]); ?>" /> 723 </p> 724 725 <p class="ez-toc-widget-form-group" style="margin: 0;margin-top: 7px;"> 726 <label for="<?php echo esc_attr($this->get_field_id( 'toc_title_background_color' )); ?>" style="margin-right: 12px;"><?php esc_html_e ( 'TOC Title Background Color:', 'easy-table-of-contents' ); ?></label><br> 727 <input type="text" name="<?php echo esc_attr($this->get_field_name( 'toc_title_background_color' )); ?>" class="color-picker" id="<?php echo esc_attr($this->get_field_id( 'toc_title_background_color' )); ?>" value="<?php echo esc_attr($toc_title_background_color); ?>" data-default-color="<?php echo esc_attr($defaults[ 'toc_title_background_color' ]); ?>" /> 702 728 </p> 703 729
Note: See TracChangeset
for help on using the changeset viewer.