Hooks::filter_body_class( array $classes )

Filters the body classes to add theme compatibility ones.


Parameters #

$classes

(array) (Required) Classes that are been passed to the body.


Top ↑

Return #

(array) $classes


Top ↑

Source #

File: src/Tribe/Views/V2/Hooks.php

	public function filter_body_class( $classes ) {
		$layout       = tribe( Filters::class )->get_layout_setting();
		$live_refresh = tribe_get_option( 'liveFiltersUpdate', true );

		if ( ! empty( $live_refresh ) ) {
			$classes[] = 'tribe-filters-live-update';
		}

		if ( 'vertical' === $layout ) {
			$classes[] = 'tribe-filters-open';

			// See if we have the closed class
			$key = array_search( 'tribe-filters-closed', $classes );

			// Remove it from the array
			if ( ! empty( $key ) ) {
				unset( $classes[ $key ] );
			}
		}

		return $classes;
	}

Top ↑

Changelog #

Changelog
Version Description
4.9.0 Introduced.