我正在使用wp_insert_post 作用下面是该代码的外观:
$new_post = array(
            \'post_title\' => $newtitle,
            \'post_status\' => \'publish\',
            \'post_content\' => $repost[content],
            \'post_excerpt\' => $repost[excerpt],
            \'post_author\' => 1,
            \'post_type\' => \'post\',
            \'post_category\' => explode(",",$catlist),
         );
        wp_insert_post($new_post);
 这篇帖子写得很好,但我想启动一些其他功能,比如Jetpack的社交发帖工具(publication)是否有代码可以做到这一点,或者将post\\u状态更改为draft并设置未来的发布日期是否更好?
 
                    最合适的回答,由SO网友:Harish Chinju 整理而成
                    使用此代码段可以使用其他函数,
function my_function( $post_id ) {
    //Some code
}
add_action( \'save_post\', \'my_function\' );
 插入贴子时会触发此操作。