/** * 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. * * @param int $post_id the event ID for which to create the dropdown * */ public function displayEventOrganizerDropdown($post_id) { $current_organizer = get_post_meta($post_id, '_EventOrganizerID', true); if ((!$post_id || get_post_status($post_id) === 'auto-draft') && !$current_organizer && tribe_is_community_edit_event_page()) { $current_organizer = $this->defaults()->organizer_id(); } $current_organizer = apply_filters('tribe_display_event_organizer_dropdown_id', $current_organizer); ?> <tr class=""> <td style="width:170px"> <label for="saved_organizer"><?php printf(esc_html__('Use Saved %s:', 'the-events-calendar'), $this->singular_organizer_label); ?> </label> </td> <td><?php $this->saved_organizers_dropdown($current_organizer); ?> <div class="edit-organizer-link"<?php if (empty($current_organizer)) { ?> style="display:none;"<?php } ?> ><a data-admin-url="<?php echo esc_url(admin_url('post.php?action=edit&post=')); ?> " href="<?php echo esc_url(admin_url(sprintf('post.php?action=edit&post=%s', $current_organizer))); ?> " target="_blank"><?php echo esc_html(sprintf(__('Edit %s', 'the-events-calendar'), $this->singular_organizer_label)); ?> </a></div></td> </tr> <?php }
/** * Set the body classes. * * @param array $classes The current array of body classes. * @return array The body classes to add. * @since 1.0.1 * @author Paul Hughes */ public function setBodyClasses($classes) { if (tribe_is_community_my_events_page()) { $classes[] = 'tribe_community_list'; } if (tribe_is_community_edit_event_page()) { $classes[] = 'tribe_community_edit'; } return $classes; }