show_recent_comments_widget_style
云策文档标注
概述
show_recent_comments_widget_style 是一个 WordPress 过滤器钩子,用于控制 Recent Comments 默认小部件样式的显示。它允许开发者根据条件(如小部件是否激活)来启用或禁用样式输出。
关键要点
- 这是一个过滤器钩子,用于过滤 Recent Comments 小部件的默认样式。
- 接受两个参数:$active(布尔值,表示小部件是否激活,默认为 true)和 $id_base(字符串,表示小部件 ID)。
- 在 WP_Widget_Recent_Comments::recent_comments_style() 方法中使用,用于输出小部件的默认样式。
- 自 WordPress 3.1.0 版本引入。
原文内容
Filters the Recent Comments default widget styles.
Parameters
$activebool-
Whether the widget is active. Default true.
$id_basestring-
The widget ID.
Source
|| ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) {
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |