cliff
6/23/2016 - 12:44 PM

Allow multiple Venues per single Event on wp-admin edit screen (no effect on Community Events form)

Allow multiple Venues per single Event on wp-admin edit screen (no effect on Community Events form)

<?php

/* Allow multiple Venues per single Event
 * on wp-admin edit screen (no effect on Community Events form)
 * 
 * https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/4214149-one-event-with-multiple-venues
 * 
 * !!! Code not thoroughly tested!!!
 * 
 * Note that this doesn't make the necessary additions to the single or archive display templates
 */

function multiple_venue_support( $args, $type ) {
	if ( ! class_exists( 'Tribe__Events__Venue' ) ) {
		return;
	}
	
    if ( Tribe__Events__Venue::POSTTYPE !== $type ) {
	    return $args;
	} else {
	    $args[ 'allow_multiple' ] = true;
    }
    
    return $args;
}

add_filter( 'tribe_events_linked_post_type_args', 'multiple_venue_support', 20, 2 );