wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



is_post_type_viewable › WordPress Filter Hooks

Da5.9.0
Deprecaton/a
› apply_filters( 'is_post_type_viewable', $is_viewable, $post_type )
Parametri: (2)
  • () is_viewable Whether the post type is "viewable" (strict type).
    Richiesto: Sì
  • () post_type Post type object.
    Richiesto: Sì
Definito a:
Codex:

Filters whether a post type is considered "viewable".

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.




Sorgenti

return true === apply_filters( 'is_post_type_viewable', $is_viewable, $post_type );