is_post_status_viewable WordPress Filter Hook
The is_post_status_viewable hook is used to filter the list of post statuses that are viewable by the current user. By default, only the "publish" and "private" statuses are viewable. This hook can be used to add or remove statuses from the list.
apply_filters( 'is_post_status_viewable', bool $is_viewable , stdClass $post_status ) #
Filters whether a post status is considered “viewable”.
Description
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.
Parameters
- $is_viewable
(bool)Whether the post status is "viewable" (strict type).
- $post_status
(stdClass)Post status object.
Source
File: wp-includes/post.php
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |