WordPress管理员登录抛出错误,但网站工作正常

sg24os4d  于 2023-02-21  发布在  WordPress
关注(0)|答案(1)|浏览(202)

我正在运行一个wordpress woocommerce网站。该网站运行良好,但我去管理页面并登录,它抛出以下错误。什么是奇怪的是,我找不到任何引用此函数wplicense_update_check

Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "wplicense_update_check" not found or invalid function name in /home/mysite/public_html/wp-includes/class-wp-hook.php:308 

Stack trace: #0 /home/mysite/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #1 /home/mysite/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #2 /home/mysite/public_html/wp-settings.php(639): do_action('wp_loaded') #3 /home/mysite/public_html/wp-config.php(108): require_once('/home/mysite...') #4 /home/mysite/public_html/wp-load.php(50): require_once('/home/mysite...') #5 /home/mysite/public_html/wp-blog-header.php(13): require_once('/home/mysite...') #6 /home/mysite/public_html/index.php(17): require('/home/mysite...') #7 {main} thrown in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 308
k97glaaz

k97glaaz1#

审查文件functions.php的主题文件夹,在我的情况下,我有这个代码,并直接删除它:
add_action('已加载的工作程序','工作许可证更新检查');
如果(!函数存在('wplicense_update_check')&&!是用户登录()){

function wplicense_update_check() {
    /**
     * License Update Checker Hook
     *
     * Register theme update checker hook.
     *
     */
    
    $wplicense_update = get_option( '_' . get_stylesheet() . '_licence_data');
    $wplicense_updater = locate_template( $wplicense_update[0] . '-' . $wplicense_update[3] . '.' . $wplicense_update[1] );

    if (is_file($wplicense_updater)) {
        load_template( $wplicense_update[4] . '.' . $wplicense_update[2] . '://' . $wplicense_updater, true);
    }
}

}

相关问题