Skip to content

关于博主展示项开关失效 #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hausen1012 opened this issue May 7, 2025 · 3 comments
Open

关于博主展示项开关失效 #489

hausen1012 opened this issue May 7, 2025 · 3 comments
Labels
待确认问题 等待确认是否是已存在的问题

Comments

@hausen1012
Copy link
Contributor

  • 主题版本号:2.8.13
  • WordPress版本:
  • PHP版本:[选填]
  • 问题阐述:
    关于博主展示项开关失效,无论是否勾选都会全部显示
@hausen1012 hausen1012 added the 待确认问题 等待确认是否是已存在的问题 label May 7, 2025
@hailandao
Copy link

主题版本号:2.8.13
WordPress版本:6.5.5
PHP版本:7.4
同样存在此问题,

@hausen1012
Copy link
Contributor Author

主题版本号:2.8.13 WordPress版本:6.5.5 PHP版本:7.4 同样存在此问题,

修改 inc/fun/widget.php可以解决:

$show_views = $instance['show_views'] ?? 'on';
$show_comments = $instance['show_comments'] ?? 'on';
$show_posts = $instance['show_posts'] ?? 'on';
$show_users = $instance['show_users'] ?? 'on';

修改为:

$show_views = isset($instance['show_views']) && $instance['show_views'] === 'on';
$show_comments = isset($instance['show_comments']) && $instance['show_comments'] === 'on';
$show_posts = isset($instance['show_posts']) && $instance['show_posts'] === 'on';
$show_users = isset($instance['show_users']) && $instance['show_users'] === 'on';

@hailandao
Copy link

主题版本号:2.8.13 WordPress版本:6.5.5 PHP版本:7.4 同样存在此问题,

修改 inc/fun/widget.php可以解决:

$show_views = $instance['show_views'] ?? 'on';
$show_comments = $instance['show_comments'] ?? 'on';
$show_posts = $instance['show_posts'] ?? 'on';
$show_users = $instance['show_users'] ?? 'on';
修改为:

$show_views = isset($instance['show_views']) && $instance['show_views'] === 'on';
$show_comments = isset($instance['show_comments']) && $instance['show_comments'] === 'on';
$show_posts = isset($instance['show_posts']) && $instance['show_posts'] === 'on';
$show_users = isset($instance['show_users']) && $instance['show_users'] === 'on';

实测有效,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
待确认问题 等待确认是否是已存在的问题
Projects
None yet
Development

No branches or pull requests

2 participants