f ( 'display' !== $queue ) { $this->admin_classes[ $class ] = true ; } } } /** * Add an array of classes to the queue. * * @since 4.12.6 * * @param array $class The classes to add. * @return void */ public function add_classes( array $classes, $queue = 'display' ) { foreach ( $classes as $key => $value ) { // If the classes are passed as class => bool, only add ones set to true. if ( is_bool( $value ) && false !== $value ) { $this->add_class( $key, $queue ); } else { $this->add_class( $value, $queue ); } } } /** * Remove a single class from the queue. * * @since 4.12.6 * * @param string $class The class to remove. * @return void */ public function remove_class( $class, $queue = 'display' ) { if ( 'admin' !== $queue ) { $this->classes = array_filter( $this->classes, static function( $k ) use ( $class ) { return $k !== $class; }, ARRAY_FILTER_USE_KEY ); } if ( 'display' !== $queue ) { $this->admin_classes = array_filter( $this->admin_classes, static function( $k ) use ( $class ) { return $k !== $class; }, ARRAY_FILTER_USE_KEY ); } } /** * Remove an array of classes from the queue. * * @since 4.12.6 * * @param array $classes The classes to remove. * @return void */ public function remove_classes( array $classes, $queue = 'display' ) { if ( empty( $classes ) || ! is_array( $classes) ) { return; } foreach ( $classes as $class ) { $this->remove_class( $class, $queue ); } } /** * Adds the enqueued classes to the body class array. * * @since 4.12.6 * * @param array $classes An array of body class names. * @return array Array of body classes. */ public function add_body_classes( $classes = [] ) { // Make sure they should be added. if( ! $this->should_add_body_classes( $this->get_class_names(), (array) $classes, 'display' ) ) { return $classes; } $element_classes = new Element_Classes( $this->get_class_names() ); return array_merge( $classes, $element_classes->get_classes() ); } /** * Adds the enqueued classes to the body class array. * * @since 4.12.6 * * @param string $classes The existing body class names. * * @return string String of admin body classes. */ public function add_admin_body_classes( $classes ) { $existing_classes = explode( ' ', $classes ); // Make sure they should be added. if ( ! $this->should_add_body_classes( $this->get_class_names( 'admin' ), (array) $existing_classes, 'admin' ) ) { // Ensure we return the current string on false! return $classes; } $element_classes = new Element_Classes( $this->get_class_names( 'admin' ) ); return implode( ' ', array_merge( $existing_classes, $element_classes->get_classes() ) ); } /** * Should a individual class be added to the queue. * * @since 4.12.6 * * @param string $class The body class we wish to add. * * @return boolean Whether to add tribe body classes to the queue. */ private function should_add_body_class_to_queue( $class, $queue = 'display' ) { /** * Filter whether to add the body class to the queue or not. * * @since 4.12.6 * * @param boolean $add Whether to add the class to the queue or not. * @param array $class The array of body class names to add. * @param string $queue The queue we want to get 'admin', 'display', 'all'. */ return (bool) apply_filters( 'tribe_body_class_should_add_to_queue', false, $class, $queue ); } /** * Logic for whether the body classes, as a whole, should be added. * * @since 4.12.6 * * @param array $add_classes An array of body class names to add. * @param array $existing_classes An array of existing body class names from WP. * @param string $queue The queue we want to get 'admin', 'display', 'all'. * * @return boolean Whether to add tribe body classes. */ private function should_add_body_classes( array $add_classes, array $existing_classes, $queue ) { /** * Filter whether to add tribe body classes or not. * * @since 4.12.6 * * @param boolean $add Whether to add classes or not. * @param string $queue The queue we want to get 'admin', 'display', 'all'. * @param array $add_classes The array of body class names to add. * @param array $existing_classes An array of existing body class names from WP. * */ return (bool)apply_filters( 'tribe_body_classes_should_add', false, $queue, $add_classes, $existing_classes ); } }
Fatal error: Uncaught Error: Call to a member function add_classes() on string in /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Theme_Compatibility.php:95 Stack trace: #0 /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Hooks.php(444): Tribe\Events\Views\V2\Theme_Compatibility->add_body_classes() #1 /htdocs/wp-includes/class-wp-hook.php(324): Tribe\Events\Views\V2\Hooks->add_body_classes(Object(WP_Query)) #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #4 /htdocs/wp-includes/class-wp-query.php(1140): do_action_ref_array('parse_query', Array) #5 /htdocs/wp-includes/class-wp-query.php(1868): WP_Query->parse_query() #6 /htdocs/wp-includes/class-wp-query.php(3824): WP_Query->get_posts() #7 /htdocs/wp-includes/post.php(2452): WP_Query->query(Array) #8 /htdocs/wp-content/plugins/wp-gdpr-compliance/Integrations/Plugins/ContactForm.php(174): get_posts(Array) #9 /htdocs/wp-content/plugins/wp-gdpr-compliance/Integrations/Plugins/AbstractPlugin.php(46): WPGDPRC\Integrations\Plugins\ContactForm->getList() #10 /htdocs/wp-includes/class-wp-hook.php(324): WPGDPRC\Integrations\Plugins\AbstractPlugin->setupValues('') #11 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #12 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #13 /htdocs/wp-settings.php(643): do_action('init') #14 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #15 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #16 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #17 /htdocs/index.php(17): require('/htdocs/wp-blog...') #18 {main} thrown in /htdocs/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Theme_Compatibility.php on line 95