What could I put in my theme to tell if a post is in the trash or not?
<?php if (is_trash) echo 'This post is in the trash!' ?>
You could use get_post_status():
function is_trash( $post_id = 0 )
0 == $post_id and $post_id = get_the_ID();
return 'trash' === get_post_status( $post_id );
Side note: To get a list of all registered post status objects use get_post_stati() – yes, that's wrong.
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
3 years ago
2 years ago