Last active
September 24, 2020 15:56
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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