Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active May 2, 2019 15:20
Show Gist options
  • Save Pebblo/337d5f3cdc2180e0ae457ff8485a9573 to your computer and use it in GitHub Desktop.
Save Pebblo/337d5f3cdc2180e0ae457ff8485a9573 to your computer and use it in GitHub Desktop.
Example of how to remove the EE filters used to add additional content on archives, this function removes content on the EE category archives.
<?php //Please do not include the opening PHP tag if you already have one
function tw_ee_remove_details_from_taxonomy() {
if( is_tax( 'espresso_event_categories') ) {
add_filter ('the_content', 'tw_ee_remove_details_from_taxonomy_content', 100 );
}
}
add_action( 'template_redirect', 'tw_ee_remove_details_from_taxonomy' );
function tw_ee_remove_details_from_taxonomy_content( $content ) {
remove_filter(
'the_content',
array('EED_Events_Archive', 'event_venues'),
EED_Events_Archive::EVENT_VENUES_PRIORITY
);
remove_filter(
'the_content',
array('EED_Events_Archive', 'event_datetimes'),
EED_Events_Archive::EVENT_DATETIMES_PRIORITY
);
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment