Tribe__Customizer::inline_style()

Print the CSS for the customizer using wp_add_inline_style


Return #

(void)


Top ↑

Source #

File: src/Tribe/Customizer.php

	public function inline_style() {

		//Only load on front end
		if ( is_customize_preview() || is_admin() || $this->inline_style ) {
			return false;
		}

		/**
		 * Use this filter to add more CSS, using Underscore Template style
		 *
		 * @since 4.4
		 *
		 * @link  http://underscorejs.org/#template
		 *
		 * @param string $template
		 */
		$css_template = trim( apply_filters( 'tribe_customizer_css_template', '' ) );

		// If we don't have anything on the customizer don't print empty styles
		if ( empty( $css_template ) ) {
			return false;
		}

		// add customizer styles inline with either main stylesheet is enqueued or widgets
		if ( wp_style_is( 'tribe-events-calendar-style' ) ) {

			wp_add_inline_style( 'tribe-events-calendar-style', wp_strip_all_tags( $this->parse_css_template( $css_template ) ) );
			$this->inline_style = true;

			return;
		}

		if ( wp_style_is( 'tribe-events-calendar-pro-style' ) ) {

			wp_add_inline_style( 'tribe-events-calendar-pro-style', wp_strip_all_tags( $this->parse_css_template( $css_template ) ) );
			$this->inline_style = true;

			return;
		}

		if ( wp_style_is( 'widget-calendar-pro-style' ) ) {

			wp_add_inline_style( 'widget-calendar-pro-style', wp_strip_all_tags( $this->parse_css_template( $css_template ) ) );
			$this->inline_style = true;

			return;
		}
	}