I am getting these errors:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in C:...\class-wp-hook.php on line 298

Warning: Cannot modify header information - headers already sent by (output started at C:...\www\customTheme\wp-login.php on line 394 <- and line 407

After I add a custom post type and call:

add_action('after_setup_theme', PostTypeCreate_Works());

Because of these warnings I am getting this error on the login: Cookies are blocked due to unexpected output.

Anyone know why this is happening?

1 Answer 1


read https://developer.wordpress.org/reference/functions/add_action/

then use:

add_action('after_setup_theme', 'PostTypeCreate_Works');

Your Answer

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

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