protected function update_post($post_id, array $record) { $venue = $this->build_venue_array($post_id, $record); Tribe__Events__API::updateVenue($post_id, $venue); if ($this->is_aggregator && !empty($this->aggregator_record)) { $this->aggregator_record->meta['activity']->add('venue', 'updated', $post_id); } }
/** * Make sure the venue meta gets saved * * @param int $postID The venue id. * @param WP_Post $post The post object. * * @return null|void */ public function save_venue_data($postID = null, $post = null) { // was a venue submitted from the single venue post editor? if (empty($_POST['post_ID']) || $_POST['post_ID'] != $postID || empty($_POST['venue'])) { return; } // is the current user allowed to edit this venue? if (!current_user_can('edit_tribe_venue', $postID)) { return; } $data = stripslashes_deep($_POST['venue']); Tribe__Events__API::updateVenue($postID, $data); }
protected function update_post($post_id, array $record) { $venue = $this->build_venue_array($record); Tribe__Events__API::updateVenue($post_id, $venue); }
/** * Saves the event venue information passed via an event * * @param array $data The venue data. * @param WP_Post $post The venue object. * @param string $post_status The intended post status. * * @return mixed. */ private static function saveEventVenue($data, $post = null, $post_status = 'publish') { if (isset($data['VenueID']) && $data['VenueID'] > 0) { if (count($data) == 1) { // Only an ID was passed and we should do nothing. return $data['VenueID']; } else { $show_map = get_post_meta($data['VenueID'], '_VenueShowMap', true); $show_map_link = get_post_meta($data['VenueID'], '_VenueShowMapLink', true); $data['ShowMap'] = $show_map ? $show_map : 'false'; $data['ShowMapLink'] = $show_map_link ? $show_map_link : 'false'; Tribe__Events__API::updateVenue($data['VenueID'], $data); return $data['VenueID']; } } else { // Remove a zero-value venue ID, if set, before creating the new venue if (isset($data['VenueID']) && 0 == $data['VenueID']) { unset($data['VenueID']); } return Tribe__Events__API::createVenue($data, $post_status); } }
/** * Update a Venue * * @param int $postId ID of the Venue to be modified. * @param array $args Args for updating the post. See {@link tribe_create_venue()} for more info. * * @return int ID of the Venue that was created. False if update failed. * @link http://codex.wordpress.org/Function_Reference/wp_update_post * @see wp_update_post() * @see tribe_create_venue() * @category Venues */ function tribe_update_venue($postId, $args) { $postId = Tribe__Events__API::updateVenue($postId, $args); return $postId; }