通过使用wp_update_post()
, 可在wp includes/post中找到。php:
// Update post 42
$post = array();
$post[\'ID\'] = 42;
$post[\'post_category\'] = array( ... );
$post[\'post_content\' ] = \'This is the updated content.\';
$post[\'post_title\' ] = \'This is the updated title.\';
// Update the post into the database
wp_update_post( $post );