警告:非法字符串偏移'title'错误

时间:2014-12-23 11:06:59

标签: php string wordpress

这是它引用的行:

$html = '<div class="devider"><a id="back-top" class="top" href="#top">'.$atts["title"].'</a></div><hr />';

使用wordpress 4.1和PHP 5.5

刚刚将我的网站移动到新的方式,这个错误出现在几页上:

  

警告:第105行/mydomain/wp-content/themes/mytheme/include/short_code.php中的非法字符串偏移'title'

1 个答案:

答案 0 :(得分:1)

我收到了members.php的警告

在很多地方,我的代码都有这个:

if($a['search'] !== false and $a['search'] !== 'false') {
            $r .= $this->search();
        }
I had to change it to this to remove the warning:
if(isset($a['search']) !== false and isset($a['search']) !== 'false') {
            $r .= $this->search();
        }

然后我丢失了我的搜索框,而不是在表达式的第一部分中不相等,我将其更改为相等(拿走了!):

if(isset($a['search']) == false and isset($a['search']) !== 'false') {
$r .= $this->search();
}
I had to also change a line that looked like:
$this->list = $a['list'];

为:

$this->list = isset($a['list']);

希望这会有所帮助..