From 7ef614f3ba1297f93eff941ae4cda9e72d40880f Mon Sep 17 00:00:00 2001 From: feng Date: Fri, 5 Jul 2024 15:44:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=87=B3=20v1.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加新的简码。 --- assets/images/gongan.png | Bin includes/shortcode.php | 155 ++++++++++++++++++++----------- languages/wpicp-license-zh_CN.mo | Bin 5687 -> 6630 bytes languages/wpicp-license-zh_CN.po | 147 +++++++++++++++++++---------- languages/wpicp-license-zh_TW.mo | Bin languages/wpicp-license-zh_TW.po | 0 license.txt | 0 readme.txt | 10 +- wpicp-license.php | 109 +++++++++++++++++++++- 9 files changed, 315 insertions(+), 106 deletions(-) mode change 100644 => 100755 assets/images/gongan.png mode change 100644 => 100755 includes/shortcode.php mode change 100644 => 100755 languages/wpicp-license-zh_CN.mo mode change 100644 => 100755 languages/wpicp-license-zh_CN.po mode change 100644 => 100755 languages/wpicp-license-zh_TW.mo mode change 100644 => 100755 languages/wpicp-license-zh_TW.po mode change 100644 => 100755 license.txt mode change 100644 => 100755 readme.txt mode change 100644 => 100755 wpicp-license.php diff --git a/assets/images/gongan.png b/assets/images/gongan.png old mode 100644 new mode 100755 diff --git a/includes/shortcode.php b/includes/shortcode.php old mode 100644 new mode 100755 index b66742e..7193c70 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1,6 +1,6 @@ ' . $license_text . ''; + $license_link = '' . $license_text . ''; return $license_link; } } - // Add Wangan shortcode -add_shortcode( 'wpicp_wangan', 'wpicp_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' ); + $wpicp_wangan = get_option('wpicp_wangan'); + $wpicp_province = get_option('wpicp_province'); - if ( $wpicp_wangan ) { - $wangan_text = 'Wangan License' . $wpicp_province . '公网安备' . $wpicp_wangan . '号' ; + 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 . ''; + $wangan_link = '' . $wangan_text . ''; return $wangan_link; } } - // Add wpicp_province shortcode -add_shortcode( 'wpicp_province', 'wpicp_province_shortcode' ); - +add_shortcode('wpicp_province', 'wpicp_province_shortcode'); function wpicp_province_shortcode() { - $wpicp_province = get_option( 'wpicp_province' ); + $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 + '京' => __('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') ); - if ( isset( $provinces[ $wpicp_province ] ) ) { - return $provinces[ $wpicp_province ]; + if (isset($provinces[$wpicp_province])) { + return $provinces[$wpicp_province]; } else { return ''; } } +// Add wpicp_p shortcode add_shortcode( 'wpicp_p', 'wpicp_province_abbr_shortcode' ); function wpicp_province_abbr_shortcode() { $wpicp_province = get_option( 'wpicp_province' ); @@ -97,3 +91,58 @@ function wpicp_province_abbr_shortcode() { return $wpicp_province; } } + + +// Add wpicp_company shortcode +add_shortcode('wpicp_company', 'wpicp_company_shortcode'); +function wpicp_company_shortcode() { + $wpicp_company = get_option('wpicp_company'); + if ($wpicp_company) { + return esc_html($wpicp_company); + } +} + +// Add wpicp_email shortcode +add_shortcode('wpicp_email', 'wpicp_email_shortcode'); +function wpicp_email_shortcode() { + $wpicp_email = get_option('wpicp_email'); + if ($wpicp_email) { + return esc_html($wpicp_email); + } +} + +// Add wpicp_phone shortcode +add_shortcode('wpicp_phone', 'wpicp_phone_shortcode'); +function wpicp_phone_shortcode() { + $wpicp_phone = get_option('wpicp_phone'); + if ($wpicp_phone) { + return esc_html($wpicp_phone); + } +} + +// Add wpicp_edi shortcode +add_shortcode('wpicp_edi', 'wpicp_edi_shortcode'); +function wpicp_edi_shortcode() { + $wpicp_edi = get_option('wpicp_edi'); + if ($wpicp_edi) { + return esc_html($wpicp_edi); + } +} + +// Add wpicp_app shortcode +add_shortcode('wpicp_app', 'wpicp_app_shortcode'); +function wpicp_app_shortcode() { + $wpicp_app = get_option('wpicp_app'); + if ($wpicp_app) { + return esc_html($wpicp_app); + } +} + +// Add wpicp_minipapp shortcode +add_shortcode('wpicp_minipapp', 'wpicp_minipapp_shortcode'); +function wpicp_minipapp_shortcode() { + $wpicp_minipapp = get_option('wpicp_minipapp'); + if ($wpicp_minipapp) { + return esc_html($wpicp_minipapp); + } +} diff --git a/languages/wpicp-license-zh_CN.mo b/languages/wpicp-license-zh_CN.mo old mode 100644 new mode 100755 index 3665d45ab9d6210b79490494d5b25265450c8993..9799bc032ba11aa90776c227623e8f33835b23fa GIT binary patch delta 2097 zcmaKsdu&r>6u`f-ImXtqCn(CK=?PYQ0xq~n=7O5wlxW>JO){1S@a87O|= zK-uV=+BVF^zNGe_%6aY2V9{d6^Wbv!H>EUWgBoQMl!doK=9pHv67GPTp%04xQ5}z} zeGG*H3AmlLSGL4H2I61Z~{1cP|{0=2lmth55$LeA~49j2$ zR>BFj&%gs;N^xC#CP zWkC-K6SgR~D<4vJD80&VNKj2c?E#pFJ*f7Ga(^-Tmy?gt!Cqzp%ET|!;cMkti=b11Fr{OD9p4_~OgbEwrI_QCS z!Y;MAelX3^|22{pNlRc?d1&}D$Xdm@#no@1zpC(fE>rtr%E|C18u)e8AZ$=wY zkz3JPv{{TaA!te2pe%z@;3D#alLJfT%f&>B<@*PZc|FMH=Wi$-s;k}_=nZ=P1MW6&uVuvO@%sGz?)wA% zJwCr>TJCFIG%MPkb;_~A=l5;?|ANl!$DKQ@V4$zx-O}sz^+cb}Ze5b=4F-2LS9S)v zEKg)4$DP-i+A_T_*Xr`6+b&C{r}yOdvSo15Qm$Zkz;9h~i;m=6aJXvAs~XCy>fF_J zjWzX=mz>|O+F8EM@>_l0{y<-&yFI{G{qCBI+KLU)y{@bbm)yfXv}bPoO*?!%63MS@ zvfr4n!!dj0o%lz`%-rz4#ME2y(N7ao2aNsxm_2wBV|HeIHuj!9JRUz0PK+E*Ovdc+ zRAOorT8$wABa*6_p ztiT85bcO{E(NJ)xFDwbgpR$w|dVmTf_2m5g!W^*xBIf8osG35FI z>7c?PXUwyx7Y?FccokQoWBDkqARn{*iTT3XCo!M%Gnk3<$RVH2CDiBs!8H1pq%@HR z8vLji?ne%3vAoqhZtdM>AL@%FuRS8F??@YBDH zP|>M-fcnNRX5%#KlDtEnDPK`LT((@NC6_!M*J3d)CW!3BG4i4;ky)HZz3&-P<_zk9W-XsX-a!^D|86elF#mo|=rHmi z6ZOVY)EBEXBWBcWKwYvX%deQj=1udqIc7dIpPCc7%>Qp5G)==}oZ>CC;}|IYMQ_xio1}!; zKx`*;rb-E2J1ymLqzYN~|HZysFQ;E`FKx!4T~UT~>upZme_pBhSHWtl>*mu>X&b?k zNtj^o$reIKxq}E10b(P;zVnK1R$WFNp>Aj`wS>;pR)W70Z@Jfr=zGOKkM&+H{%2A{ zU8lE_&}kL-R`PkD6HbjduTsn1sZ_`3oJ>FD&ZajdxLf^`K7S-w6$wVF0@c;gnri1q z=KK2Qj?=NWj^LiI*r}dqptIXcd+Nh=fq1pPsxISTu(7?fJ=WIS6^jO%yV{SQ=nX_d h;ZWFJ$Vy3cmU2UGYu=#GS\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-Generator: Poedit 3.4.2\n" "X-Poedit-Basepath: ..\n" "X-Poedit-Flags-xgettext: --add-comments=translators:\n" "X-Poedit-WPHeader: wpicp-license.php\n" @@ -21,127 +20,127 @@ msgstr "" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPathExcluded-0: *.min.js\n" -#: includes/shortcode.php:52 wpicp-license.php:145 +#: includes/shortcode.php:46 wpicp-license.php:199 msgid "Beijing" msgstr "北京" -#: includes/shortcode.php:53 wpicp-license.php:146 +#: includes/shortcode.php:47 wpicp-license.php:200 msgid "Tianjin" msgstr "天津" -#: includes/shortcode.php:54 wpicp-license.php:147 +#: includes/shortcode.php:48 wpicp-license.php:201 msgid "Hebei" msgstr "河北" -#: includes/shortcode.php:55 wpicp-license.php:148 +#: includes/shortcode.php:49 wpicp-license.php:202 msgid "Shanxi" msgstr "山西" -#: includes/shortcode.php:56 wpicp-license.php:149 +#: includes/shortcode.php:50 wpicp-license.php:203 msgid "Inner Mongolia" msgstr "内蒙古" -#: includes/shortcode.php:57 wpicp-license.php:150 +#: includes/shortcode.php:51 wpicp-license.php:204 msgid "Liaoning" msgstr "辽宁" -#: includes/shortcode.php:58 wpicp-license.php:151 +#: includes/shortcode.php:52 wpicp-license.php:205 msgid "Jilin" msgstr "吉林" -#: includes/shortcode.php:59 wpicp-license.php:152 +#: includes/shortcode.php:53 wpicp-license.php:206 msgid "Heilongjiang" msgstr "黑龙江" -#: includes/shortcode.php:60 wpicp-license.php:153 +#: includes/shortcode.php:54 wpicp-license.php:207 msgid "Shanghai" msgstr "上海" -#: includes/shortcode.php:61 wpicp-license.php:154 +#: includes/shortcode.php:55 wpicp-license.php:208 msgid "Jiangsu" msgstr "江苏" -#: includes/shortcode.php:62 wpicp-license.php:155 +#: includes/shortcode.php:56 wpicp-license.php:209 msgid "Zhejiang" msgstr "浙江" -#: includes/shortcode.php:63 wpicp-license.php:156 +#: includes/shortcode.php:57 wpicp-license.php:210 msgid "Anhui" msgstr "安徽" -#: includes/shortcode.php:64 wpicp-license.php:157 +#: includes/shortcode.php:58 wpicp-license.php:211 msgid "Fujian" msgstr "福建" -#: includes/shortcode.php:65 wpicp-license.php:158 +#: includes/shortcode.php:59 wpicp-license.php:212 msgid "Jiangxi" msgstr "江西" -#: includes/shortcode.php:66 wpicp-license.php:159 +#: includes/shortcode.php:60 wpicp-license.php:213 msgid "Shandong" msgstr "山东" -#: includes/shortcode.php:67 wpicp-license.php:160 +#: includes/shortcode.php:61 wpicp-license.php:214 msgid "Henan" msgstr "河南" -#: includes/shortcode.php:68 wpicp-license.php:161 +#: includes/shortcode.php:62 wpicp-license.php:215 msgid "Hubei" msgstr "湖北" -#: includes/shortcode.php:69 wpicp-license.php:162 +#: includes/shortcode.php:63 wpicp-license.php:216 msgid "Hunan" msgstr "湖南" -#: includes/shortcode.php:70 wpicp-license.php:163 +#: includes/shortcode.php:64 wpicp-license.php:217 msgid "Guangdong" msgstr "广东" -#: includes/shortcode.php:71 wpicp-license.php:164 +#: includes/shortcode.php:65 wpicp-license.php:218 msgid "Guangxi" msgstr "广西" -#: includes/shortcode.php:72 wpicp-license.php:165 +#: includes/shortcode.php:66 wpicp-license.php:219 msgid "Hainan" msgstr "海南" -#: includes/shortcode.php:73 wpicp-license.php:166 +#: includes/shortcode.php:67 wpicp-license.php:220 msgid "Chongqing" msgstr "重庆" -#: includes/shortcode.php:74 wpicp-license.php:167 +#: includes/shortcode.php:68 wpicp-license.php:221 msgid "Sichuan" msgstr "四川" -#: includes/shortcode.php:75 wpicp-license.php:168 +#: includes/shortcode.php:69 wpicp-license.php:222 msgid "Guizhou" msgstr "贵州" -#: includes/shortcode.php:76 wpicp-license.php:169 +#: includes/shortcode.php:70 wpicp-license.php:223 msgid "Yunnan" msgstr "云南" -#: includes/shortcode.php:77 wpicp-license.php:170 +#: includes/shortcode.php:71 wpicp-license.php:224 msgid "Tibet" msgstr "西藏" -#: includes/shortcode.php:78 wpicp-license.php:171 +#: includes/shortcode.php:72 wpicp-license.php:225 msgid "Shaanxi" msgstr "陕西" -#: includes/shortcode.php:79 wpicp-license.php:172 +#: includes/shortcode.php:73 wpicp-license.php:226 msgid "Gansu" msgstr "甘肃" -#: includes/shortcode.php:80 wpicp-license.php:173 +#: includes/shortcode.php:74 wpicp-license.php:227 msgid "Qinghai" msgstr "青海" -#: includes/shortcode.php:81 wpicp-license.php:174 +#: includes/shortcode.php:75 wpicp-license.php:228 msgid "Ningxia" msgstr "宁夏" -#: includes/shortcode.php:82 wpicp-license.php:175 +#: includes/shortcode.php:76 wpicp-license.php:229 msgid "Xinjiang" msgstr "新疆" @@ -149,7 +148,7 @@ msgstr "新疆" msgid "WP ICP License Settings" msgstr "文派 ICP 许可证设置" -#: wpicp-license.php:37 wpicp-license.php:69 wpicp-license.php:105 +#: wpicp-license.php:37 wpicp-license.php:69 wpicp-license.php:159 msgid "ICP License" msgstr "ICP 备案号" @@ -169,11 +168,35 @@ msgstr "网安备案号" msgid "Province" msgstr "省份" +#: wpicp-license.php:91 +msgid "Company Name" +msgstr "公司名称" + #: wpicp-license.php:99 +msgid "Report Email" +msgstr "举报邮箱" + +#: wpicp-license.php:107 +msgid "Complaint Hotline" +msgstr "投诉电话" + +#: wpicp-license.php:115 +msgid "EDI License Number" +msgstr "增值电信业务经营许可证" + +#: wpicp-license.php:123 +msgid "APP License Number" +msgstr "APP 备案号" + +#: wpicp-license.php:131 +msgid "MiniAPP License Number" +msgstr "小程序备案号" + +#: wpicp-license.php:153 msgid "Enter your ICP license number information." msgstr "输入您的备案号。" -#: wpicp-license.php:115 +#: wpicp-license.php:169 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 " @@ -183,11 +206,11 @@ msgstr "" "此插件永久免费,目的是补充 WordPress 中文版本所缺少的功能。更多信息请访问 WPICP.com" -#: wpicp-license.php:116 +#: wpicp-license.php:170 msgid "Why do you need?" msgstr "为什么需要?" -#: wpicp-license.php:117 +#: wpicp-license.php:171 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 " @@ -198,11 +221,11 @@ msgstr "" "ICP备案号。(如果没有会怎样?)" -#: wpicp-license.php:118 +#: wpicp-license.php:172 msgid "How to use?" msgstr "如何使用?" -#: wpicp-license.php:119 +#: wpicp-license.php:173 msgid "" "1. Enter your ICP license information below. (Find My " @@ -211,7 +234,7 @@ msgstr "" "1. 在下方输入您的 ICP 许可证信息。 (找到我的许可证?)" -#: wpicp-license.php:120 +#: wpicp-license.php:174 msgid "" "2. Use the shortcode [wpicp_license] to display the license " "information and link on your website. (集成到主题?)" -#: wpicp-license.php:127 +#: wpicp-license.php:181 msgid "" "Enter your ICP license number information. (Correct " "format?)" msgstr "" -"输入您的备案号。(正确格式?)" +"输入您的备案号。(正确格式?)" -#: wpicp-license.php:131 +#: wpicp-license.php:185 msgid "" "Use the shortcode [wpicp_wangan], You need to register with the " "Public Security Bureau (PSB) to have this license. " msgstr "" "使用简码[wpicp_wangan],您需要在公安局(PSB)注册才能获得此备案" -"许可证。 (什么是公共安全备案?)" +"许可证。 (什么是公共安全备案?)" -#: wpicp-license.php:189 +#: wpicp-license.php:243 msgid "" "Enter your Wangan license number and select the abbreviation of your " "province." msgstr "输入您的网安备案号并选择您所在省份的简称。" -#: wpicp-license.php:199 +#: wpicp-license.php:251 +msgid "Use the shortcode [wpicp_company]" +msgstr "使用简码 [wpicp_company]" + +#: wpicp-license.php:258 +msgid "Use the shortcode [wpicp_email]" +msgstr "使用简码 [wpicp_email]" + +#: wpicp-license.php:265 +msgid "Use the shortcode [wpicp_phone]" +msgstr "使用简码 [wpicp_phone]" + +#: wpicp-license.php:272 +msgid "Use the shortcode [wpicp_edi]" +msgstr "使用简码 [wpicp_edi]" + +#: wpicp-license.php:279 +msgid "Use the shortcode [wpicp_app]" +msgstr "使用简码 [wpicp_app]" + +#: wpicp-license.php:285 +msgid "Use the shortcode [wpicp_minipapp]" +msgstr "使用简码 [wpicp_minipapp]" + +#: wpicp-license.php:294 msgid "ICP License Settings" msgstr "ICP 许可证设置" diff --git a/languages/wpicp-license-zh_TW.mo b/languages/wpicp-license-zh_TW.mo old mode 100644 new mode 100755 diff --git a/languages/wpicp-license-zh_TW.po b/languages/wpicp-license-zh_TW.po old mode 100644 new mode 100755 diff --git a/license.txt b/license.txt old mode 100644 new mode 100755 diff --git a/readme.txt b/readme.txt old mode 100644 new mode 100755 index aff4ee4..f63d82e --- 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.2 +Tested up to: 6.6 Requires PHP: 5.6 -Stable tag: 1.2 +Stable tag: 1.3 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -68,6 +68,12 @@ Starting with WP ICP License consists of just two steps: installing and setting == Changelog == +### 1.3 ### + +* Add Chinese company name and EDI/APP/MiniAPP ICP license short codes. +* Use short code [wpicp_company] to display full company name. +* Use short code [wpicp_email] to display report email. +* Use short code [wpicp_phone] to display complaint hotline. ### 1.2 ### diff --git a/wpicp-license.php b/wpicp-license.php old mode 100644 new mode 100755 index fb65100..8d5d767 --- 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.2 + * Version: 1.3 * Network: True * License: GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -86,10 +86,64 @@ 'wpicp_license_section' ); + add_settings_field( + 'wpicp_company', + __('Company Name', 'wpicp-license'), + 'wpicp_company_field_callback', + 'wpicp_license_settings', + 'wpicp_license_section' + ); + + add_settings_field( + 'wpicp_email', + __('Report Email', 'wpicp-license'), + 'wpicp_email_field_callback', + 'wpicp_license_settings', + 'wpicp_license_section' + ); + + add_settings_field( + 'wpicp_phone', + __('Complaint Hotline', 'wpicp-license'), + 'wpicp_phone_field_callback', + 'wpicp_license_settings', + 'wpicp_license_section' + ); + + add_settings_field( + 'wpicp_edi', + __('EDI License Number', 'wpicp-license'), + 'wpicp_edi_field_callback', + 'wpicp_license_settings', + 'wpicp_license_section' + ); + + add_settings_field( + 'wpicp_app', + __('APP License Number', 'wpicp-license'), + 'wpicp_app_field_callback', + 'wpicp_license_settings', + 'wpicp_license_section' + ); + + add_settings_field( + 'wpicp_minipapp', + __('MiniAPP License Number', 'wpicp-license'), + 'wpicp_minipapp_field_callback', + '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' ); + register_setting( 'wpicp_license_settings', 'wpicp_company'); + register_setting( 'wpicp_license_settings', 'wpicp_email' ); + register_setting( 'wpicp_license_settings', 'wpicp_phone' ); + register_setting( 'wpicp_license_settings', 'wpicp_edi'); + register_setting( 'wpicp_license_settings', 'wpicp_app'); + register_setting( 'wpicp_license_settings', 'wpicp_minipapp'); + } @@ -191,6 +245,47 @@ function wpicp_wangan_field_callback() { '; + echo '

