get_post_status
Filters the post status.
Usage
add_filter( 'get_post_status', 'wp_kama_get_post_status_filter', 10, 2 ); /** * Function for `get_post_status` filter-hook. * * @param string $post_status The post status. * @param WP_Post $post The post object. * * @return string */ function wp_kama_get_post_status_filter( $post_status, $post ){ // filter... return $post_status; }
- $post_status(string)
- The post status.
- $post(WP_Post)
- The post object.
Changelog
Since 4.4.0 | Introduced. |
Since 5.7.0 | The attachment post type is now passed through this filter. |
Where the hook is called
get_post_status
wp-includes/post.php 1199
return apply_filters( 'get_post_status', $post_status, $post );