Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Last active April 22, 2021 12:10
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 andrasguseo/be4ec0259c68ab3b1b6765b26efda568 to your computer and use it in GitHub Desktop.
Save andrasguseo/be4ec0259c68ab3b1b6765b26efda568 to your computer and use it in GitHub Desktop.
<?php
/**
* Skeleton code for modifying imported event content
*/
add_action( 'tribe_aggregator_before_insert_posts', 'add_wp_content_filter' );
function add_wp_content_filter() {
add_filter( 'wp_insert_post_data', 'filter_post_data' );
}
function filter_post_data( $data ) {
// Do stuff here
// Return data
return $data;
}
add_action( 'tribe_aggregator_after_insert_posts', 'remove_ea_filters' );
function remove_ea_filters() {
remove_action( 'tribe_aggregator_before_insert_posts', 'add_wp_content_filter' );
remove_action( 'tribe_aggregator_after_insert_posts', 'remove_ea_filters' );
remove_filter( 'wp_insert_post_data', 'filter_post_data' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment