diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 91edacf76f..cf72a892a4 100644
a
|
b
|
function is_post_type_viewable( $post_type ) { |
2130 | 2130 | * For all others, the 'publicly_queryable' value will be used. |
2131 | 2131 | * |
2132 | 2132 | * @since 5.7.0 |
| 2133 | * @since 5.9.0 Added `is_post_status_viewable` hook to filter the result. |
2133 | 2134 | * |
2134 | 2135 | * @param string|stdClass $post_status Post status name or object. |
2135 | 2136 | * @return bool Whether the post status should be considered viewable. |
… |
… |
function is_post_status_viewable( $post_status ) { |
2150 | 2151 | return false; |
2151 | 2152 | } |
2152 | 2153 | |
2153 | | return $post_status->publicly_queryable || ( $post_status->_builtin && $post_status->public ); |
| 2154 | $is_viewable = $post_status->publicly_queryable || ( $post_status->_builtin && $post_status->public ); |
| 2155 | |
| 2156 | /** |
| 2157 | * Filters whether a post status is considered "viewable". |
| 2158 | * |
| 2159 | * @since 5.9.0 |
| 2160 | * |
| 2161 | * @param bool $is_viewable Whether the post status is "viewable". |
| 2162 | * @param stdClass $post_status Post status object. |
| 2163 | */ |
| 2164 | return true === apply_filters( 'is_post_status_viewable', $is_viewable, $post_status ); |
2154 | 2165 | } |
2155 | 2166 | |
2156 | 2167 | /** |