Created
August 22, 2014 18:05
-
-
Save nathanaelphilip/1170bc423deee0a057f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function put(){ | |
$title = $this->create_title($this->data); | |
// setup the 'post' data | |
$post = array( | |
'post_type' => 'listing', | |
'post_title' => $title, | |
'post_content' => $this->data['Remarks'], | |
'post_status' => 'publish' | |
); | |
$post_id = wp_insert_post( $post, true ); | |
// grab photos & put them into the database | |
// this is processor intensive – may need to use a cron job to set images | |
/* | |
if (!is_wp_error($post_id)) { | |
$this->grab_photos($post_id,$this->data['MST_MLS_NUMBER']); | |
}*/ | |
// add new meta data | |
if (!is_wp_error($post_id)) { | |
$this->add_meta_data($post_id); | |
$this->assign_community($post_id,$data); | |
} | |
// set the action | |
$action = 'inserted'; | |
return $action; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment