Plugin Directory

Changeset 2709464


Ignore:
Timestamp:
04/14/2022 01:01:04 AM (4 years ago)
Author:
bestony
Message:

Update to version 0.0.4 from GitHub

Location:
copy-text-to-wechat
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • copy-text-to-wechat/tags/0.0.4/copytowechat.php

    r2706693 r2709464  
    44 * Plugin URI:        https://www.wpstore.app/
    55 * Description:       自媒体平台快速发布插件支持通过在文章页面添加 ?wx 后缀,生成微信公众号后台的样式和快速复制按钮,帮助用户快速完成从 WordPress 到微信公众号文章发布。
    6  * Version:           0.0.3
     6 * Version:           0.0.4
    77 * Requires at least: 5.9
    88 * Requires PHP:      7.2
     
    1919    public function init()
    2020    {
    21         add_action('admin_init', [$this,'settings_init']);
     21        add_action('admin_init', [$this, 'settings_init']);
    2222
    2323    }
     
    2727        add_settings_section(
    2828            'settings_section',
    29             'Copy To WeChat Settings Section', [$this,'settings_section_callback'],
     29            'Copy To WeChat Settings Section', [$this, 'settings_section_callback'],
    3030            'reading'
    3131        );
    3232        add_settings_field(
    3333            'settings_field',
    34             'CSS', [$this,'settings_field_callback'],
     34            'CSS', [$this, 'settings_field_callback'],
    3535            'reading',
    3636            'settings_section'
     
    4444    public function settings_field_callback()
    4545    {
    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>
     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>
    5151        <?php
    52     }
     52}
    5353}
    5454class WPStoreApp_CopyToWechat
     
    8686        if ($this->is_should_show()) {
    8787            $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>';
    9090        } else {
    9191            return $content;
     
    9898        $titleButton = '<button class="copytowechat" data-clipboard-text="' . get_the_title() . '">复制文章标题</button>';
    9999        $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>';
    101102    }
    102103    private function is_should_show()
  • copy-text-to-wechat/tags/0.0.4/readme.txt

    r2706693 r2709464  
    55Requires at least: 5.9
    66Tested up to: 5.9
    7 Stable tag: 0.0.3
     7Stable tag: 0.0.4
    88Requires PHP: 7.2
    99License: GPLv3
     
    3737
    3838== Changelog ==
     39= 0.0.4 =
     40* 新增复制作者
    3941= 0.0.3 =
    4042* 修复代码提示
  • copy-text-to-wechat/trunk/copytowechat.php

    r2706693 r2709464  
    44 * Plugin URI:        https://www.wpstore.app/
    55 * Description:       自媒体平台快速发布插件支持通过在文章页面添加 ?wx 后缀,生成微信公众号后台的样式和快速复制按钮,帮助用户快速完成从 WordPress 到微信公众号文章发布。
    6  * Version:           0.0.3
     6 * Version:           0.0.4
    77 * Requires at least: 5.9
    88 * Requires PHP:      7.2
     
    1919    public function init()
    2020    {
    21         add_action('admin_init', [$this,'settings_init']);
     21        add_action('admin_init', [$this, 'settings_init']);
    2222
    2323    }
     
    2727        add_settings_section(
    2828            'settings_section',
    29             'Copy To WeChat Settings Section', [$this,'settings_section_callback'],
     29            'Copy To WeChat Settings Section', [$this, 'settings_section_callback'],
    3030            'reading'
    3131        );
    3232        add_settings_field(
    3333            'settings_field',
    34             'CSS', [$this,'settings_field_callback'],
     34            'CSS', [$this, 'settings_field_callback'],
    3535            'reading',
    3636            'settings_section'
     
    4444    public function settings_field_callback()
    4545    {
    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>
     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>
    5151        <?php
    52     }
     52}
    5353}
    5454class WPStoreApp_CopyToWechat
     
    8686        if ($this->is_should_show()) {
    8787            $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>';
    9090        } else {
    9191            return $content;
     
    9898        $titleButton = '<button class="copytowechat" data-clipboard-text="' . get_the_title() . '">复制文章标题</button>';
    9999        $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>';
    101102    }
    102103    private function is_should_show()
  • copy-text-to-wechat/trunk/readme.txt

    r2706693 r2709464  
    55Requires at least: 5.9
    66Tested up to: 5.9
    7 Stable tag: 0.0.3
     7Stable tag: 0.0.4
    88Requires PHP: 7.2
    99License: GPLv3
     
    3737
    3838== Changelog ==
     39= 0.0.4 =
     40* 新增复制作者
    3941= 0.0.3 =
    4042* 修复代码提示
Note: See TracChangeset for help on using the changeset viewer.