From 73d61d2249a1b6a12c9932905fff93e70e03dd25 Mon Sep 17 00:00:00 2001 From: Seaton Jiang Date: Sun, 27 Sep 2020 08:47:49 +0800 Subject: [PATCH] fix: problems with non-objects --- inc/theme-setting.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/theme-setting.php b/inc/theme-setting.php index 0084b8e..95ad8d7 100644 --- a/inc/theme-setting.php +++ b/inc/theme-setting.php @@ -3,7 +3,7 @@ * 站点相关函数 * @author Seaton Jiang * @license MIT License - * @version 2020.08.04 + * @version 2020.09.27 */ // 标题配置 @@ -104,6 +104,8 @@ function mourning() function share_thumbnail_url() { global $post; + if(!is_object($post)) + return; if (has_post_thumbnail($post->ID)) { $post_thumbnail_id = get_post_thumbnail_id($post); $img = wp_get_attachment_image_src($post_thumbnail_id, 'full');