Last active
August 23, 2018 05:19
-
-
Save cliffordp/5cab6fd1782ece2e5e6415b2ff1660cc to your computer and use it in GitHub Desktop.
MT - TEC PRO - Hide display of a specific Additional Field on Event Single Page
This file contains 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 | |
/** | |
* MT - TEC PRO - Hide display of a specific Additional Field on Event Single Page | |
* | |
* from https://gist.github.com/cliffordp/5cab6fd1782ece2e5e6415b2ff1660cc | |
* for https://theeventscalendar.com/support/forums/topic/hiding-specific-additional-fields/ | |
* | |
* @return array | |
*/ | |
function cliff_tec_pro_do_not_display_specific_additional_field( $data ) { | |
// | |
// Customize this!!! | |
// | |
$field_name = 'Age'; | |
// avoid potential for odd error -- shouldn't happen | |
if ( ! is_array( $data ) ) { | |
return $data; | |
} | |
if ( array_key_exists( $field_name, $data ) ) { | |
unset( $data[$field_name] ); | |
} | |
return $data; | |
} | |
add_filter( 'tribe_get_custom_fields', 'cliff_tec_pro_do_not_display_specific_additional_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment