protected function create_post(array $record)
 {
     $organizer = $this->build_organizer_array($record);
     $id = TribeEventsAPI::createOrganizer($organizer);
     TribeEventsAPI::updateOrganizer($id, $organizer);
     return $id;
 }
 /**
  * Saves the event organizer information passed via an event
  */
 private static function saveEventOrganizer($data, $post = null, $post_status = 'publish')
 {
     if (isset($data['OrganizerID']) && $data['OrganizerID'] > 0) {
         if (count($data) == 1) {
             // Only an ID was passed and we should do nothing.
             return $data['OrganizerID'];
         } else {
             return TribeEventsAPI::updateOrganizer($data['OrganizerID'], $data);
         }
     } else {
         return TribeEventsAPI::createOrganizer($data, $post_status);
     }
 }
示例#3
0
 /**
  * Create an Organizer
  *
  * $args accepts all the args that can be passed to wp_insert_post(). 
  * In addition to that, the following args can be passed specifically 
  * for the process of creating an Organizer:
  *
  * - Organizer string - Title of the Organizer. (required)
  * - Email string - Email address of the Organizer.
  * - Website string - URL of the Organizer.
  * - Phone string - Phone number for the Organizer.
  *
  * @param array $args Elements that make up post to insert.
  * @return int ID of the Organizer that was created. False if insert failed.
  * @link http://codex.wordpress.org/Function_Reference/wp_insert_post
  * @see wp_insert_post()
  * @category Organizer Functions
  * @since 2.0.1
  */
 function tribe_create_organizer($args)
 {
     $postId = TribeEventsAPI::createOrganizer($args);
     return $postId;
 }