I have a scenario where we would like to post to our blog via email. However, it needs to be to a custom post type. I’ve done a bit of research but haven’t found any examples or ideas on how to do this.

Any help would be appreciated.

1 Answer
1

When a post is submitted by email and published WordPress Runs an action hook named 'publish_phone' so you can get the post there and change its type like this:

add_action('publish_phone','custom_type_by_mail');
function custom_type_by_mail($post_id){
    $p = get_post($post_id,'ARRAY_A');
    $p['post_type'] = "YOUR_CUSTOM_TYPE_NAME_HERE";
    wp_update_post($p);
}

Probably not the smartest way but it does work and its simple.

Leave a Reply

Your email address will not be published. Required fields are marked *