<?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 );