Hello!
I need help with the following issue. [My website is crisisequipped.com.]
We are getting the following error frequently:
[23-Dec-2020 01:15:40 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘my_script’ not found or invalid function name in /home3/crisise1/public_html/wp-includes/class-wp-hook.php on line 287
Upon further research, we believe the function “my_script” is referenced in x Child theme
This seems to be the bit of code responsible:
…add_action (‘wp_head’, ‘my_script’, 9999); …
After doing a string search, we found the error is located here:
wp-content/themes/x-child/functions.php line 242 char: 24
It is part of the following function:
function gw_footer_enqueue() {
//if ( is_page( 178 ) ) {
wp_enqueue_script( ‘custom_script’, get_stylesheet_directory_uri() . ‘/custom_script.js’, array(), ‘jsb’.time(), true);
//}
}
add_action( ‘wp_enqueue_scripts’, ‘gw_footer_enqueue’ );
add_action (‘wp_head’, ‘my_script’, 9999);
page 178 is the ID of our /blog page that contains all of our blog posts.
Do you have any insight into this error?
Thanks so much!
