From 2957170392440826b97f4edad4824c9473de21ba Mon Sep 17 00:00:00 2001 From: feng Date: Thu, 30 Mar 2023 22:50:46 +0800 Subject: [PATCH] Upgrade V1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加省份简码和设置页面的输入框。 --- README.md | 4 +- includes/shortcode.php | 99 +++++++++++ languages/wpicp-license-zh_CN.mo | Bin 0 -> 5687 bytes languages/wpicp-license-zh_CN.po | 273 +++++++++++++++++++++++++++++++ languages/wpicp-license-zh_TW.mo | Bin 0 -> 5195 bytes languages/wpicp-license-zh_TW.po | 220 +++++++++++++++++++++++++ readme.txt | 13 +- wpicp-license.php | 192 ++++++++++------------ 8 files changed, 694 insertions(+), 107 deletions(-) create mode 100644 includes/shortcode.php create mode 100644 languages/wpicp-license-zh_CN.mo create mode 100644 languages/wpicp-license-zh_CN.po create mode 100644 languages/wpicp-license-zh_TW.mo create mode 100644 languages/wpicp-license-zh_TW.po diff --git a/README.md b/README.md index baf2210..80bcecf 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ ![avatar](https://ps.w.org/wpicp-license/assets/banner-1544x500.png) - 描述 -中国WordPress站点必备,展示您的 ICP 许可证。 + 描述 +中国WordPress站点必备,展示您的 ICP 许可证。 ICP 许可证使用方法: diff --git a/includes/shortcode.php b/includes/shortcode.php new file mode 100644 index 0000000..b66742e --- /dev/null +++ b/includes/shortcode.php @@ -0,0 +1,99 @@ +' . $license_text . ''; + return $license_link; + } +} + + +// Add Wangan shortcode +add_shortcode( 'wpicp_wangan', 'wpicp_wangan_shortcode' ); + +function wpicp_wangan_shortcode() { + $wpicp_wangan = get_option( 'wpicp_wangan' ); + $wpicp_province = get_option( 'wpicp_province' ); + + if ( $wpicp_wangan ) { + $wangan_text = 'Wangan License' . $wpicp_province . '公网安备' . $wpicp_wangan . '号' ; + $wangan_url = 'https://www.beian.gov.cn/portal/registerSystemInfo?recordcode=' . urlencode($wpicp_wangan); + $target = '_blank'; + $nofollow = 'nofollow'; + $wangan_link = '' . $wangan_text . ''; + return $wangan_link; + } +} + + +// Add wpicp_province shortcode +add_shortcode( 'wpicp_province', 'wpicp_province_shortcode' ); + +function wpicp_province_shortcode() { + $wpicp_province = get_option( 'wpicp_province' ); + $provinces = array( + '京' => __('Beijing', 'wpicp-license'), + '津' => __('Tianjin', 'wpicp-license'), + '冀' => __('Hebei', 'wpicp-license'), + '晋' => __('Shanxi', 'wpicp-license'), + '蒙' => __('Inner Mongolia', 'wpicp-license'), + '辽' => __('Liaoning', 'wpicp-license'), + '吉' => __('Jilin', 'wpicp-license'), + '黑' => __('Heilongjiang', 'wpicp-license'), + '沪' => __('Shanghai', 'wpicp-license'), + '苏' => __('Jiangsu', 'wpicp-license'), + '浙' => __('Zhejiang', 'wpicp-license'), + '皖' => __('Anhui', 'wpicp-license'), + '闽' => __('Fujian', 'wpicp-license'), + '赣' => __('Jiangxi', 'wpicp-license'), + '鲁' => __('Shandong', 'wpicp-license'), + '豫' => __('Henan', 'wpicp-license'), + '鄂' => __('Hubei', 'wpicp-license'), + '湘' => __('Hunan', 'wpicp-license'), + '粤' => __('Guangdong', 'wpicp-license'), + '桂' => __('Guangxi', 'wpicp-license'), + '琼' => __('Hainan', 'wpicp-license'), + '渝' => __('Chongqing', 'wpicp-license'), + '川' => __('Sichuan', 'wpicp-license'), + '黔' => __('Guizhou', 'wpicp-license'), + '滇' => __('Yunnan', 'wpicp-license'), + '藏' => __('Tibet', 'wpicp-license'), + '陕' => __('Shaanxi', 'wpicp-license'), + '甘' => __('Gansu', 'wpicp-license'), + '青' => __('Qinghai', 'wpicp-license'), + '宁' => __('Ningxia', 'wpicp-license'), + '新' => __('Xinjiang', 'wpicp-license') + // ... add more provinces here + ); + if ( isset( $provinces[ $wpicp_province ] ) ) { + return $provinces[ $wpicp_province ]; + } else { + return ''; + } +} + +add_shortcode( 'wpicp_p', 'wpicp_province_abbr_shortcode' ); +function wpicp_province_abbr_shortcode() { + $wpicp_province = get_option( 'wpicp_province' ); + + if ( $wpicp_province ) { + return $wpicp_province; + } +} diff --git a/languages/wpicp-license-zh_CN.mo b/languages/wpicp-license-zh_CN.mo new file mode 100644 index 0000000000000000000000000000000000000000..3665d45ab9d6210b79490494d5b25265450c8993 GIT binary patch literal 5687 zcmbW3du$xV9ml7XK5z>K`YzB;O&amw_`G1Sq!B0O(4xrf%s!P6n_WOyl#-@?E}9E9#H*Z z@C)dVss3AvlWKe({0hFm3*H8P0OF7RP4V9#?fXCQ^We?+w;H?^q!o1dXG84-FwFABt1*A?Zi4OwWU8WTz!)C?V3<-v;TS zJp7J)3v0*&cqiLdppi}GQyt;!Ojp>v-STX{X>A=(8F67cf*WR&Ww+?AVVS&9q^#Bm zU#|0{Et*!8CtWw~L@O&>(?&cUiCZm|2`lck2-B@>GR%b5(ypm(%DJoC&B9$#9&1eL z=2PX|7O55Gre&ptDeUrA2cVdInn~jO~Wm%+@9iQ|Ar3*{quj#^77MmPTRYn`Jit zmS$bWS*Dy<>a)lVOua70#x2_xaaRkYVsXXShVywiU#VOozS4BTPf7!Fkt0$#NP1Ck zY_!D=BaA|;DfC*}wssh1TtwJw3(Kw}p3d_=WzD>9;oZ+xdCSsUx!FE>4(AmSZ zCnS-?`41b2Hn!Q&Et7n=#dBOOsqYYE6W(Cii8@<24yO=w;5#lupn?Lv74xr1$q3tu z;Wivpr!2r8#XwRw*tVpun>Z0Pr3vU|;fwrW#FMZOt4BgzlI0H9x#P;Hb{tP6ke|(l z<08(H_!WG0D#g=YBfP{_vPel=U{R!VA{3doKr=2iL+sM_%9|u7rrRk{eAND^*C=Ck=PsDlfrD$7b*kDx?>Vf99%aM>b7wG~mL zn+r9yf z4as(%uqYR$Ay%=X_e#nG->S<({kQ>JQ(<|+GpU07Dk;MLmA{zm%AthSYNjkbLHWI% zYVD?k_RBDCqWlth%jzD{eu2VBA*KBc*&F3GRW-F*RjpQA#cOJ!57gXW^-xt+*=8Lz zr`|?^OzEy=M|tkh?%>FQVCWoQP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)u3^;na18GQI0WC_$;eaJxA>f9X$%N;G)oichRK$Sx}%$cE|g q%+M?{x8)W~3Te1h9(0)*u;=OQp>CF$?w57roU9gCUiPka|NB3XE$YYs literal 0 HcmV?d00001 diff --git a/languages/wpicp-license-zh_CN.po b/languages/wpicp-license-zh_CN.po new file mode 100644 index 0000000..50c455e --- /dev/null +++ b/languages/wpicp-license-zh_CN.po @@ -0,0 +1,273 @@ +msgid "" +msgstr "" +"Project-Id-Version: WPICP License\n" +"POT-Creation-Date: 2023-03-30 22:41+0800\n" +"PO-Revision-Date: 2023-03-30 22:42+0800\n" +"Last-Translator: 薇晓朵 \n" +"Language-Team: 薇晓朵 \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1.1\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-Flags-xgettext: --add-comments=translators:\n" +"X-Poedit-WPHeader: wpicp-license.php\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" +"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" +"_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: *.min.js\n" + +#: includes/shortcode.php:52 wpicp-license.php:145 +msgid "Beijing" +msgstr "北京" + +#: includes/shortcode.php:53 wpicp-license.php:146 +msgid "Tianjin" +msgstr "天津" + +#: includes/shortcode.php:54 wpicp-license.php:147 +msgid "Hebei" +msgstr "河北" + +#: includes/shortcode.php:55 wpicp-license.php:148 +msgid "Shanxi" +msgstr "山西" + +#: includes/shortcode.php:56 wpicp-license.php:149 +msgid "Inner Mongolia" +msgstr "内蒙古" + +#: includes/shortcode.php:57 wpicp-license.php:150 +msgid "Liaoning" +msgstr "辽宁" + +#: includes/shortcode.php:58 wpicp-license.php:151 +msgid "Jilin" +msgstr "吉林" + +#: includes/shortcode.php:59 wpicp-license.php:152 +msgid "Heilongjiang" +msgstr "黑龙江" + +#: includes/shortcode.php:60 wpicp-license.php:153 +msgid "Shanghai" +msgstr "上海" + +#: includes/shortcode.php:61 wpicp-license.php:154 +msgid "Jiangsu" +msgstr "江苏" + +#: includes/shortcode.php:62 wpicp-license.php:155 +msgid "Zhejiang" +msgstr "浙江" + +#: includes/shortcode.php:63 wpicp-license.php:156 +msgid "Anhui" +msgstr "安徽" + +#: includes/shortcode.php:64 wpicp-license.php:157 +msgid "Fujian" +msgstr "福建" + +#: includes/shortcode.php:65 wpicp-license.php:158 +msgid "Jiangxi" +msgstr "江西" + +#: includes/shortcode.php:66 wpicp-license.php:159 +msgid "Shandong" +msgstr "山东" + +#: includes/shortcode.php:67 wpicp-license.php:160 +msgid "Henan" +msgstr "河南" + +#: includes/shortcode.php:68 wpicp-license.php:161 +msgid "Hubei" +msgstr "湖北" + +#: includes/shortcode.php:69 wpicp-license.php:162 +msgid "Hunan" +msgstr "湖南" + +#: includes/shortcode.php:70 wpicp-license.php:163 +msgid "Guangdong" +msgstr "广东" + +#: includes/shortcode.php:71 wpicp-license.php:164 +msgid "Guangxi" +msgstr "广西" + +#: includes/shortcode.php:72 wpicp-license.php:165 +msgid "Hainan" +msgstr "海南" + +#: includes/shortcode.php:73 wpicp-license.php:166 +msgid "Chongqing" +msgstr "重庆" + +#: includes/shortcode.php:74 wpicp-license.php:167 +msgid "Sichuan" +msgstr "四川" + +#: includes/shortcode.php:75 wpicp-license.php:168 +msgid "Guizhou" +msgstr "贵州" + +#: includes/shortcode.php:76 wpicp-license.php:169 +msgid "Yunnan" +msgstr "云南" + +#: includes/shortcode.php:77 wpicp-license.php:170 +msgid "Tibet" +msgstr "西藏" + +#: includes/shortcode.php:78 wpicp-license.php:171 +msgid "Shaanxi" +msgstr "陕西" + +#: includes/shortcode.php:79 wpicp-license.php:172 +msgid "Gansu" +msgstr "甘肃" + +#: includes/shortcode.php:80 wpicp-license.php:173 +msgid "Qinghai" +msgstr "青海" + +#: includes/shortcode.php:81 wpicp-license.php:174 +msgid "Ningxia" +msgstr "宁夏" + +#: includes/shortcode.php:82 wpicp-license.php:175 +msgid "Xinjiang" +msgstr "新疆" + +#: wpicp-license.php:36 +msgid "WP ICP License Settings" +msgstr "文派 ICP 许可证设置" + +#: wpicp-license.php:37 wpicp-license.php:69 wpicp-license.php:105 +msgid "ICP License" +msgstr "ICP 备案号" + +#: wpicp-license.php:57 +msgid "WordPress ICP License Namber" +msgstr "文派(WordPress) ICP 备案许可证" + +#: wpicp-license.php:63 +msgid "China Wangan License Number" +msgstr "中国公安网许可证" + +#: wpicp-license.php:77 +msgid "Wangan License" +msgstr "网安备案号" + +#: wpicp-license.php:84 +msgid "Province" +msgstr "省份" + +#: wpicp-license.php:99 +msgid "Enter your ICP license number information." +msgstr "输入您的备案号。" + +#: wpicp-license.php:115 +msgid "" +"This plugin is free forever, and its purpose is to supplement the essential " +"functions that the Chinese version of WordPress lacks. More information at " +"WPICP.com" +msgstr "" +"此插件永久免费,目的是补充 WordPress 中文版本所缺少的功能。更多信息请访问 WPICP.com" + +#: wpicp-license.php:116 +msgid "Why do you need?" +msgstr "为什么需要?" + +#: wpicp-license.php:117 +msgid "" +"The ICP license is a state-issued registration, All public websites in " +"mainland China must have an ICP number listed on the homepage of the " +"website. (What would happen if not?)" +msgstr "" +"ICP备案许可证是国家颁发的注册证,中国大陆所有公开网站都必须在网站首页显示有" +"ICP备案号。(如果没有会怎样?)" + +#: wpicp-license.php:118 +msgid "How to use?" +msgstr "如何使用?" + +#: wpicp-license.php:119 +msgid "" +"1. Enter your ICP license information below. (Find My " +"License?)" +msgstr "" +"1. 在下方输入您的 ICP 许可证信息。 (找到我的许可证?)" + +#: wpicp-license.php:120 +msgid "" +"2. Use the shortcode [wpicp_license] to display the license " +"information and link on your website. (Integrate into " +"theme?)" +msgstr "" +"2. 使用简码[wpicp_license]在您的网站上显示许可证信息和链接。(集成到主题?)" + +#: wpicp-license.php:127 +msgid "" +"Enter your ICP license number information. (Correct " +"format?)" +msgstr "" +"输入您的备案号。(正确格式?)" + +#: wpicp-license.php:131 +msgid "" +"Use the shortcode [wpicp_wangan], You need to register with the " +"Public Security Bureau (PSB) to have this license. (What " +"is PSB filing?)" +msgstr "" +"使用简码[wpicp_wangan],您需要在公安局(PSB)注册才能获得此备案" +"许可证。 (什么是公共安全备案?)" + +#: wpicp-license.php:189 +msgid "" +"Enter your Wangan license number and select the abbreviation of your " +"province." +msgstr "输入您的网安备案号并选择您所在省份的简称。" + +#: wpicp-license.php:199 +msgid "ICP License Settings" +msgstr "ICP 许可证设置" + +#. Plugin Name of the plugin/theme +msgid "WPICP License" +msgstr "文派 ICP 许可证" + +#. Plugin URI of the plugin/theme +msgid "https://wpicp.com/download" +msgstr "https://wpicp.com/download" + +#. Description of the plugin/theme +msgid "Must-have for WordPress sites in China, showing your ICP license." +msgstr "中国WordPress网站必备,显示您的 ICP 备案许可证。" + +#. Author of the plugin/theme +msgid "WPICP.com" +msgstr "文派 ICP" + +#. Author URI of the plugin/theme +msgid "https://wpicp.com/" +msgstr "https://wpicp.com/" diff --git a/languages/wpicp-license-zh_TW.mo b/languages/wpicp-license-zh_TW.mo new file mode 100644 index 0000000000000000000000000000000000000000..7aab82573eaccc55f239f0b99efcd520e034f59e GIT binary patch literal 5195 zcmbuBU2GKB6~}Mdv=FxqC25G12KCCR8fcldF;u1IOMGJr)Ty01G_BC=?$|ppp4rX^ z#(7#G2HW7+5U?>e*bW%n1l!nwVEjcND)pgKA1YPtL)BJdXLh!#l;)|8`qKZIx%dOK z7^vl)-`qR*&b{aS&pC7d`ogp482-MG->dlj<{4@+rhRdmZMdyQ`yTkEXYm8G-~#Yd z@SEVj!RNpi@$h|cDYzFL0>2E>h2|{)Y24R9n*Xxkw?O=}*Kwh75%8Ve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%*0^3T% zz$jBo5j4SuxOQ3xJp|2LtglU z;-WRhMXSD7h`+o&C406>KMjMcn6Hc!=4~=4+y=omZ+krmRWZ@oBe;xsDV;(^|iBEoBRC*B7qM zdrR6u-)7l1%woPnGwh(E6|9aFMhYcaOD5#V>b%`>h=aT@=IwC+_MGz0-E>>(;dDsijyH#fx&saFFi{aH`En$pg#sIvUCv z?!-^kkzmtBGK^UFZXLGbUTO8->wrTL`CjXI7{lR!9Fa^;!iw&dW)VE0?^yQY890Vz z+b@!<+@T?I9MXb1(F!^{I^5eAbC~O$N7Pa10)}V1>q+#W zCS|X-X1k9(GI<{}XP^E&gev7->hy-sc%2P7-0pQABd?t8N{^+oqvK&Nhe;V~=-n7e z->Gx!n*8B0(z9a#K7dmZ4Rf^jT5q@?T=Lhq97~c98@n(H_G5?H&eQ{mh-Lhb zPG(cxe&2_WI7Q5RQkeSEQ#J?jb>&yy&0dC>@!Jq)kE+YFk4Kmss+t+-$+R4I-|rD> zx14^U(&0$-(4!J;3eHMl*rmsMQ6t>RwkP^ZJ[wpicp_wangan], You need to register with the Public Security Bureau (PSB) to have this license. (What is PSB filing?)" +msgstr "使用短代碼 [wpicp_wangan]。網站管理員必須向中國公安局 (Public Security Bureau,PSB) 註冊以取得證號。(什麼是中國公安局備案)" + +#: wpicp-license.php:79 +msgid "Province" +msgstr "中國省份" + +#: wpicp-license.php:72 +msgid "Wangan License" +msgstr "公安網備案證號" + +#: wpicp-license.php:58 +msgid "China Wangan License Number" +msgstr "中國公安局備案證號" + +#: wpicp-license.php:179 +msgid "ICP License Settings" +msgstr "ICP 備案許可證號設定" + +#: wpicp-license.php:107 +msgid "Enter your ICP license number information. (Correct format?)" +msgstr "輸入這個網站的 ICP 備案許可證號。進一步了解正確格式" + +#: wpicp-license.php:99 +msgid "2. Use the shortcode [wpicp_license] to display the license information and link on your website. (Integrate into theme?)" +msgstr "2. 使用短代碼 [wpicp_license] 在這個網站上顯示 ICP 備案許可證號及連結。(與佈景主題整合的方式)" + +#: wpicp-license.php:98 +msgid "1. Enter your ICP license information below. (Find My License?)" +msgstr "1. 在下方輸入欄位輸入網站的 ICP 備案許可證號。(如何找到 ICP 備案許可證號)" + +#: wpicp-license.php:97 +msgid "How to use?" +msgstr "使用方式" + +#: wpicp-license.php:96 +msgid "The ICP license is a state-issued registration, All public websites in mainland China must have an ICP number listed on the homepage of the website. (What would happen if not?)" +msgstr "ICP 備案許可證號是中國頒發的網站註冊證明,在中國提供網際網路資訊服務的全部公開網站,都必須在網站首頁顯示 ICP 備案許可證號。(如果沒有 ICP 備案許可證號會發生什麼)" + +#: wpicp-license.php:95 +msgid "Why do you need?" +msgstr "為什麼需要 ICP 備案許可證號" + +#: wpicp-license.php:94 +msgid "This plugin is free forever, and its purpose is to supplement the essential functions that the Chinese version of WordPress lacks. More information at WPICP.com" +msgstr "這個外掛永久免費,目的是為 WordPress 網站新增能加入 ICP 備案許可證號的功能。如需進一步了解,請造訪 WPICP.com。" + +#: wpicp-license.php:52 +msgid "WordPress ICP License Namber" +msgstr "WordPress 網站 ICP 備案許可證號" + +#: wpicp-license.php:32 wpicp-license.php:64 +msgid "ICP License" +msgstr "ICP 備案許可證號" + +#: wpicp-license.php:31 +msgid "WP ICP License Settings" +msgstr "WordPress 網站 ICP 備案許可證號設定" + +#. Author URI of the plugin +msgid "https://wpicp.com/" +msgstr "https://wpicp.com/" + +#. Author of the plugin +msgid "WPICP.com" +msgstr "文派 ICP" + +#. Description of the plugin +msgid "Must-have for WordPress sites in China, showing your ICP license." +msgstr "目標對象為中國使用者的 WordPress 網站必備外掛,用於顯示網站 ICP 備案許可證號。" + +#. Plugin URI of the plugin +msgid "https://wpicp.com/download" +msgstr "https://wpicp.com/download" + +#. Plugin Name of the plugin +msgid "WPICP License" +msgstr "WPICP License" \ No newline at end of file diff --git a/readme.txt b/readme.txt index b03bd7d..aff4ee4 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: wpfanyi Tags: ICP, ICP License, ICP Beian,备案,备案号 Requires at least: 5.4 -Tested up to: 6.1.1 +Tested up to: 6.2 Requires PHP: 5.6 -Stable tag: 1.0.1 +Stable tag: 1.2 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -68,6 +68,15 @@ Starting with WP ICP License consists of just two steps: installing and setting == Changelog == + +### 1.2 ### + +* Add Chinese province shortcodes. +* Use the shortcode [wpicp_province] to display the full province name. +* Use the shortcode [wpicp_p] to display the short name of the province. +* Added ICP license input box to settings page. + + ### 1.1 ### * Add China Wangan License(PSB) diff --git a/wpicp-license.php b/wpicp-license.php index bb045e5..fb65100 100644 --- a/wpicp-license.php +++ b/wpicp-license.php @@ -7,7 +7,7 @@ * Author URI: https://wpicp.com/ * Text Domain: wpicp-license * Domain Path: /languages - * Version: 1.1 + * Version: 1.2 * Network: True * License: GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -23,83 +23,103 @@ * GNU General Public License for more details. */ -// Add admin menu page -add_action( 'admin_menu', 'wpicp_license_menu' ); -function wpicp_license_menu() { - add_options_page( - __( 'WP ICP License Settings', 'wpicp-license' ), + + require_once( plugin_dir_path( __FILE__ ) . 'includes/shortcode.php' ); + + + // Add admin menu page + add_action( 'admin_menu', 'wpicp_license_menu' ); + + function wpicp_license_menu() { + add_options_page( + __( 'WP ICP License Settings', 'wpicp-license' ), + __( 'ICP License', 'wpicp-license' ), + 'manage_options', + 'wpicp_license_settings', + 'wpicp_license_settings_page' + ); + } + + /** Load translation */ + add_action( 'init', 'wpicp_load_textdomain' ); + function wpicp_load_textdomain() { + load_plugin_textdomain( 'wpicp-license', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); + } + + // Add settings page and field + add_action( 'admin_init', 'wpicp_license_settings' ); + + function wpicp_license_settings() { + + add_settings_section( + 'wpicp_license_section', + __( 'WordPress ICP License Namber', 'wpicp-license' ), + 'wpicp_license_section_callback', + 'wpicp_license_settings' + ); + add_settings_section( + 'wpicp_wangan_section', + __( 'China Wangan License Number', 'wpicp-license' ), + 'wpicp_wangan_section_callback', + 'wpicp_license_settings' + ); + add_settings_field( + 'wpicp_license_field', __( 'ICP License', 'wpicp-license' ), - 'manage_options', - 'wpicp_license_settings', - 'wpicp_license_settings_page' - ); -} + 'wpicp_license_field_callback', + 'wpicp_license_settings', + 'wpicp_license_section' + ); -/** Load translation */ -add_action( 'init', 'wpicp_load_textdomain' ); -function wpicp_load_textdomain() { - load_plugin_textdomain( 'wpicp-license', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); -} - -// Add settings page and field -add_action( 'admin_init', 'wpicp_license_settings' ); - -function wpicp_license_settings() { - - add_settings_section( - 'wpicp_license_section', - __( 'WordPress ICP License Namber', 'wpicp-license' ), - 'wpicp_license_section_callback', - 'wpicp_license_settings' - ); - add_settings_section( - 'wpicp_wangan_section', - __( 'China Wangan License Number', 'wpicp-license' ), - 'wpicp_wangan_section_callback', - 'wpicp_license_settings' - ); - add_settings_field( - 'wpicp_license_field', - __( 'ICP License', 'wpicp-license' ), - 'wpicp_license_field_callback', - 'wpicp_license_settings', - 'wpicp_license_section' - ); - - add_settings_field( - 'wpicp_wangan_field', - __( 'Wangan License', 'wpicp-license' ), - 'wpicp_wangan_field_callback', - 'wpicp_license_settings', - 'wpicp_wangan_section' - ); - add_settings_field( - 'wpicp_province_field', - __( 'Province', 'wpicp-license' ), - 'wpicp_license_settings', - 'wpicp_wangan_section' - ); - - register_setting( 'wpicp_license_settings', 'wpicp_province' ); - register_setting( 'wpicp_license_settings', 'wpicp_wangan' ); - register_setting( 'wpicp_license_settings', 'wpicp_license' ); -} + add_settings_field( + 'wpicp_wangan_field', + __( 'Wangan License', 'wpicp-license' ), + 'wpicp_wangan_field_callback', + 'wpicp_license_settings', + 'wpicp_wangan_section' + ); + add_settings_field( + 'wpicp_province_field', + __( 'Province', 'wpicp-license' ), + 'wpicp_license_settings', + 'wpicp_license_section' + ); + register_setting( 'wpicp_license_settings', 'wpicp_province' ); + register_setting( 'wpicp_license_settings', 'wpicp_wangan' ); + register_setting( 'wpicp_license_settings', 'wpicp_license' ); + } -// Settings section callback -function wpicp_license_section_callback() { - echo '

' . __( 'This plugin is free forever, and its purpose is to supplement the essential functions that the Chinese version of WordPress lacks. More information at WPICP.com', 'wpicp-license' ) . '

'; - echo '

' . __( 'Why do you need?', 'wpicp-license' ) . '

'; - echo '

' . __( 'The ICP license is a state-issued registration, All public websites in mainland China must have an ICP number listed on the homepage of the website. (What would happen if not?)', 'wpicp-license' ) . '

'; - echo '

' . __( 'How to use?', 'wpicp-license' ) . '

'; - echo '

' . __( '1. Enter your ICP license information below. (Find My License?)', 'wpicp-license' ) . '

'; - echo '

' . __( '2. Use the shortcode [wpicp_license] to display the license information and link on your website. (Integrate into theme?)', 'wpicp-license' ) . '

'; -} + function show_wpicp_license_field(){ + $wpicp_license = get_option('wpicp_license'); + echo ''; + echo '

'.__('Enter your ICP license number information.', 'wpicp-license').'

'; + } + add_filter('admin_init', 'add_wpicp_license_setting'); + function add_wpicp_license_setting(){ + add_settings_field( + 'wpicp_license_field', + __('ICP License', 'wpicp-license'), + 'show_wpicp_license_field', + 'general' + ); + register_setting('general', 'wpicp_license'); + } + // Settings section callback + function wpicp_license_section_callback() { + echo '

' . __( 'This plugin is free forever, and its purpose is to supplement the essential functions that the Chinese version of WordPress lacks. More information at WPICP.com', 'wpicp-license' ) . '

'; + echo '

' . __( 'Why do you need?', 'wpicp-license' ) . '

'; + echo '

' . __( 'The ICP license is a state-issued registration, All public websites in mainland China must have an ICP number listed on the homepage of the website. (What would happen if not?)', 'wpicp-license' ) . '

'; + echo '

' . __( 'How to use?', 'wpicp-license' ) . '

'; + echo '

' . __( '1. Enter your ICP license information below. (Find My License?)', 'wpicp-license' ) . '

'; + echo '

' . __( '2. Use the shortcode [wpicp_license] to display the license information and link on your website. (Integrate into theme?)', 'wpicp-license' ) . '

'; + } + // Settings field callback function wpicp_license_field_callback() { $wpicp_license = get_option( 'wpicp_license' ); @@ -188,38 +208,4 @@ function wpicp_license_settings_page() { -// Add ICP shortcode -add_shortcode( 'wpicp_license', 'wpicp_license_shortcode' ); - -function wpicp_license_shortcode() { - $wpicp_license = get_option( 'wpicp_license' ); - if ( $wpicp_license ) { - $license_text = '' . $wpicp_license; - $license_url = 'https://beian.miit.gov.cn'; - $target = '_blank'; - $nofollow = 'nofollow'; - $license_link = '' . $license_text . ''; - return $license_link; - } -} - - -// Add Wangan shortcode -add_shortcode( 'wpicp_wangan', 'wpicp_wangan_shortcode' ); - -function wpicp_wangan_shortcode() { - $wpicp_wangan = get_option( 'wpicp_wangan' ); - $wpicp_province = get_option( 'wpicp_province' ); - - if ( $wpicp_wangan ) { - $wangan_text = 'Wangan License' . $wpicp_province . '公网安备' . $wpicp_wangan . '号' ; - $wangan_url = 'https://www.beian.gov.cn/portal/registerSystemInfo?recordcode=' . urlencode($wpicp_wangan); - $target = '_blank'; - $nofollow = 'nofollow'; - $wangan_link = '' . $wangan_text . ''; - return $wangan_link; - } -} - - ?>