我有以下代码使用wp_insert_post函数在wp_posts表中插入帖子:
我在这个名为" Property"的CPT中使用Polylang,帖子必须设置为两种语言:西班牙语和英语。插入部分就像一个魅力,但我不知道如何处理更新过程(wp_update_post)。
答案 0 :(得分:0)
https://codex.wordpress.org/Function_Reference/wp_update_post
你没有在循环的第一部分传递id:
if ( ! $propid ) {
$post_args = array(
//NEED ID TO UPDATE WITH WP_UPDATE_POST
'post_title' => $property['MLSNumber'],