Changeset 2709464
- Timestamp:
- 04/14/2022 01:01:04 AM (4 years ago)
- Location:
- copy-text-to-wechat
- Files:
-
- 4 edited
- 1 copied
-
tags/0.0.4 (copied) (copied from copy-text-to-wechat/trunk)
-
tags/0.0.4/copytowechat.php (modified) (6 diffs)
-
tags/0.0.4/readme.txt (modified) (2 diffs)
-
trunk/copytowechat.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
copy-text-to-wechat/tags/0.0.4/copytowechat.php
r2706693 r2709464 4 4 * Plugin URI: https://www.wpstore.app/ 5 5 * Description: 自媒体平台快速发布插件支持通过在文章页面添加 ?wx 后缀,生成微信公众号后台的样式和快速复制按钮,帮助用户快速完成从 WordPress 到微信公众号文章发布。 6 * Version: 0.0. 36 * Version: 0.0.4 7 7 * Requires at least: 5.9 8 8 * Requires PHP: 7.2 … … 19 19 public function init() 20 20 { 21 add_action('admin_init', [$this, 'settings_init']);21 add_action('admin_init', [$this, 'settings_init']); 22 22 23 23 } … … 27 27 add_settings_section( 28 28 'settings_section', 29 'Copy To WeChat Settings Section', [$this, 'settings_section_callback'],29 'Copy To WeChat Settings Section', [$this, 'settings_section_callback'], 30 30 'reading' 31 31 ); 32 32 add_settings_field( 33 33 'settings_field', 34 'CSS', [$this, 'settings_field_callback'],34 'CSS', [$this, 'settings_field_callback'], 35 35 'reading', 36 36 'settings_section' … … 44 44 public function settings_field_callback() 45 45 { 46 // get the value of the setting we've registered with register_setting()47 $setting = get_option('copy_to_wechat_css');48 // output the field49 ?>50 <textarea cols='40' rows='5' name="copy_to_wechat_css"><?php echo isset($setting) ? esc_attr($setting) : ''; ?></textarea>46 // get the value of the setting we've registered with register_setting() 47 $setting = get_option('copy_to_wechat_css'); 48 // output the field 49 ?> 50 <textarea cols='40' rows='5' name="copy_to_wechat_css"><?php echo isset($setting) ? esc_attr($setting) : ''; ?></textarea> 51 51 <?php 52 }52 } 53 53 } 54 54 class WPStoreApp_CopyToWechat … … 86 86 if ($this->is_should_show()) { 87 87 $css = get_option('copy_to_wechat_css'); 88 $cssCode = '<style>' .$css.'</style>';89 return $cssCode . $copyButton . '<div id="copytowechat-content">' . $imgCode . $content . '</div>';88 $cssCode = '<style>' . $css . '</style>'; 89 return $cssCode . $copyButton . '<div id="copytowechat-content">' . $imgCode . $content . '</div>'; 90 90 } else { 91 91 return $content; … … 98 98 $titleButton = '<button class="copytowechat" data-clipboard-text="' . get_the_title() . '">复制文章标题</button>'; 99 99 $linkButton = '<button class="copytowechat" data-clipboard-text="' . get_permalink() . '">复制阅读原文链接</button>'; 100 return '<p>' . $titleButton . $contentButton . $linkButton . '</p>'; 100 $userButton = '<button class="copytowechat" data-clipboard-text="' . get_the_author() . '">复制阅读作者名</button>'; 101 return '<p>' . $titleButton .$userButton . $contentButton . $linkButton . '</p>'; 101 102 } 102 103 private function is_should_show() -
copy-text-to-wechat/tags/0.0.4/readme.txt
r2706693 r2709464 5 5 Requires at least: 5.9 6 6 Tested up to: 5.9 7 Stable tag: 0.0. 37 Stable tag: 0.0.4 8 8 Requires PHP: 7.2 9 9 License: GPLv3 … … 37 37 38 38 == Changelog == 39 = 0.0.4 = 40 * 新增复制作者 39 41 = 0.0.3 = 40 42 * 修复代码提示 -
copy-text-to-wechat/trunk/copytowechat.php
r2706693 r2709464 4 4 * Plugin URI: https://www.wpstore.app/ 5 5 * Description: 自媒体平台快速发布插件支持通过在文章页面添加 ?wx 后缀,生成微信公众号后台的样式和快速复制按钮,帮助用户快速完成从 WordPress 到微信公众号文章发布。 6 * Version: 0.0. 36 * Version: 0.0.4 7 7 * Requires at least: 5.9 8 8 * Requires PHP: 7.2 … … 19 19 public function init() 20 20 { 21 add_action('admin_init', [$this, 'settings_init']);21 add_action('admin_init', [$this, 'settings_init']); 22 22 23 23 } … … 27 27 add_settings_section( 28 28 'settings_section', 29 'Copy To WeChat Settings Section', [$this, 'settings_section_callback'],29 'Copy To WeChat Settings Section', [$this, 'settings_section_callback'], 30 30 'reading' 31 31 ); 32 32 add_settings_field( 33 33 'settings_field', 34 'CSS', [$this, 'settings_field_callback'],34 'CSS', [$this, 'settings_field_callback'], 35 35 'reading', 36 36 'settings_section' … … 44 44 public function settings_field_callback() 45 45 { 46 // get the value of the setting we've registered with register_setting()47 $setting = get_option('copy_to_wechat_css');48 // output the field49 ?>50 <textarea cols='40' rows='5' name="copy_to_wechat_css"><?php echo isset($setting) ? esc_attr($setting) : ''; ?></textarea>46 // get the value of the setting we've registered with register_setting() 47 $setting = get_option('copy_to_wechat_css'); 48 // output the field 49 ?> 50 <textarea cols='40' rows='5' name="copy_to_wechat_css"><?php echo isset($setting) ? esc_attr($setting) : ''; ?></textarea> 51 51 <?php 52 }52 } 53 53 } 54 54 class WPStoreApp_CopyToWechat … … 86 86 if ($this->is_should_show()) { 87 87 $css = get_option('copy_to_wechat_css'); 88 $cssCode = '<style>' .$css.'</style>';89 return $cssCode . $copyButton . '<div id="copytowechat-content">' . $imgCode . $content . '</div>';88 $cssCode = '<style>' . $css . '</style>'; 89 return $cssCode . $copyButton . '<div id="copytowechat-content">' . $imgCode . $content . '</div>'; 90 90 } else { 91 91 return $content; … … 98 98 $titleButton = '<button class="copytowechat" data-clipboard-text="' . get_the_title() . '">复制文章标题</button>'; 99 99 $linkButton = '<button class="copytowechat" data-clipboard-text="' . get_permalink() . '">复制阅读原文链接</button>'; 100 return '<p>' . $titleButton . $contentButton . $linkButton . '</p>'; 100 $userButton = '<button class="copytowechat" data-clipboard-text="' . get_the_author() . '">复制阅读作者名</button>'; 101 return '<p>' . $titleButton .$userButton . $contentButton . $linkButton . '</p>'; 101 102 } 102 103 private function is_should_show() -
copy-text-to-wechat/trunk/readme.txt
r2706693 r2709464 5 5 Requires at least: 5.9 6 6 Tested up to: 5.9 7 Stable tag: 0.0. 37 Stable tag: 0.0.4 8 8 Requires PHP: 7.2 9 9 License: GPLv3 … … 37 37 38 38 == Changelog == 39 = 0.0.4 = 40 * 新增复制作者 39 41 = 0.0.3 = 40 42 * 修复代码提示
Note: See TracChangeset
for help on using the changeset viewer.