Tribe__Tickets__Theme_Compatibility::get_body_classes()

Fetches the correct class strings for theme and child theme if available.


Return

(array) $classes List of body classes with parent and child theme classes included.


Top ↑

Source

File: src/Tribe/Theme_Compatibility.php

	public function get_body_classes() {
		$classes      = [];
		$child_theme  = strtolower( get_stylesheet() );
		$parent_theme = strtolower( get_template() );

		// Prevents empty stylesheet or template
		if ( empty( $parent_theme ) || empty( $child_theme ) ) {
			return $classes;
		}

		$classes[] = sanitize_html_class( "tribe-theme-$parent_theme" );

		// if the 2 options are the same, then there is no child theme.
		if ( $child_theme !== $parent_theme ) {
			$classes[] = sanitize_html_class( "tribe-theme-parent-$parent_theme" );
			$classes[] = sanitize_html_class( "tribe-theme-child-$child_theme" );
		}

		return $classes;
	}

Top ↑

Changelog

Changelog
Version Description
4.11.4 Introduced.