Tribe__Events__Community__Submission_Handler::get_field_label( $field )

Topics


Source #

File: src/Tribe/Submission_Handler.php

	public function get_field_label( $field ) {
		$events_label_singular = tribe_get_event_label_singular();

		switch ( $field ) {
			case 'post_title':
				$label = sprintf( __( '%s Title', 'tribe-events-community' ), $events_label_singular );
				break;
			case 'post_content':
				$label = sprintf( __( '%s Description', 'tribe-events-community' ), $events_label_singular );
				break;
			case 'venue':
				$label = tribe_get_venue_label_singular();
				break;
			case 'organizer':
				$label = tribe_get_organizer_label_singular();
				break;
			case 'tax_input.tribe_events_cat':
				$label = sprintf( _x( '%s Category', 'field label for event categories', 'tribe-events-community' ), tribe_get_event_label_singular() );
				break;
			case 'tax_input.post_tag':
				$label = _x( 'Tag', 'field label for post tags', 'tribe-events-community' );
				break;
			case 'terms':
				$label = _x( 'Terms of submission', 'field label for terms of submission', 'tribe-events-community' );
				break;
			default:
				if ( strpos( $field, '_ecp_custom_' ) === 0 ) {
					$label = $this->get_custom_field_label( $field );
				} else {
					$label = $this->format_field_name_as_label( $field );
				}
				break;
		}
		return apply_filters( 'tribe_community_form_field_label', $label, $field );
	}