首页 > 解决方案 > PHP 警告:回调,未找到函数“register_shortcodes”或无效函数>名称/Wordpress

问题描述

我想将 wordpress 站点迁移到新服务器。当我将网站克隆到本地环境并尝试进行一些测试时,我收到以下警告消息:

警告:call_user_func_array() 期望参数 1 是有效的回调,在第 286 行的 /Applications/XAMPP/xamppfiles/htdocs/mySite/wp-includes/class-wp-hook.php 中找不到函数“register_shortcodes”或无效函数名

这是 class-wp-hook.php 的代码:

// Avoid the array_slice if possible.
if ( $the_['accepted_args'] == 0 ) {
    $value = call_user_func_array( $the_['function'], array() );
} elseif ( $the_['accepted_args'] >= $num_args ) {
    $value = call_user_func_array( $the_['function'], $args ); //LINE 286
} else {
    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
}

我找不到任何方法来删除这个警告,有人可以帮我吗?

标签: phpwordpress

解决方案


推荐阅读