<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>Remove/Control “print_inline_styles”

[ad_1]

Replies: 1

Hi, I am trying to remove the print_inline_styles() function from my website (line 231 in /src/php/main.php).

I’ve added the following to my functions.php and nothing seems to work:

add_action( 'wp_loaded', 'my_plugin_override' );

function my_plugin_override() {
  remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ) );
	remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ), 99 );
	remove_action( 'wp_head', 'print_inline_styles', 99 );
}

remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ) );
remove_action( 'wp_head', array( 'HCaptcha', 'print_inline_styles' ), 99 );
remove_action( 'wp_head', array( 'HCaptcha\Main', 'print_inline_styles' ) );
remove_action( 'wp_head', array( 'HCaptcha\Main', 'print_inline_styles' ), 99 );
remove_action( 'wp_head', 'print_inline_styles', 99 );

I only use it for the login and registration page, so outputting it on every single page is unnecessary.

Any guidance you can provide, would be greatly appreciated!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer