所以我使用了WordPress,并决定安装一个叫做“页面滚动到id”的插件。
在安装了这个插件之后,有一段时间,一切都运行得很好,然后我的整个站点决定出问题,给我一个错误消息“警告: call_user_func_array()期望参数1是一个有效的回调,函数'custom_modify_title‘找不到或者在第298行的/home/sentryind/public_html/wp-includes/class-wp-hook.php中的函数名无效”。
class-wp-hook.php文件中的代码如下:
//尽量避免使用array_slice。
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 );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
}其中第298行是elseif语句中的语句。因此,在做了更多的研究之后,我注意到有些人正在修改他们的functions.php文件以包含此函数,所以我创建了
functions.php文件中的函数custom_modify_title{}。这消除了这个错误,然而,现在我的网站已经失去了很多功能,所有使用菜单的区域都不再可见。
所以我猜在安装插件后,它删除了这个功能,我不知道如何恢复这个功能或修复这个问题。任何帮助都是非常感谢的。谢谢!
发布于 2017-05-24 05:06:14
如果不知道这个函数做了什么,我就不能真正地帮助你,但是为了清除这个错误,把这个函数放在你的functions.php文件中,就像你已经做的那样……
function custom_modify_title($args=array())
{
return $args;
}在此之后,您可能能够开始恢复您在此处操作时丢失的一些功能:http://manos.malihu.gr/page-scroll-to-id-for-wordpress/
https://stackoverflow.com/questions/44144659
复制相似问题