Can't add_action to 'woo_foot' hook
-
I’ve been trying to enqueue a script file to my footer and it was working fine when I was using the hook
wp_enqueue_scripts
. I noticed that some scripts were being added to the hookwoo_foot
and I want my script to be the very last script added to the document, so I’ve been trying to hook into that with no success. I’ve tried bothwoo_foot
andwoo_footer_after
with no success, and also tried usingwoo_do_atomic
instead ofadd_action
.I could be misunderstanding as I’ve just recently been trying to use action and filter hooks more often.
In my
functions.php
file:if ( function_exists( 'woo_foot' ) ) { // This fires, tested an echo here add_action( 'woo_foot', 'custom_footer_scripts' ); } else { // Fallback if Woocommerce functionality is removed add_action( 'wp_enqueue_scripts', 'custom_footer_scripts', 9999 ); } function custom_footer_scripts() { // Not firing wp_enqueue_script( 'custom-js', get_bloginfo( 'template_url' ).'/includes/js/custom.js', array( 'jquery' ), '1.0', true ); }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Can't add_action to 'woo_foot' hook’ is closed to new replies.