Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( empty( $post_id ) ) {
- // this is a new post
- $post_data = array(
- 'post_author' => $this->post_author,
- 'post_content' => $content,
- 'post_type' => $this->post_type,
- 'post_status' => $this->post_status,
- 'post_title' => $title
- );
- $post_id = wp_insert_post($post_data);
- } else {
- // edit post
- $post_data = array(
- 'ID' => $post_id,
- 'post_author' => $this->post_author,
- 'post_content' => $content,
- 'post_type' => $this->post_type,
- 'post_status' => $this->post_status,
- 'post_title' => $title
- );
- $post_id = wp_update_post($post_data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement