0

Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "questo_block_styles" not found or invalid function name in /Users/gebruiker/Local Sites/questo/app/public/wp-includes/class-wp-hook.php:308 Stack

this is the error i keep getting when trying to load a css file in my frontend of my custom blocks in wordpress.

code i get the error on:

function questo_block_styles()
{
 wp_register_style( 'image-block', _get_plugin_url() . '/blocks/block-details/style.css');
 wp_enqueue_style('image-block');
}

add_action('wp_enqueue_scripts', 'questo_block_styles');
2
  • Are you 100% sure that the errors comes from those few lines of code? Commented Nov 21, 2022 at 15:34
  • it says so indeed Commented Nov 22, 2022 at 7:46

1 Answer 1

0

in my file i also have a namespace.

i removed this namespace and now it worked, i cannot explain why it did not work with the namespace included

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.