What's the warning on line 736?

admin2025-06-04  3

on my wp5.03 (though warnings were thrown Jan 7 and 19 so 5.02 or )

from public_html/error_log

PHP Warning: trim() expects parameter 1 to be string, array given in ... /wp-includes/class-wp-query.php on line 736

anyone else?

on my wp5.03 (though warnings were thrown Jan 7 and 19 so 5.02 or )

from public_html/error_log

PHP Warning: trim() expects parameter 1 to be string, array given in ... /wp-includes/class-wp-query.php on line 736

anyone else?

Share Improve this question asked Jan 28, 2019 at 16:34 Cody GCody G 11 silver badge1 bronze badge 2
  • Have you turned off all the plugins and switched to a default theme, to ensure that it is, in fact, WordPress (and not a plugin or a theme) that's throwing the error? – Pat J Commented Jan 28, 2019 at 16:38
  • Thanks Pat, that's the first thing I thought about, however, as the error isn't fatal, and as the error has only happened a few times in the past month, turning things off or changing themes on the production site isn't an option atm. I'll keep a watch on this post though. – Cody G Commented Jan 28, 2019 at 17:11
Add a comment  | 

1 Answer 1

Reset to default 0

As you can see here (https://core.trac.wordpress/browser/tags/5.0.3/src/wp-includes/class-wp-query.php#L736), the 736 line of that file contains:

$qv['name'] = trim( $qv['name'] );

And $qv is defined as:

$this->query_vars = $this->fill_query_vars($this->query_vars);
$qv = &$this->query_vars;

So... That means, that you use WP_Query incorrectly somewhere in your code...

You should pass string value as name param, and it looks like somewhere in your site an array is passed as that param...

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748968038a315238.html

最新回复(0)