From 3d381e7afaa7bcc568dde26da40a05d6770d344b Mon Sep 17 00:00:00 2001 From: owen0o0 <32561126+owen0o0@users.noreply.github.com> Date: Tue, 17 Dec 2019 17:10:48 +0800 Subject: [PATCH] 1217 --- footer.php | 4 +--- inc/frame/._.DS_Store | Bin 4096 -> 0 bytes inc/frame/assets/._.DS_Store | Bin 4096 -> 0 bytes inc/meta-boxes.php | 23 +++++++++++------------ inc/post-type.php | 2 +- single-sites.php | 3 ++- 6 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 inc/frame/._.DS_Store delete mode 100644 inc/frame/assets/._.DS_Store diff --git a/footer.php b/footer.php index 58593a2..6463804 100644 --- a/footer.php +++ b/footer.php @@ -82,9 +82,7 @@ - + \ No newline at end of file diff --git a/inc/frame/._.DS_Store b/inc/frame/._.DS_Store deleted file mode 100644 index 9111ee3eaf11f9b09707489bcf29dbf00b77ec52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIhYCu0iY;W;207T z#Khlf0@1-xfmP9{;AjYphQMeDjE2By2#kinXb6mkz-S1JhQMeDjE2By2v9i$7=h-2 zFc`>%WMmdA6r~pDmlh?bDx~EXWh-Rnm89mCWaj53=Hyf=w1 QnnLwI+$%B+a{vDW05I$wpa1{> diff --git a/inc/frame/assets/._.DS_Store b/inc/frame/assets/._.DS_Store deleted file mode 100644 index 00571dbb2811f0b721dc972f0bf12f26b0a3c07d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIhYCu0iY;W;207T z#4Hra4$;9-fmP9{;AjYphQMeDjE2By2#kinXb6mkz-S1JhQMeDjE2By2v9i$7=h-2 zFc`>%WMmdA6r~pDmlh?bDx~EXWh-Rnm89mCWaj53=Hyf=w1 QnnLwI+$%B+a{vDW0RE;OO8@`> diff --git a/inc/meta-boxes.php b/inc/meta-boxes.php index d7f9d61..0c65c4f 100644 --- a/inc/meta-boxes.php +++ b/inc/meta-boxes.php @@ -11,7 +11,7 @@ "sites_link" => array( "name" => "_sites_link", "std" => "", - "title" => "输入网址链接,需包含 http(s)://", + "title" => "输入网址链接,需包含 http(s)://
注意:“网址”和“公众号二维码”两者可同时填写,但是至少填一项。", "type"=>"text"), "sites_sescribe" => array( @@ -48,7 +48,7 @@ function new_meta_sites_boxes() { global $post, $new_meta_sites_boxes; //获取保存 foreach ($new_meta_sites_boxes as $meta_box) { - $meta_box_value = get_post_meta($post->ID, $meta_box['name'] . '', true); + $meta_box_value = get_post_meta($post->ID, $meta_box['name'] , true); if ($meta_box_value != "") //将默认值替换为已保存的值 $meta_box['std'] = $meta_box_value; @@ -59,15 +59,15 @@ function new_meta_sites_boxes() { echo '

' . $meta_box['title'] . '

'; break; case 'text': - echo '

' . $meta_box['title'] . '

'; + echo '

' . $meta_box['title'] . '

'; echo '
'; break; case 'textarea': - echo '

' . $meta_box['title'] . '

'; + echo '

' . $meta_box['title'] . '

'; echo '
'; break; case 'radio': - echo '

' . $meta_box['title'] . '

'; + echo '

' . $meta_box['title'] . '

'; $counter = 1; foreach ($meta_box['buttons'] as $radiobutton) { $checked = ""; @@ -86,9 +86,8 @@ function new_meta_sites_boxes() { break; case 'upload': $button_text = (isset($meta_box['button_text'])) ? $meta_box['button_text'] : 'Upload'; - echo '

' . $meta_box['title'] . '

'; + echo '

' . $meta_box['title'] . '

'; echo '
'.$button_text.''; - //add_script_and_styles(); break; } } @@ -102,7 +101,7 @@ function create_meta_sites_box() { function save_sites_postdata($post_id) { global $post, $new_meta_sites_boxes; foreach ($new_meta_sites_boxes as $meta_box) { - if (!wp_verify_nonce($_POST[$meta_box['name'] . '_noncename'], plugin_basename(__FILE__))) { + if (!wp_verify_nonce((@$_POST[$meta_box['name'] . '_noncename']), plugin_basename(__FILE__))) { return $post_id; } if ('page' == $_POST['post_type']) { @@ -110,10 +109,10 @@ function save_sites_postdata($post_id) { } else { if (!current_user_can('edit_post', $post_id)) return $post_id; } - $data = $_POST[$meta_box['name'] . '']; - if (get_post_meta($post_id, $meta_box['name'] . '') == "") add_post_meta($post_id, $meta_box['name'] . '', $data, true); - elseif ($data != get_post_meta($post_id, $meta_box['name'] . '', true)) update_post_meta($post_id, $meta_box['name'] . '', $data); - elseif ($data == "") delete_post_meta($post_id, $meta_box['name'] . '', get_post_meta($post_id, $meta_box['name'] . '', true)); + $data = $_POST[$meta_box['name'] ]; + if (get_post_meta($post_id, $meta_box['name'] ) == "") add_post_meta($post_id, $meta_box['name'] , $data, true); + elseif ($data != get_post_meta($post_id, $meta_box['name'] , true)) update_post_meta($post_id, $meta_box['name'] , $data); + elseif ($data == "") delete_post_meta($post_id, $meta_box['name'] , get_post_meta($post_id, $meta_box['name'] , true)); } } add_action('admin_menu', 'create_meta_sites_box'); diff --git a/inc/post-type.php b/inc/post-type.php index a041c1b..6a3208e 100644 --- a/inc/post-type.php +++ b/inc/post-type.php @@ -326,7 +326,7 @@ function io_save_quick_edit_data($post_id) { if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; // 验证权限,'sites' 为文章类型,默认为 'post' ,这里为我自定义的文章类型'sites' - if ( 'sites' == $_POST['post_type'] ) { + if ( 'sites' == @$_POST['post_type'] ) { if ( !current_user_can( 'edit_page', $post_id ) ) return $post_id; } else { diff --git a/single-sites.php b/single-sites.php index 4ff55af..727c281 100644 --- a/single-sites.php +++ b/single-sites.php @@ -57,7 +57,8 @@

ID); + $qrurl="https://my.tv.sohu.com/user/a/wvideo/getQRCode.do?width=150&height=150&text=". $m_post_link_url; $qrname = "手机查看"; if(get_post_meta(get_the_ID(), '_wechat_qr', true)){ $qrurl=get_post_meta(get_the_ID(), '_wechat_qr', true);