On this page
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_viewablebool-
Whether the post status is "viewable" (strict type).
$post_statusstdClass-
Post status object.
Source
File: wp-includes/post.php. View all references
return true === apply_filters( 'is_post_status_viewable', $is_viewable, $post_status );
Related
Used By
| Used By | Description |
|---|---|
| is_post_status_viewable() wp-includes/post.php | Determines whether a post status is considered “viewable”. |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/is_post_status_viewable