/** * 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 $postId the event ID for which to create the dropdown * @return void */ public function displayEventOrganizerDropdown($postId) { $curOrg = get_post_meta($postId, '_EventOrganizerID', true); // override pro default with community on add page if (!$curOrg && class_exists('TribeCommunityEvents')) { if (TribeCommunityEvents::instance()->isEditPage) { $curOrg = TribeCommunityEvents::getOption('defaultCommunityOrganizerID'); } } $defaultsEnabled = class_exists('TribeEventsPro') ? tribe_get_option('defaultValueReplace') : false; if ((!$postId || get_post_status($postId) == 'auto-draft') && !$curOrg && $defaultsEnabled && (is_admin() && get_current_screen()->action == 'add' || !is_admin())) { $curOrg = tribe_get_option('eventsDefaultOrganizerID'); } $curOrg = apply_filters('tribe_display_event_organizer_dropdown_id', $curOrg); ?> <tr class="" > <td style="width:170px"><?php _e('Use Saved Organizer:', 'tribe-events-calendar'); ?> </td> <td><?php $this->saved_organizers_dropdown($curOrg); ?> </td> </tr> <?php }
/** * displays the saved organizer dropdown in the event metabox * * @param int $postID the event ID for which to create the dropdown * @return void */ public function displayEventOrganizerDropdown($postId) { $curOrg = get_post_meta($postId, '_EventOrganizerID', true); // override pro default with community on add page if (!$curOrg && class_exists('TribeCommunityEvents')) { if (TribeCommunityEvents::instance()->isEditPage) { $curOrg = TribeCommunityEvents::getOption('defaultCommunityOrganizerID'); } } $defaultsEnabled = tribe_get_option('defaultValueReplace'); if (!$curOrg && $defaultsEnabled) { $curOrg = tribe_get_option('eventsDefaultOrganizerID'); } $curOrg = apply_filters('tribe_display_event_organizer_dropdown_id', $curOrg); ?> <tr class="" > <td style="width:170px"><?php _e('Use Saved Organizer:', 'tribe-events-calendar-pro'); ?> </td> <td><?php $this->saved_organizers_dropdown($curOrg); ?> </td> </tr> <?php }