Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($function) must be a valid callback, class Wcore_Admin does not have a method "sitemap_exclude_post_type" in /var/www/html/wp-includes/class-wp-hook.php:292 Stack trace: #0 /var/www/html/wp-includes/plugin.php(212): WP_Hook->apply_filters() #1 /var/www/html/wp-content/plugins/wordpress-seo/inc/sitemaps/class-post-type-sitemap-provider.php(276): apply_filters() #2 /var/www/html/wp-content/plugins/wordpress-seo/inc/sitemaps/class-post-type-sitemap-provider.php(253): WPSEO_Post_Type_Sitemap_Provider->is_valid_post_type() #3 /var/www/html/wp-includes/class-wp-hook.php(294): WPSEO_Post_Type_Sitemap_Provider->save_post() #4 /var/www/html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #5 /var/www/html/wp-includes/plugin.php(484): WP_Hook->do_action() #6 /var/www/html/wp-includes/post.php(4384): do_action() #7 /var/www/html/wp-admin/includes/post.php(690): wp_insert_post() #8 /var/www/html/wp-admin/post-new.php(66): get_default_post_to_edit() #9 {main} thrown in /var/www/html/wp-includes/class-wp-hook.php on line 292 There has been a critical error on this website. Please check your site admin email inbox for instructions.
我的服务器已经从 PHP 7.4 升级到 8.0.8。我知道这是由自定义开发的名为 wcore admin 的插件之一引起的。它需要插件来完成我们的工作。我正在寻找一种方法来解决问题并自己维护脚本,因为我对此非常满意。
最佳答案
我在升级到 php8.0 时遇到了同样的问题,错误显示了调试步骤
'类 Wcore_Admin 没有方法“sitemap_exclude_post_type”'
插件或文件类名 Wcore_Admin 没有名为 sitemap_exclude_post_type 的函数。删除调用缺失函数的行,它应该可以工作
关于php - 未捕获的类型错误 : call_user_func_array(): Argument #1 ($function) must be a valid callback,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68788729/