cliff
6/7/2017 - 5:27 AM

MT - TEC PRO - Hide display of a specific Additional Field on Event Single Page

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