tribe_events_week_event_attributes( int|object $event = null, string $format = 'string' )

Return html attributes required for proper week view js functionality.


Parameters #

$event

(int|object) (Optional) The event post, defaults to the global post.

Default value: null

$format

(string) (Optional) The format of the returned value. Can be either 'array' or 'string'

Default value: 'string'


Top ↑

Return #

(array|string)


Top ↑

Source #

File: src/functions/template-tags/week.php

	function tribe_events_week_event_attributes( $event = null, $format = 'string' ) {

		$attrs = Tribe__Events__Pro__Templates__Week::get_event_attributes( $event );

		$attrs = apply_filters( 'tribe_events_week_event_attributes', $attrs );

		if ( $format == 'array' ) {
			$return = $attrs;
		} elseif ( $format == 'string' ) {
			$return = '';
			foreach ( $attrs as $attr => $value ) {
				$return .= " $attr=" . '"' . esc_attr( $value ) . '"';
		}
	}

		return $return;

	}