Reputation: 499
I'm tryig to change something on my widget but not working widget page in admin.
Showing this error
PHP Catchable fatal error: Object of class WP_Term could not be converted to string in
/home/username/public_html/wp-includes/general-template.php on line 4230
About the 4230 general-template source code is this,
function __checked_selected_helper( $helper, $current, $echo, $type ) {
if ( (string) $helper === (string) $current )
$result = " $type='$type'";
else
$result = '';
if ( $echo )
echo $result;
return $result;
}
I try disable plugins and change template but still same problem.
Upvotes: 1
Views: 392
Reputation: 72269
The problem is your are converting two objects to string unnecessarly.
So change:-
if ( (string) $helper === (string) $current )
to:-
if ( $helper === $current )
Note:- remove if ( $echo ) echo $result;
as echo
and return
cannot be together
Upvotes: 2