【发布时间】:2015-06-02 13:44:22
【问题描述】:
我的 Wordpress 页面 (yarnhk.com) 出现以下几行:
警告:array_key_exists() 期望参数 2 为数组、字符串 给出 /home/yarnhrnm/public_html/wp-content/plugins/fusion-core/shortcodes/class-fullwidth.php 在第 482 行
警告:array_key_exists() 期望参数 2 为数组、字符串 给出 /home/yarnhrnm/public_html/wp-content/plugins/fusion-core/shortcodes/class-fullwidth.php 在第 483 行
fullwidth.php 文件第 482 & 483 行显示如下:
if ( ( array_key_exists( 'backgroundattachment', $args )
&& $args['backgroundattachment'] == 'scroll' )
|| ( array_key_exists( 'background_attachment', $args )
&& $args['background_attachment'] == 'scroll' )
这里有什么帮助吗?
【问题讨论】:
-
这个输出是什么:
var_dump($args); -
这个页面应该是:yarnhk.com/home-3
-
致 tunananh,对不起,我不太明白你的意思....
-
$args需要是一个数组。它是一个数组吗?array_key_exists() expects parameter 2 to be array- 它就在那里告诉你。机会是(问题是),$args不是数组。把@tuananh 给你的代码放在你在问题中提供的代码下面,告诉我们它返回什么 -
错误很清楚:你必须提供一个数组,而不是
标签: php wordpress array-key-exists