{"id":31930,"date":"2024-11-25T12:14:30","date_gmt":"2024-11-25T04:14:30","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31930\/"},"modified":"2024-11-25T12:14:30","modified_gmt":"2024-11-25T04:14:30","slug":"%e8%bf%9b%e8%a1%8cwordpress%e6%8f%92%e4%bb%b6%e5%bc%80%e5%8f%91-%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:\/\/fwq.ai\/blog\/31930\/","title":{"rendered":"\u8fdb\u884cWordPress\u63d2\u4ef6\u5f00\u53d1-\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6"},"content":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;<strong>wordpress<\/strong>\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecdwordpress\u63d2\u4ef6\u5f00\u53d1-\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/6034af6f22c40561.jpg\" class=\"aligncenter\" title=\"\u8fdb\u884cWordPress\u63d2\u4ef6\u5f00\u53d1-\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6\u63d2\u56fe\" alt=\"\u8fdb\u884cWordPress\u63d2\u4ef6\u5f00\u53d1-\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6\u63d2\u56fe\" \/><\/p>\n<h2>\u63d2\u4ef6\u5b58\u653e\u76ee\u5f55<\/h2>\n<p>wp-content\/plugins<\/p>\n<h2>\u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6<\/h2>\n<p>\u5728plugins\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u63d2\u4ef6\u6587\u4ef6\u5939\uff0c\u547d\u540d\u6700\u597d\u52a0\u524d\u7f00\uff0c\u8fd9\u4e2a\u524d\u7f00\u53ef\u4ee5\u4f7f\u7528\u4f60\u7684\u540d\u5b57\u6216\u8005\u4f60\u81ea\u5df1\u7684\u57df\u540d\uff0c\u9632\u6b62\u63d2\u4ef6\u548c\u522b\u4eba\u91cd\u540d\uff0c\u518d\u521b\u5efa\u4e00\u4e2aPHP\u6587\u4ef6\u540d\u5b57\u548c\u4f60\u7684\u63d2\u4ef6\u540d\u4e00\u6837\u3002<br \/>\u6211\u8fd9\u91cc\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a yg-footer-copyright \u7684\u63d2\u4ef6\u3002<\/p>\n<h2>\u8ba9WordPress\u8bc6\u522b\u6211\u4eec\u7684\u63d2\u4ef6<\/h2>\n<p>\u521b\u5efa\u4e86\u63d2\u4ef6\u540eWordPress\u540e\u53f0\u5e76\u4e0d\u80fd\u8bc6\u522b\u5230\u6211\u4eec\u7684\u63d2\u4ef6\uff0c\u90a3\u662f\u56e0\u4e3a\u6211\u4eec\u6ca1\u6309\u7167\u4ed6\u7684\u6807\u51c6\u5199\u63d2\u4ef6\u4fe1\u606f\u3002<\/p>\n<p>\u5728\u4f60\u63d2\u4ef6\u5165\u53e3 yg-footer-copyright.php \u6587\u4ef6\u5934\u90e8\u5199\u5165\u63d2\u4ef6\u4fe1\u606f\u3002<\/p>\n<pre>&lt;?php\n\/*\nPlugin Name: \u63d2\u4ef6\u540d\u79f0\nPlugin URI: http:\/\/URI_Of_Page_Describing_Plugin_and_Updates\nDescription: \u63d2\u4ef6\u7684\u7b80\u5355\u63cf\u8ff0\nVersion: \u63d2\u4ef6\u7248\u672c\u53f7, \u4f8b\u5982: 1.0\nAuthor: \u63d2\u4ef6\u4f5c\u8005\nAuthor URI: http:\/\/URI_Of_The_Plugin_Author\u4f5c\u8005\u5730\u5740\n*\/\n?&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u65f6\u518d\u53bb\u770bWordPress\u540e\u53f0\u5c31\u80fd\u770b\u5230\u4f60\u521b\u5efa\u7684\u63d2\u4ef6\u4e86\u3002<\/p>\n<h2>\u63d2\u4ef6\u542f\u7528\u65f6\u8c03\u7528\u65b9\u6cd5<\/h2>\n<p>\u901a\u8fc7 register_activation_hook \u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u6dfb\u52a0\u63d2\u4ef6\u542f\u7528\u65f6\u56de\u8c03\u3002<\/p>\n<p>\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/codex.wordpress.org\/F&#8230;<\/p>\n<pre>function ygcopyright_install() {\n    update_option(\"yg-copyright\",\"&lt;p&gt;\u7248\u6743\u4fe1\u606f&lt;\/p&gt;\");\n}\n\/\/\u542f\u7528\u63d2\u4ef6\u65f6\u8c03\u7528\u7684\u65b9\u6cd5\nregister_activation_hook( __FILE__, 'ygcopyright_install' );<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u5728\u542f\u52a8\u65f6\u5728option\u8868\u4e2d\u65b0\u589e\u4e00\u4e2ayg-copyright\u5b57\u6bb5\u3002<\/p>\n<h2>\u63d2\u4ef6\u505c\u7528\u65f6\u8c03\u7528\u65b9\u6cd5<\/h2>\n<p>\u901a\u8fc7 register_deactivation_hook \u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u6dfb\u52a0\u63d2\u4ef6\u505c\u7528\u65f6\u56de\u8c03\u3002<\/p>\n<p>\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/codex.wordpress.org\/F&#8230;<\/p>\n<pre>function ygcopyright_stop(){\n    update_option(\"yg-copyright\",\"yes\");\n} \n\/\/\u505c\u7528\u63d2\u4ef6\u65f6\u7684\u65b9\u6cd5\nregister_deactivation_hook( __FILE__, 'ygcopyright_stop' );<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u5728\u505c\u7528\u65f6\u628aoption\u8868\u4e2dyg-copyright\u5b57\u6bb5\u6539\u4e3ayes\u3002<\/p>\n<h2>\u63d2\u4ef6\u5220\u9664\u65f6\u64cd\u4f5c<\/h2>\n<p>\u5f53\u63d2\u4ef6\u88ab\u5220\u9664\u65f6\u9ed8\u8ba4\u4f1a\u5728\u63d2\u4ef6\u76ee\u5f55\u4e0b\u627e uninstall.php \u6587\u4ef6\uff0c\u5e76\u8c03\u7528\u91cc\u9762\u7684\u65b9\u6cd5\u3002<\/p>\n<pre>&lt;?php\n\/\/\u5224\u65ad\u662f\u4e0d\u662f\u4eceWordPress\u540e\u53f0\u8c03\u7528\u7684\nif(!defined(\"WP_UNINSTALL_PLUGIN\"))\nexit();\n\ndelete_option(\"yg-copyright\");\n?&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u6700\u597d\u5728uninstall.php \u6587\u4ef6\u5934\u6dfb\u52a0\u5224\u65ad\u662f\u5426\u662fWordPress\u540e\u53f0\u8c03\u7528\u7684\uff0c\u9632\u6b62\u522b\u4eba\u76f4\u63a5\u8c03\u7528\u8fd9\u6587\u4ef6\uff0c\u628a\u63d2\u4ef6\u5220\u9664\u3002<br \/>\u8fd9\u91cc\u6211\u4eec\u5728\u505c\u7528\u65f6\u628aoption\u8868\u4e2dyg-copyright\u5b57\u6bb5\u5220\u9664\u3002<\/p>\n<p>\u5982\u679c\u6709\u4ec0\u4e48\u95ee\u9898\u6b22\u8fce\u7559\u8a00\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8fdb\u884cWordPress\u63d2\u4ef6\u5f00\u53d1-\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;wordpress\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecdwordpress\u63d2\u4ef6\u5f00\u53d1-\u521b\u5efa\u3001\u505c\u7528\u3001\u5220\u9664\u63d2\u4ef6\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01 \u63d2\u4ef6\u5b58\u653e\u76ee\u5f55 wp-content\/plugins \u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6 \u5728plugins\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u63d2\u4ef6\u6587\u4ef6\u5939\uff0c\u547d\u540d\u6700\u597d\u52a0\u524d\u7f00\uff0c\u8fd9\u4e2a\u524d\u7f00\u53ef\u4ee5\u4f7f\u7528\u4f60\u7684\u540d\u5b57\u6216\u8005\u4f60\u81ea\u5df1\u7684\u57df\u540d\uff0c\u9632\u6b62\u63d2\u4ef6\u548c\u522b\u4eba\u91cd\u540d\uff0c\u518d\u521b\u5efa\u4e00\u4e2aPHP\u6587\u4ef6\u540d\u5b57\u548c\u4f60\u7684\u63d2\u4ef6\u540d\u4e00\u6837\u3002\u6211\u8fd9\u91cc\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a yg-footer-copyright \u7684\u63d2\u4ef6\u3002 \u8ba9WordPress\u8bc6\u522b\u6211\u4eec\u7684\u63d2\u4ef6 \u521b\u5efa\u4e86\u63d2\u4ef6\u540eWordPress\u540e\u53f0\u5e76\u4e0d\u80fd\u8bc6\u522b\u5230\u6211\u4eec\u7684\u63d2\u4ef6\uff0c\u90a3\u662f\u56e0\u4e3a\u6211\u4eec\u6ca1\u6309\u7167\u4ed6\u7684\u6807\u51c6\u5199\u63d2\u4ef6\u4fe1\u606f\u3002 \u5728\u4f60\u63d2\u4ef6\u5165\u53e3 yg-footer-copyright.php \u6587\u4ef6\u5934\u90e8\u5199\u5165\u63d2\u4ef6\u4fe1\u606f\u3002 &lt;?php \/* Plugin Name: \u63d2\u4ef6\u540d\u79f0 Plugin URI: http:\/\/URI_Of_Page_Describing_Plugin_and_Updates Description: \u63d2\u4ef6\u7684\u7b80\u5355\u63cf\u8ff0 Version: \u63d2\u4ef6\u7248\u672c\u53f7, \u4f8b\u5982: 1.0 Author: \u63d2\u4ef6\u4f5c\u8005 Author URI: http:\/\/URI_Of_The_Plugin_Author\u4f5c\u8005\u5730\u5740 *\/ ?&gt; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u65f6\u518d\u53bb\u770bWordPress\u540e\u53f0\u5c31\u80fd\u770b\u5230\u4f60\u521b\u5efa\u7684\u63d2\u4ef6\u4e86\u3002 \u63d2\u4ef6\u542f\u7528\u65f6\u8c03\u7528\u65b9\u6cd5 \u901a\u8fc7 register_activation_hook \u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u6dfb\u52a0\u63d2\u4ef6\u542f\u7528\u65f6\u56de\u8c03\u3002 \u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/codex.wordpress.org\/F&#8230; function ygcopyright_install() { update_option(&#8220;yg-copyright&#8221;,&#8221;&lt;p&gt;\u7248\u6743\u4fe1\u606f&lt;\/p&gt;&#8221;); } \/\/\u542f\u7528\u63d2\u4ef6\u65f6\u8c03\u7528\u7684\u65b9\u6cd5 register_activation_hook( __FILE__, &#8216;ygcopyright_install&#8217; ); \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u6211\u4eec\u5728\u542f\u52a8\u65f6\u5728option\u8868\u4e2d\u65b0\u589e\u4e00\u4e2ayg-copyright\u5b57\u6bb5\u3002 \u63d2\u4ef6\u505c\u7528\u65f6\u8c03\u7528\u65b9\u6cd5 \u901a\u8fc7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-31930","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=31930"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31930\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}