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).
2397*2398* @since 5.9.02399*2400* @param bool$is_viewable Whether the post type is "viewable"(strict type).2401* @param WP_Post_Type$post_type Post type object.2402*/2403returntrue===apply_filters('is_post_type_viewable',$is_viewable,$post_type);2404}24052406/**2407* Determines whether a post status is considered "viewable".2408*2409*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.