diff --git a/inc/theme-widgets.php b/inc/theme-widgets.php index 482501c..34d1c3d 100644 --- a/inc/theme-widgets.php +++ b/inc/theme-widgets.php @@ -4,7 +4,7 @@ * 侧栏小工具 * @author Seaton Jiang * @license GPL-3.0 License - * @version 2022.11.27 + * @version 2023.01.14 */ // 添加小工具 @@ -38,7 +38,8 @@ function widgets_init() add_action('widgets_init', 'widgets_init'); // 关闭默认小工具 -function widget_unregister() { +function widget_unregister() +{ // fix #502 #521 // unregister_widget('WP_Widget_Block'); unregister_widget('WP_Widget_Pages'); @@ -610,8 +611,8 @@ class widget_toc extends WP_Widget for ($i = 0; $i <= $to_depth; $i++) { $index .= '' . "\n" . '' . "\n"; } - wp_cache_set(get_the_ID(), $index, 'toc', 360000); $index = '
' . "\n" . '
文章目录
' . "\n" . '
' . $index . '
' . "\n" . '
'; + wp_cache_set(get_the_ID(), $index, 'toc', 360000); } echo $index;