The WooCommerce plugin is inserting a script into the footer of my site. I have been attempting to remove this, but nothing seems to be working.
The following action is used to add the script to the footer:
add_action( 'wp_footer', 'wc_print_js', 25 );
I have tried removing this by placing the following in the child theme function file:
add_action( 'after_setup_theme', 'remove_wc_plugin_function', 0 );
function remove_wc_plugin_function() {
remove_action( 'wp_footer', 'wc_print_js' );
}
Have also tried just replacing the whole wc-core-functions.php file in my child theme, and commenting out the relevant functions, but that also doesnt work. I assume the function does not exist when the child theme function file is run. I then attempted to remove all jquery from the home page, which also doesnt get remove the script.
add_action( 'wp_enqueue_scripts', 'my_deregister_javascript' );
function my_deregister_javascript() {
if ( is_front_page('home') ) {
wp_deregister_script( 'jquery' );
}
}
Have also tried just replacing the whole wc-core-functions.php file in my child theme, and commenting out the relevant functions, but that also doesnt work. How can get I get rid of this bloody script in the footer (or preferably just get rid of a specific function)?
TLDR: How to remove a Wordpress plugin function, the script that was inserted with that function?