Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active September 24, 2020 15:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/ccd49235d1a8873cca53398fcb67a00c to your computer and use it in GitHub Desktop.
Save cliffordp/ccd49235d1a8873cca53398fcb67a00c to your computer and use it in GitHub Desktop.
Events Calendar PRO: Remove PRO Additional Fields from displaying on Single Events page.
<?php
/**
* Events Calendar PRO: Remove PRO Additional Fields from displaying on Single
* Events page.
*
* Because the template for Additional Fields is loaded via anonymous class (no
* instance to reference), we still load the template for it, but we cause the
* output to be blank.
*
* @link https://gist.github.com/cliffordp/ccd49235d1a8873cca53398fcb67a00c This snippet.
* @link https://theeventscalendar.com/support/forums/topic/output-of-do_action-tribe_events_single_event_meta_primary_section_end/ Help Desk request.
*/
function cliff_remove_pro_addl_fields_from_single_event_pages( $html, $template, $file, $slug, $name ) {
if (
is_singular( Tribe__Events__Main::POSTTYPE )
&& 'pro/modules/meta/additional-fields' === $slug
) {
$html = '';
}
return $html;
}
add_action( 'tribe_get_template_part_content', 'cliff_remove_pro_addl_fields_from_single_event_pages', 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment