Function to remove inline_customizer_css no longer working after X theme update

Hello, I was using the following function to remove the inline customizer css, which worked until the last X theme update. Do I have to do this a different way now?

add_action( 'after_setup_theme', 'remove_inline_customizer_css' );
function remove_inline_customizer_css() {
remove_action('wp_head','x_output_generated_styles', 9998);
}

Hi,

It’s still the same for the new version of X.

Try to clear your plugin cache, browser cache and system’s cache then check again.
If you are using CDN, clear CDN cache as well.

If that doesn’t help, please provide us your site url so we can take a closer look.

Thanks

Hi There,

I can confirm that code doesn’t work anymore.

Please try with this code instead:

add_action('x_before_head_css', 'x_before_head_css');
function x_before_head_css(){
	echo '<!--';
}

add_action('x_after_head_css', 'x_after_head_css');
function x_after_head_css(){
	echo '-->';
}

Let us know how it goes!

Thank you for your reply, this does work, but is there a way to prevent it from loading in the first place?

Hi @benragsdale

I’ve tried to find another way to do that but unfortunately, I couldn’t. So I believe the suggestion mentioned by @thai should work as a treat for now.

Thanks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.