Support » Localhost Installs » call_user_func_array(): Argument #1 ($callback) must be a valid callback

  • moonplb

    (@moonplb)


    Hi,

    I am new here. I am getting this error while viewing any of my WordPress page or post “

    Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in E:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php:308 Stack trace: #0 E:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #1 E:\xampp\htdocs\wordpress\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #2 E:\xampp\htdocs\wordpress\wp-includes\general-template.php(3049): do_action(‘wp_head’) #3 E:\xampp\htdocs\wordpress\wp-includes\template-canvas.php(17): wp_head() #4 E:\xampp\htdocs\wordpress\wp-includes\template-loader.php(106): include(‘E:\\xampp\\htdocs…’) #5 E:\xampp\htdocs\wordpress\wp-blog-header.php(19): require_once(‘E:\\xampp\\htdocs…’) #6 E:\xampp\htdocs\wordpress\index.php(17): require(‘E:\\xampp\\htdocs…’) #7 {main} thrown in E:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 308

    I was basically making a plugin. The plugin works fine in live server or website. But in localhost, I am getting that fatal error and am unable to view any post or page. I am unable to debug or catch the problem because I don’t know which callback function and argument I need to update? May I get solution about what callback function and argument I need to update?

    • This topic was modified 1 month ago by moonplb.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • threadi

    (@threadi)

    Look in your code for a function call like

    add_filter();

    or

    add_filter(null, 'custom_function_name');

    Because obviously some filter hook is called without a filter name.

    For further debugging you could also test your code and comment out parts to see if the commented out part is responsible.

    Thread Starter moonplb

    (@moonplb)

    Hi Threadi,

    Thanks for your guide. Let me debug regarding your guide.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.