{"id":30257,"date":"2024-11-25T10:35:32","date_gmt":"2024-11-25T02:35:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30257\/"},"modified":"2024-11-25T10:35:32","modified_gmt":"2024-11-25T02:35:32","slug":"%e5%a6%82%e4%bd%95%e9%9a%90%e8%97%8f%e5%b7%b2%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30257\/","title":{"rendered":"\u5982\u4f55\u9690\u85cf\u5df2\u5b89\u88c5\u7684WordPress\u63d2\u4ef6"},"content":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;<strong>wordpress\u5165\u95e8\u6559\u7a0b<\/strong>\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u9690\u85cf\u5df2\u5b89\u88c5\u7684wordpress\u63d2\u4ef6\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5df1e8bfdd1c2742.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u9690\u85cf\u5df2\u5b89\u88c5\u7684WordPress\u63d2\u4ef6\u63d2\u56fe\" alt=\"\u5982\u4f55\u9690\u85cf\u5df2\u5b89\u88c5\u7684WordPress\u63d2\u4ef6\u63d2\u56fe\" \/><\/p>\n<p>\u5982\u679c\u4e0d\u60f3\u8ba9\u5176\u4ed6\u767b\u5f55\u7684\u7528\u6237\u770b\u5230\u5df2\u5b89\u88c5\u7684\u67d0\u4e2a\u63d2\u4ef6\uff0c\u672c\u6587\u7684\u65b9\u6cd5\u5c06\u8f7b\u677e\u5730\u9690\u85cf\u4e00\u4e2aWordPress\u63d2\u4ef6\uff0c\u800c\u4e0d\u5f71\u54cd\u63d2\u4ef6\u6b63\u5e38\u5de5\u4f5c\uff0c\u53ea\u662f\u4e0d\u4f1a\u51fa\u73b0\u5728\u63d2\u4ef6\u5217\u8868\u4e2d\u3002<\/p>\n<p>\u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u5f53\u524d\u4e3b\u9898functions.php\u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre>function&nbsp;hide_plugin_trickspanda()&nbsp;{\n&nbsp;&nbsp;global&nbsp;$wp_list_table;\n&nbsp;&nbsp;$hidearr&nbsp;=&nbsp;array('plugin-directory\/plugin-file.php');\n&nbsp;&nbsp;$myplugins&nbsp;=&nbsp;$wp_list_table-&amp;gt;items;\n&nbsp;&nbsp;foreach&nbsp;($myplugins&nbsp;as&nbsp;$key&nbsp;=&amp;gt;&nbsp;$val)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(in_array($key,$hidearr))&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset($wp_list_table-&amp;gt;items[$key]);\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;}\n}\nadd_action('pre_current_active_plugins',&nbsp;'hide_plugin_trickspanda');<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fee\u6539\u5176\u4e2d\u7684plugin-directory\/plugin-file.php\u4e3a\u51c6\u5907\u9690\u85cf\u7684\u63d2\u4ef6\u76ee\u5f55\u548c\u6587\u4ef6\u540d\u5373\u53ef\u3002<\/p>\n<p>\u9690\u85cf\u591a\u4e2a\u63d2\u4ef6\u53ef\u4ee5\u8fd9\u4e48\u5199\uff1a<\/p>\n<pre>array('wp-postviews\/wp-postviews.php','akismet\/akismet.php');<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u662f\u591a\u7ad9\u70b9\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>function&nbsp;mu_hide_plugins_network(&nbsp;$plugins&nbsp;)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;let's&nbsp;hide&nbsp;akismet\n&nbsp;&nbsp;&nbsp;&nbsp;if(&nbsp;in_array(&nbsp;'akismet\/akismet.php',&nbsp;array_keys(&nbsp;$plugins&nbsp;)&nbsp;)&nbsp;)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset(&nbsp;$plugins['akismet\/akismet.php']&nbsp;);\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$plugins;\n}\nadd_filter(&nbsp;'all_plugins',&nbsp;'mu_hide_plugins_network'&nbsp;);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u66f4\u591aWordPress\u6280\u672f\u76f8\u5173\u6587\u7ae0\uff0c\u8bf7\u8bbf\u95ee\u680f\u76ee\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u9690\u85cf\u5df2\u5b89\u88c5\u7684WordPress\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\u5165\u95e8\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u9690\u85cf\u5df2\u5b89\u88c5\u7684wordpress\u63d2\u4ef6\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01 \u5982\u679c\u4e0d\u60f3\u8ba9\u5176\u4ed6\u767b\u5f55\u7684\u7528\u6237\u770b\u5230\u5df2\u5b89\u88c5\u7684\u67d0\u4e2a\u63d2\u4ef6\uff0c\u672c\u6587\u7684\u65b9\u6cd5\u5c06\u8f7b\u677e\u5730\u9690\u85cf\u4e00\u4e2aWordPress\u63d2\u4ef6\uff0c\u800c\u4e0d\u5f71\u54cd\u63d2\u4ef6\u6b63\u5e38\u5de5\u4f5c\uff0c\u53ea\u662f\u4e0d\u4f1a\u51fa\u73b0\u5728\u63d2\u4ef6\u5217\u8868\u4e2d\u3002 \u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u5f53\u524d\u4e3b\u9898functions.php\u6587\u4ef6\u4e2d\uff1a function&nbsp;hide_plugin_trickspanda()&nbsp;{ &nbsp;&nbsp;global&nbsp;$wp_list_table; &nbsp;&nbsp;$hidearr&nbsp;=&nbsp;array(&#8216;plugin-directory\/plugin-file.php&#8217;); &nbsp;&nbsp;$myplugins&nbsp;=&nbsp;$wp_list_table-&amp;gt;items; &nbsp;&nbsp;foreach&nbsp;($myplugins&nbsp;as&nbsp;$key&nbsp;=&amp;gt;&nbsp;$val)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(in_array($key,$hidearr))&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset($wp_list_table-&amp;gt;items[$key]); &nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;} } add_action(&#8216;pre_current_active_plugins&#8217;,&nbsp;&#8216;hide_plugin_trickspanda&#8217;); \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539\u5176\u4e2d\u7684plugin-directory\/plugin-file.php\u4e3a\u51c6\u5907\u9690\u85cf\u7684\u63d2\u4ef6\u76ee\u5f55\u548c\u6587\u4ef6\u540d\u5373\u53ef\u3002 \u9690\u85cf\u591a\u4e2a\u63d2\u4ef6\u53ef\u4ee5\u8fd9\u4e48\u5199\uff1a array(&#8216;wp-postviews\/wp-postviews.php&#8217;,&#8217;akismet\/akismet.php&#8217;); \u767b\u5f55\u540e\u590d\u5236 \u5982\u679c\u662f\u591a\u7ad9\u70b9\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\uff1a function&nbsp;mu_hide_plugins_network(&nbsp;$plugins&nbsp;)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;let&#8217;s&nbsp;hide&nbsp;akismet &nbsp;&nbsp;&nbsp;&nbsp;if(&nbsp;in_array(&nbsp;&#8216;akismet\/akismet.php&#8217;,&nbsp;array_keys(&nbsp;$plugins&nbsp;)&nbsp;)&nbsp;)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset(&nbsp;$plugins[&#8216;akismet\/akismet.php&#8217;]&nbsp;); &nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$plugins; } add_filter(&nbsp;&#8216;all_plugins&#8217;,&nbsp;&#8216;mu_hide_plugins_network&#8217;&nbsp;); \u767b\u5f55\u540e\u590d\u5236 \u66f4\u591aWordPress\u6280\u672f\u76f8\u5173\u6587\u7ae0\uff0c\u8bf7\u8bbf\u95ee\u680f\u76ee\uff01 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u9690\u85cf\u5df2\u5b89\u88c5\u7684WordPress\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-30257","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30257","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=30257"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30257\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}