' . __( 'Use the shortcode [wpicp_company]', 'wpicp-license' ) . '

'; + +} + +function wpicp_email_field_callback() { + $company = get_option('wpicp_email'); + echo ''; + echo '

' . __( 'Use the shortcode [wpicp_email]', 'wpicp-license' ) . '

'; + +} + +function wpicp_phone_field_callback() { + $company = get_option('wpicp_phone'); + echo ''; + echo '

' . __( 'Use the shortcode [wpicp_phone]', 'wpicp-license' ) . '

'; + +} + +function wpicp_edi_field_callback() { + $edi = get_option('wpicp_edi'); + echo ''; + echo '

' . __( 'Use the shortcode [wpicp_edi]', 'wpicp-license' ) . '

'; + +} + +function wpicp_app_field_callback() { + $app = get_option('wpicp_app'); + echo ''; + echo '

' . __( 'Use the shortcode [wpicp_app]', 'wpicp-license' ) . '

'; +} + +function wpicp_minipapp_field_callback() { + $minipapp = get_option('wpicp_minipapp'); + echo ''; + echo '

' . __( 'Use the shortcode [wpicp_minipapp]', 'wpicp-license' ) . '

'; + +} + // Settings page callback function wpicp_license_settings_page() { @@ -207,5 +302,17 @@ function wpicp_license_settings_page() { } +// Ensure this code runs after other plugins have loaded +add_action('plugins_loaded', 'wpicp_sync_cn_settings'); + +function wpicp_sync_cn_settings() { + if (get_option('wpicp_license') == '' && get_option('cn_icp') != '') { + update_option('wpicp_license', get_option('cn_icp')); + } + if (get_option('wpicp_wangan') == '' && get_option('cn_ga') != '') { + update_option('wpicp_wangan', get_option('cn_ga')); + } +} + ?>