Tribe__Events__Pro__Shortcodes__Register::body_classes_should_add( boolean $add, array $add_classes, array $existing_classes, string $queue )

Hook into filter and add our logic for adding body classes.

Parameters #


(boolean) (Required) Whether to add classes or not.


(array) (Required) The array of body class names to add.


(array) (Required) An array of existing body class names from WP.


(string) (Required) The queue we want to get 'admin', 'display', 'all'.

Top ↑

Return #

(boolean) Whether body classes should be added or not.

Top ↑

Source #

File: src/Tribe/Shortcodes/Register.php

	public function body_classes_should_add( $add, $add_classes, $existing_classes, $queue ) {
		global $post;

		// If we're doing the tribe_events shortcode, add classes.
		if (
			&& $post instanceof \WP_Post
		) {
			foreach ( $this->shortcodes as $shortcode ) {
				if ( has_shortcode( $post->post_content, $shortcode ) ) {
					return true;

		return $add;

Top ↑

Changelog #

Version Description
TBD Introduced.