Tribe__Events__Main::OrganizerMetaBox()
Adds a organizer chooser to the write post page
Source
File: src/Tribe/Main.php
public function OrganizerMetaBox() {
global $post;
$options = '';
$style = '';
$postId = $post->ID;
$saved = false;
if ( $post->post_type == Tribe__Events__Organizer::POSTTYPE ) {
if ( ( is_admin() && isset( $_GET['post'] ) && $_GET['post'] ) || ( ! is_admin() && isset( $postId ) ) ) {
$saved = true;
}
if ( $postId ) {
if ( $saved ) { //if there is a post AND the post has been saved at least once.
$organizer_title = apply_filters( 'the_title', $post->post_title, $post->ID );
}
foreach ( $this->organizerTags as $tag ) {
if ( metadata_exists( 'post', $postId, $tag ) ) {
$$tag = get_post_meta( $postId, $tag, true );
}
}
}
}
?>
<style type="text/css">
#EventInfo {
border: none;
}
</style>
<div id='eventDetails' class="inside eventForm">
<table cellspacing="0" cellpadding="0" id="EventInfo" class="OrganizerInfo">
<?php
$hide_organizer_title = true;
$organizer_meta_box_template = apply_filters( 'tribe_events_organizer_meta_box_template', $this->plugin_path . 'src/admin-views/organizer-meta-box.php' );
if ( ! empty( $organizer_meta_box_template ) ) {
include( $organizer_meta_box_template );
}
?>
</table>
</div>
<?php
}