Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active March 30, 2018 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/f2045efa4b19b39d1b52db5d072b85a7 to your computer and use it in GitHub Desktop.
Save cliffordp/f2045efa4b19b39d1b52db5d072b85a7 to your computer and use it in GitHub Desktop.
The Events Calendar: Event Aggregator: Never import any Venues.
<?php
/**
* The Events Calendar: Event Aggregator: Never import any Venues.
*
* @see Tribe__Events__Aggregator__Record__Abstract::insert_posts()
*
* @link https://gist.github.com/cliffordp/f2045efa4b19b39d1b52db5d072b85a7
*/
function cliff_ea_do_not_import_venues( $items, $meta ) {
foreach ( $items as $item ) {
if ( ! empty( $item->venue ) ) {
unset( $item->venue );
}
}
return $items;
}
add_filter( 'tribe_aggregator_before_insert_posts', 'cliff_ea_do_not_import_venues', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment