• Resolved roelof

    (@roelof)


    im following this page : https://learn.www.ads-software.com/lesson/action-hooks/

    but when I put that code in the functions.php of the twentytwentyfour theme I see this error message:



    Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "wp_learn_setup_theme" not found or invalid function name in C:\laragon\www\learn\wp-includes\class-wp-hook.php:324 Stack trace: #0 C:\laragon\www\learn\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #1 C:\laragon\www\learn\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #2 C:\laragon\www\learn\wp-settings.php(673): do_action('after_setup_the...') #3 C:\laragon\www\learn\wp-config.php(103): require_once('C:\\laragon\\www\\...') #4 C:\laragon\www\learn\wp-load.php(50): require_once('C:\\laragon\\www\\...') #5 C:\laragon\www\learn\wp-blog-header.php(13): require_once('C:\\laragon\\www\\...') #6 C:\laragon\www\learn\index.php(17): require('C:\\laragon\\www\\...') #7 {main} thrown in C:\laragon\www\learn\wp-includes\class-wp-hook.php on line 324
    `</p> <p></p> <p>What went wrong here ?</p>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The function names in the various sample snippets are not consistent. “setup_theme” and “theme_setup” both occur. They must all be the same, one way or the other.

    TBH I’m not sure where you’d report this error in the training docs. I recommend asking in the Training Team’s Slack channel for specific direction. If you’ve not yet joined Slack, follow these instructions.

    Thread Starter roelof

    (@roelof)

    Thanks, the problem is solved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘why is the function name not right’ is closed to new replies.