Ошибка PHP Notice: Trying to get property of non-object
-
Добрый день, переносили сайт на другой хостинг, в error_log выводит эту ошибку «PHP Notice: Trying to get property of non-object in /hosting/home/mysite/public_html/wp-content/themes/starflix/functions.php on line 1573». Из-за данной ошибки выдаёт «Internal Server Error» при попытках перейти на любую страницу не только старую, но и только что созданную. Корректно отображается только главная страница.
function qode_has_shortcode($shortcode, $content = '') { $has_shortcode = false; if ($shortcode) { //if content variable isn't past if($content == '') { //take content from current post $current_post = get_post(get_the_ID()); $content = $current_post->post_content; <---строка 1573 } //does content has shortcode added? if (stripos($content, '[' . $shortcode) !== false) { $has_shortcode = true; } } return $has_shortcode; } }
Страница, с которой нужна помощь: [войдите, чтобы увидеть ссылку]
Просмотр 1 ответа (всего 1)
Просмотр 1 ответа (всего 1)
- Тема «Ошибка PHP Notice: Trying to get property of non-object» закрыта для новых ответов.