How to remove_action for ‘add_cookie_script’
-
Hi,
I need to
remove_actionfor followingadd_action:add_action( 'wp_print_footer_scripts', array( $this, 'add_cookie_script' ) );added from Polylang plugin in:
wp-content > plugins > polylang > modules > plugins > cache-compat.phpThen I need to re-add the action hooking it to
wp_head.Like this:
add_action( 'wp_head', array( $this, 'add_cookie_script' ) );I tried in
functions.phpwith:add_action( 'init', function() { if ( PLL_COOKIE ) { remove_action( 'wp_print_footer_scripts', array( PLL(), 'add_cookie_script' ) ); add_action( 'wp_head', array( PLL(), 'add_cookie_script' ) ); } } );Unfortunately with no luck. How can I achieve this?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘How to remove_action for ‘add_cookie_script’’ is closed to new replies.