Replies: 0
Hi,
I would like to update the post status of Flamingo posts to private so I can more securely use them with WordPress’s REST API. I have tried to do so with wp_transition_post_status
but this does not seem to make a difference? Please assist.
function flamingo_inbound_status($post) {
$post_type = get_post_type ($post);
$old_status = $post->post_status;
if ($post_type == 'flamingo_inbound') {
$old_status = $post->post_status;
wp_transition_post_status('private', $old_status, $post);
}
}
add_action( 'transition_post_status', 'flamingo_inbound_status', 10);
Many thanks,
Costa