Skip to content
This repository has been archived by the owner on Aug 8, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bmqy committed Sep 12, 2018
1 parent 1260743 commit e05125b
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 51 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ function bmqynext_generate_form($formName='', $items=[], $action=''){
case 'textarea':
$html .= '<tr>
<th scope="row"><label for="'. $field .'">'. $label .'</label></th>
<td><textarea name="'. $field .'" id="'. $field .'" rows="5" cols="30" class="'. $size .'-text" placeholder="'. $placeholder .'">'. $defaultValue .'</textarea>'. (!empty($tips) ? '<p class="description" id="tagline-description">'. $tips .'</p>' : '') . '</td>
<td><textarea name="'. $field .'" id="'. $field .'" rows="5" cols="30" class="'. $size .'-text" placeholder="'. $placeholder .'">'. stripslashes($defaultValue) .'</textarea>'. (!empty($tips) ? '<p class="description" id="tagline-description">'. $tips .'</p>' : '') . '</td>
</tr>';
break;
}
Expand Down
Binary file modified languages/zh_CN.mo
Binary file not shown.
24 changes: 16 additions & 8 deletions languages/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is distributed under the same license as the Themes - Twenty Sixteen package.
msgid ""
msgstr ""
"PO-Revision-Date: 2018-09-10 13:31+0800\n"
"PO-Revision-Date: 2018-09-10 17:08+0800\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -419,13 +419,17 @@ msgstr "社交图标"
msgid "Copyright Display"
msgstr "显示版权"

#. copyright apply category
msgid "Copyright Apply Category"
msgstr "版权适用分类"

#. copyright Content
msgid "Copyright Content"
msgstr "版权内容"

#. copyright apply category
msgid "Copyright Apply Category"
msgstr "版权适用分类"
#. copyright content tips
msgid "Note: {{ title }} represents the current article title, {{ link }} represents the current article link"
msgstr "注意:{{title}} 代表当前文章标题,{{link}} 代表当前文章链接"

#. copyright display
msgid "Shop Display"
Expand All @@ -443,13 +447,17 @@ msgstr "店铺图标"
msgid "Shop Content"
msgstr "店铺内容"

#. copyright apply category
#. shop apply category
msgid "Shop Apply Category"
msgstr "店铺适用分类"

#. copyright apply category tips
msgid "Note: {{ title }} represents the current article title, {{ link }} represents the current article link"
msgstr "注意:{{title}} 代表当前文章标题,{{link}} 代表当前文章链接"
#. shop icon tips
msgid "Shop icon, recommended size: 140*140"
msgstr "店铺图标,推荐尺寸:140*140"

#. shop content tips
msgid "Support html tags, preferably display 3 lines"
msgstr "支持html标签,最终以显示 3 行为宜"

#. baidu site verification
msgid "Baidu site verification"
Expand Down
21 changes: 13 additions & 8 deletions options/analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,20 @@

foreach ($baseItem as $item=> $val){
$field = !in_array($item, $siteFiled) ? $formName .'_'. $item : $item;
if($baseItem[$item]['type']==='checkbox'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
$value = $_POST[$field];
}

update_option($field, $value);
if(!empty($_POST[$field])){
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
if($baseItem[$item]['type']==='textarea'){
$value = esc_html($_POST[$field]);
}else{
$value = $_POST[$field];
}
}

update_option($field, $value);
}
}

bmqynext_show_udpate_success();
Expand Down
21 changes: 13 additions & 8 deletions options/author.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@

foreach ($baseItem as $item=> $val){
$field = !in_array($item, $siteFiled) ? $formName .'_'. $item : $item;
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
if(!empty($_POST[$field])){
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
if($baseItem[$item]['type']==='textarea'){
$value = esc_html($_POST[$field]);
}else{
$value = $_POST[$field];
}
}

update_option($field, $value);
}
else{
$value = $_POST[$field];
}

update_option($field, $value);

}

bmqynext_show_udpate_success();
Expand Down
21 changes: 13 additions & 8 deletions options/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,20 @@

foreach ($baseItem as $item=> $val){
$field = !in_array($item, $siteFiled) ? $formName .'_'. $item : $item;
if($baseItem[$item]['type']==='checkbox'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
$value = $_POST[$field];
}

update_option($field, $value);
if(!empty($_POST[$field])){
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
if($baseItem[$item]['type']==='textarea'){
$value = esc_html($_POST[$field]);
}else{
$value = $_POST[$field];
}
}

update_option($field, $value);
}
}

bmqynext_show_udpate_success();
Expand Down
21 changes: 13 additions & 8 deletions options/other.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,20 @@

foreach ($baseItem as $item=> $val){
$field = !in_array($item, $siteFiled) ? $formName .'_'. $item : $item;
if($baseItem[$item]['type']==='checkbox'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
$value = $_POST[$field];
}

update_option($field, $value);
if(!empty($_POST[$field])){
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
if($baseItem[$item]['type']==='textarea'){
$value = esc_html($_POST[$field]);
}else{
$value = $_POST[$field];
}
}

update_option($field, $value);
}
}

bmqynext_show_udpate_success();
Expand Down
25 changes: 15 additions & 10 deletions options/shop.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'shop_icon'=>[
'type'=> 'input',
'label'=> 'Shop Icon',
'tips'=> '请填写淘宝店铺二维码图片地址,推荐尺寸:140*140'
'tips'=> 'Shop icon, recommended size: 140*140'
],
'shop_apply_category'=>[
'type'=> 'checkbox',
Expand All @@ -33,7 +33,7 @@
'type'=> 'textarea',
'label'=> 'Shop Content',
'size'=> 'large',
'tips'=> '可填加html标签,最终以显示 3 行为宜'
'tips'=> 'Support html tags, preferably display 3 lines'
]
];

Expand All @@ -45,15 +45,20 @@

foreach ($baseItem as $item=> $val){
$field = !in_array($item, $siteFiled) ? $formName .'_'. $item : $item;
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
$value = $_POST[$field];
}

update_option($field, $value);
if(!empty($_POST[$field])){
if($baseItem[$item]['type']==='switch'){
$value = !empty($_POST[$field]) ? $_POST[$field] : 0;
}
else{
if($baseItem[$item]['type']==='textarea'){
$value = esc_html($_POST[$field]);
}else{
$value = $_POST[$field];
}
}

update_option($field, $value);
}
}

bmqynext_show_udpate_success();
Expand Down

0 comments on commit e05125b

Please sign in to comment.