XMLRPCでCustom Post Typeに投稿

function redirect_xmlrpc_to_custom_post_type ($data, $postarr) {
    $p2_custom_post_type = 'custom_post_type' //Change this to the custom post type you are using for your blog
    if (defined('XMLRPC_REQUEST') || defined('APP_REQUEST')) {
        $data['post_type'] = $p2_custom_post_type;
        return $data;
    }
    return $data;
}
add_filter('wp_insert_post_data', 'redirect_xmlrpc_to_custom_post_type', 99, 2);

Leave a Reply