Filters whether a post type is considered "viewable".
Description
The returned filtered value must be a boolean type to ensure is_post_type_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 type is "viewable" (strict type).
2436*2437* @since 5.9.02438*2439* @param bool$is_viewable Whether the post type is "viewable"(strict type).2440* @param WP_Post_Type$post_type Post type object.2441*/2442returntrue===apply_filters('is_post_type_viewable',$is_viewable,$post_type);2443}24442445/**2446* Determines whether a post status is considered "viewable".2447*2448*For built-in post statuses such as publish andprivate, the 'public' value will be evaluated.
History
Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.