wozmatic
wozmatic

Reputation: 163

Warning: Illegal string offset 'title' Error

This is the line it's referencing:

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

Using wordpress 4.1 and PHP 5.5

Just moved my site to a new how and this error was showing up on a few pages:

Warning: Illegal string offset 'title' in /mydomain/wp-content/themes/mytheme/include/short_code.php on line 105

Upvotes: 2

Views: 874

Answers (1)

Sandesh
Sandesh

Reputation: 1222

I had the warnings for members.php

In many places my code had this:

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();
        }

BUT then I lost my search box so instead of Not equal in the first part of the expression, I changed it to is equal (took away the !):

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'];

to:

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

Hope this will helpful..

Upvotes: 1

Related Questions