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