Post Via Email to a Custom Post Type

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.

Related posts

Leave a Reply

1 comment

  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.