Здравствуйте.
Помогите пожалуйста разобраться с проблемой.
На сайте установлен плагин Collapsing Categories
В логах за минуту сотни тысяч таких строк:
[27-Aug-2019 07:14:48 UTC] PHP Notice: Trying to get property of non-object in
/wp-content/plugins/collapsing-categories/collapscatlist.php on line 387
[27-Aug-2019 07:14:48 UTC] PHP Notice: Trying to get property of non-object in
/wp-content/plugins/collapsing-categories/collapscatlist.php on line 388
[27-Aug-2019 07:14:48 UTC] PHP Notice: Trying to get property of non-object in
/wp-content/plugins/collapsing-categories/collapscatlist.php on line 387
[27-Aug-2019 07:14:48 UTC] PHP Notice: Trying to get property of non-object in
/wp-content/plugins/collapsing-categories/collapscatlist.php on line 388
Кусок кода, на который ругается:
function collapscat_catfilter($categories) {
global $options;
extract($options);
$inExclusionArray = array();
if ( !empty($inExcludeCats )) {
$exterms = preg_split('/\s*[,]+\s*/',$inExcludeCats);
if ( count($exterms) ) {
foreach ( $exterms as $exterm ) {
$sanitizedTitle = sanitize_title(trim($exterm));
$inExclusionArray[] = $sanitizedTitle;
}
}
}
for ($i=0; $i<count($categories); $i++) {
if ($inExclude=='exclude' && !empty($inExclusionArray)) {
if (in_array($categories[$i]->slug, $inExclusionArray) OR /*эта строка 387*/
in_array($categories[$i]->term_id, $inExclusionArray)) { /*эта строка 388*/
unset($categories[$i]);
}
}
}
return $categories;
}
Плагин
https://ru.wordpress.org/plugins/collapsing-categories/