Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active August 23, 2018 05:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/5cab6fd1782ece2e5e6415b2ff1660cc to your computer and use it in GitHub Desktop.
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
<?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