cliff
2/7/2017 - 11:04 PM

The Events Calendar - Move Customizer CSS output to <head> instead of body footer

The Events Calendar - Move Customizer CSS output to instead of body footer

<?php

/**
 * The Events Calendar - Move Customizer CSS output to <head> instead of body footer
 * re: https://central.tri.be/issues/42754
 * 
 * From: https://gist.github.com/cliffordp/13c7a2e3f91158d5c9d0fca075b121fb
 *
 * Related to this alternative: https://gist.github.com/cliffordp/d70d30c6278ffab2ad1db579dd421421
 **/
function cliff_move_tec_customizer_style_output_to_head() {
	if ( class_exists( 'Tribe__Customizer' ) ) {
		remove_action( 'wp_print_footer_scripts', array( Tribe__Customizer::instance(), 'print_css_template' ), 15 );
		add_action( 'wp_head', array( Tribe__Customizer::instance(), 'print_css_template' ), 15 );
	}
}
add_action( 'init', 'cliff_move_tec_customizer_style_output_to_head' );