diff --git a/functions.php b/functions.php index 40dd752..d87cd27 100644 --- a/functions.php +++ b/functions.php @@ -470,7 +470,7 @@ function set_post_views() { global $post; $post_id = intval($post->ID); if($post_id) { - $views = get_post_meta($post_id, 'views', true); + $views = (int)get_post_meta($post_id, 'views', true); if(!update_post_meta($post_id, 'views', ($views + 1))) { add_post_meta($post_id, 'views', 1, true); } diff --git a/inc/api.php b/inc/api.php index 8144c7a..2205345 100644 --- a/inc/api.php +++ b/inc/api.php @@ -275,7 +275,7 @@ EOS; $posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post'); while ($posts->have_posts()): $posts->the_post(); - $output .= '{"type":"post","link":"' . get_post_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},'; + $output .= '{"type":"post","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},'; endwhile; wp_reset_postdata(); @@ -373,12 +373,12 @@ function update_database() { $manifest = file_get_contents($img_domain . "/manifest/manifest.json"); if($manifest) { $manifest = array( - "key" => "manifest_json", - "value" => $manifest + "mate_key" => "manifest_json", + "mate_value" => $manifest ); $time = array( - "key" => "json_time", - "value" => date("Y-m-d H:i:s",time()) + "mate_key" => "json_time", + "mate_value" => date("Y-m-d H:i:s",time()) ); $wpdb->query("DELETE FROM `wp_sakura` WHERE `mate_key` ='manifest_json'"); diff --git a/languages/zh_CN.mo b/languages/zh_CN.mo index 6198127..6bb9300 100644 Binary files a/languages/zh_CN.mo and b/languages/zh_CN.mo differ diff --git a/languages/zh_CN.po b/languages/zh_CN.po index a1c1c93..2a16fce 100644 --- a/languages/zh_CN.po +++ b/languages/zh_CN.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Sakura\n" "POT-Creation-Date: 2019-12-21 20:23+0800\n" -"PO-Revision-Date: 2019-12-21 20:24+0800\n" +"PO-Revision-Date: 2019-12-24 13:28+0800\n" "Last-Translator: \n" "Language-Team: \n" "Language: zh_CN\n" @@ -955,7 +955,7 @@ msgstr "聚焦图二链接" #: options.php:509 msgid "Top-feature 3 image" -msgstr "聚焦图二链接" +msgstr "聚焦图三" #: options.php:516 options.php:517 msgid "Top-feature 3 title"