Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: is_post_type_viewable

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2264       * is by design to maintain backwards-compatibility and guard against
2265       * potential type errors in PHP 8.1+. Non-boolean values (even falsey
2266       * and truthy values) will result in the function returning false.
2267       *
2268       * @since 5.9.0
2269       *
2270       * @param bool         $is_viewable Whether the post type is "viewable" (strict type).
2271       * @param WP_Post_Type $post_type   Post type object.
2272       */
2273      return true === apply_filters( 'is_post_type_viewable', $is_viewable, $post_type );
2274 }
2275
2276 /**
2277  * Determines whether a post status is considered "viewable".
2278  *
2279  * For built-in post statuses such as publish and private, the 'public' value will be evaluated.
2280  * For all others, the 'publicly_queryable' value will be used.
2281  *
2282  * @since 5.7.0