/** * displays the saved organizer dropdown in the event metabox * Used to be a PRO only feature, but as of 3.0, it is part of Core. * */ public function render_dropdowns() { $post_id = $this->event->ID; $current_organizers = get_post_meta($post_id, '_EventOrganizerID', false); if ($this->use_default_organizer($current_organizers)) { $current_organizers = array($this->tribe->defaults()->organizer_id()); } $current_organizers = (array) apply_filters('tribe_display_event_organizer_dropdown_id', $current_organizers); /* if the user can't create organizers, then remove any empty values from the $current_organizers array. This prevents the automatic selection of an organizer every time the event is edited. */ $organizer_pto = get_post_type_object(Tribe__Events__Main::ORGANIZER_POST_TYPE); if (!current_user_can($organizer_pto->cap->create_posts)) { $current_organizers = array_filter($current_organizers); } ?> <script type="text/template" id="tmpl-tribe-select-organizer"><?php $this->single_organizer_dropdown(0); ?> </script><?php foreach ($current_organizers as $organizer_id) { echo '<tbody>'; $this->single_organizer_dropdown($organizer_id); echo '</tbody>'; } }
/** * displays the saved organizer dropdown in the event metabox * Used to be a PRO only feature, but as of 3.0, it is part of Core. * * @return void */ public function render_dropdowns() { $postId = $this->event->ID; $current_organizers = get_post_meta($postId, '_EventOrganizerID', false); if ($this->use_default_organizer($current_organizers)) { $current_organizers = array($this->tribe->defaults()->organizer_id()); } $current_organizers = (array) apply_filters('tribe_display_event_organizer_dropdown_id', $current_organizers); ?> <script type="text/template" id="tmpl-tribe-select-organizer"><?php $this->single_organizer_dropdown(0); ?> </script><?php foreach ($current_organizers as $organizer_id) { echo '<tbody>'; $this->single_organizer_dropdown($organizer_id); echo '</tbody>'; } }