{"id":3780,"date":"2020-03-16T20:15:36","date_gmt":"2020-03-16T12:15:36","guid":{"rendered":"http:\/\/www.wpadmin.cn\/blog\/?p=3780"},"modified":"2020-03-16T20:31:18","modified_gmt":"2020-03-16T12:31:18","slug":"wordpress%e6%8f%92%e4%bb%b6%e5%bc%80%e5%8f%91%e6%95%99%e7%a8%8b%e4%b8%80%ef%bc%9a%e5%88%9b%e5%bb%ba%e3%80%81%e5%81%9c%e7%94%a8%e3%80%81%e5%88%a0%e9%99%a4%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.wpadmin.cn\/blog\/3780.html","title":{"rendered":"WordPress\u63d2\u4ef6\u5f00\u53d1\u6559\u7a0b\u4e00\uff1a\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6"},"content":{"rendered":"<p>\u6709\u5f88\u591a wordpress \u65b9\u9762\u7684\u6559\u7a0b\uff0c\u4e5f\u6709\u5f88\u591a WordPress \u63d2\u4ef6\u65b9\u9762\u7684\u63a8\u8350\u548c\u6559\u7a0b\uff0c\u4f46\u662f WordPress \u63d2\u4ef6\u5f00\u53d1\u65b9\u9762\u7684\u6559\u7a0b\u5374\u6ca1\u6709\u3002\u7f51\u7edc\u4e0a\u4e5f\u6709\u4e00\u4e9b\u63d2\u4ef6\u5f00\u53d1\u7684\u7cfb\u5217\u6587\u7ae0\uff0c\u4e0d\u8fc7\u597d\u50cf\u90fd\u6ca1\u6709\u60f3\u8fc7\u8981\u53bb\u642c\u7816\uff0c\u4e00\u4e2a\u4f18\u79c0\u7684\u63d2\u4ef6\u90fd\u662f\u4ece 0 \u5f00\u59cb\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u4ece\u521b\u5efa\u63d2\u4ef6\u5f00\u59cb\u3002<\/p>\n<h2>\u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6<\/h2>\n<p>\u5728 wp-content\/plugins \u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u547d\u540d\u6700\u597d\u52a0\u524d\u7f00\uff0cWordPress \u5b98\u65b9\u73b0\u5728\u5e94\u8be5\u6536\u5f55\u4e86\u6709 50000 \u591a\u4e2a\u63d2\u4ef6\uff0c\u6240\u4ee5\u8981\u8d77\u4e00\u4e2a\u7279\u6b8a\u7684\u540d\u79f0\uff0c\u9632\u6b62\u63d2\u4ef6\u548c\u522b\u4eba\u91cd\u540d\u3002<\/p>\n<p>\u518d\u521b\u5efa\u4e00\u4e2a PHP \u6587\u4ef6\u540d\u5b57\u548c\u4f60\u7684\u63d2\u4ef6\u540d\u7c7b\u4f3c\u6216\u4e00\u6837\uff0c\u6211\u8fd9\u91cc\u4ee5\u524d\u6bb5\u65f6\u95f4\u5f00\u53d1\u7684 PushWordPressToWeChat \u4e3a\u4f8b\uff0c\u521b\u5efa\u4e00\u4e2a PushWordPressToWeChat.php \u6587\u4ef6\uff0c\u7136\u540e\u4e3a\u4e86\u8ba9 WordPress \u540e\u53f0\u80fd\u591f\u8bc6\u522b\u6211\u4eec\u7684\u63d2\u4ef6\uff0c\u8fd8\u9700\u8981\u6309\u7167\u5b83\u7684\u6807\u51c6\u589e\u52a0\u63d2\u4ef6\u4fe1\u606f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\"> \r\n   \/*\r\n    Plugin Name: Push WordPress To WeChat\r\n    Plugin URI: https:\/\/qq52o.me\/2650.html\r\n    Description: \u57fa\u4e8e PushBear \u670d\u52a1\u63d0\u4f9b WordPress \u5185\u5bb9\u66f4\u65b0\u5fae\u4fe1\u8ba2\u9605\u63a8\u9001\u7684\u63d2\u4ef6\r\n    Author: \u6c88\u5501\r\n    Version: 1.0.0\r\n    Author URI: https:\/\/qq52o.me\r\n    *\/\r\n<\/pre>\n<h2>\u542f\u7528\u63d2\u4ef6<\/h2>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction pwtw_submit_default_options()\r\n    {\r\n    \/\/ \u83b7\u53d6\u9009\u9879\r\n    $default = get_option('PushWordPressToWeChat');\r\n    if($default == '') {\r\n    \/\/ \u8bbe\u7f6e\u9ed8\u8ba4\u6570\u636e\r\n    $default = array(\r\n    'SendKey' =&gt; '',\r\n    'Default' =&gt; '',\r\n    'Delete' =&gt; '',\r\n    );\r\n    \/\/\u66f4\u65b0\u9009\u9879\r\n    update_option('PushWordPressToWeChat', $default);\r\n    }\r\n    }\r\n    register_activation_hook( __FILE__, 'pwtw_submit_default_options' );\r\n<\/pre>\n<h2>\u505c\u7528\u63d2\u4ef6<\/h2>\n<p>\u6211\u4eec\u7684\u63d2\u4ef6\u5efa\u8bae\u8fd8\u662f\u63d0\u4f9b\u4e00\u4e2a\u9009\u9879\u8ba9\u7528\u6237\u9009\u62e9\uff0c\u505c\u7528\u65f6\u662f\u5426\u5220\u9664\u6211\u4eec\u63d2\u4ef6\u7ed9 wp_options \u8868\u4e2d\u589e\u52a0\u7684\u5b57\u6bb5\uff0c\u907f\u514d\u6570\u636e\u5e93\u810f\u6570\u636e\u8fc7\u591a\u3002\u8fd9\u4e2a\u65f6\u5019\u53ef\u4ee5\u4f7f\u7528 register_deactivation_hook \u65b9\u6cd5\u56de\u8c03\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\"> function pwtw_stop_option()\r\n    {\r\n    $option = get_option('PushWordPressToWeChat');\r\n    if ($option&#x5B;'Delete']) {\r\n    delete_option(&quot;PushWordPressToWeChat&quot;);\r\n    }\r\n    }\r\n    register_deactivation_hook(__FILE__, 'pwtw_stop_option');<\/pre>\n<h2>\u5220\u9664\u63d2\u4ef6<\/h2>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\"> &lt;?php\r\n    \/\/ \u5224\u65ad\u662f\u4e0d\u662f\u4ece WordPress \u540e\u53f0\u8c03\u7528\u7684\r\n    if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {\r\n    exit;\r\n    }\r\n    delete_option(&quot;PushWordPressToWeChat&quot;);\r\n    ?&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5f88\u591a wordpress \u65b9\u9762\u7684\u6559\u7a0b\uff0c\u4e5f\u6709\u5f88\u591a WordPress \u63d2\u4ef6\u65b9\u9762\u7684\u63a8\u8350\u548c\u6559\u7a0b\uff0c\u4f46\u662f WordPress \u63d2\u4ef6\u5f00\u53d1\u65b9\u9762\u7684\u6559\u7a0b\u5374\u6ca1\u6709\u3002\u7f51\u7edc\u4e0a\u4e5f\u6709\u4e00\u4e9b\u63d2&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[123],"tags":[225],"_links":{"self":[{"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/posts\/3780"}],"collection":[{"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/comments?post=3780"}],"version-history":[{"count":0,"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/posts\/3780\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/media?parent=3780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/categories?post=3780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wpadmin.cn\/blog\/wp-json\/wp\/v2\/tags?post=3780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}