How can I specify the post status of an untrashed post?
By default Wordpress assigns the draft
status to a post that has been untrashed. I would like to assign the pending
status to posts that are untrashed.
This seems to be possible with wp_untrash_post_status, but I can't seem to find the proper way to use it. I have this in my code :
add_action( 'untrash_post', 'my_function' );
function my_function( $post_id ) {
apply_filters( 'wp_untrash_post_status', 'pending', $post_id, 'pending' );
}
What am I doing wrong ?