1

I wanted to load the following two scripts before any other script so I added priority 1 and 2, however I am getting an error. I read it on a tutorial that this is how to prioritize

 add_action('wp_enqueue_scripts', array(__CLASS__, 'frontend_enqueues', 1));
        add_action('print_head_scripts', array(__CLASS__, 'print_js', 2));

Warning: call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members in xxx/xx/xxx/wp-includes/plugin.php on line 406

Warning: call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members in xxx/xx/xxx/wp-includes/plugin.php on line 173

Please advice :)

3

You got parentheses levels slightly wrong and that broke your callbacks.

It should be:

add_action( 'wp_enqueue_scripts', array( __CLASS__, 'frontend_enqueues' ), 1 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.