0

I have the following code to insert posts in wp_posts table using wp_insert_post function:

http://pasted.co/c3fcb315

I'm using Polylang for this CPT called "Property", posts must be set in two languages: Spanish and English. The insert part is working like a charm but I don't know how to deal with the update process (wp_update_post).

4

1 回答 1

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'],
于 2017-12-15T18:23:18.607 回答