我一直在尝试更新posts表中的一个帖子,但出于某种原因,它创建了多次修订,但没有更新主帖子。在过去的一天里,我一直在努力想办法解决这个问题,但到目前为止,我的运气还不错。
$post_meta_value = get_post_meta($unit_post_id, $post_meta_key.\'_after_id\', true);
global $wpdb;
$my_post = array(
\'ID\' => $post_meta_value,
\'post_content\' => $meta_after_content,
\'post_title\' => $meta_after_title,
\'post_status\' => \'publish\'
);
wp_update_post($my_post);
// Update the post into the database
我已经看过了法典,但我对法典中提到的行为感到困惑http://codex.wordpress.org/Function_Reference/wp_update_post