wpseek.com
WordPress开发者和主题制作者的搜索引擎



is_post_status_viewable › WordPress过滤钩子

Since5.9.0
已弃用n/a
› apply_filters( 'is_post_status_viewable', $is_viewable, $post_status )
参数: (2)
  • () is_viewable Whether the post status is "viewable" (strict type).
    Required: Yes
  • () post_status Post status object.
    Required: Yes
定义在:
文档:

Filters whether a post status is considered "viewable".

The returned filtered value must be a boolean type to ensure `is_post_status_viewable()` only returns a boolean. This strictness is by design to maintain backwards-compatibility and guard against potential type errors in PHP 8.1+. Non-boolean values (even falsey and truthy values) will result in the function returning false.




源码

return true === apply_filters( 'is_post_status_viewable', $is_viewable, $post_status );