{"id":29172,"date":"2024-11-25T17:10:27","date_gmt":"2024-11-25T09:10:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/29172\/"},"modified":"2024-11-25T17:10:27","modified_gmt":"2024-11-25T09:10:27","slug":"%e5%a6%82%e4%bd%95%e4%b8%bawordpress%e5%bc%80%e5%8f%91%e8%ae%be%e7%bd%aeatom%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/29172\/","title":{"rendered":"\u5982\u4f55\u4e3aWordPress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883"},"content":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;<strong>wordpress\u6559\u7a0b<\/strong>\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e3awordpress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883\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\/5d8d6bcf62fe7681.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4e3aWordPress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883\u63d2\u56fe\" alt=\"\u5982\u4f55\u4e3aWordPress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883\u63d2\u56fe\" \/><\/p>\n<p>WordPress\u771f\u662f\u4e00\u4e2a\u5f88\u5947\u8469\u7684\u9879\u76ee\uff0c\u5b83\u7684\u5f88\u591a\u7f16\u7801\u6807\u51c6\u548cPSR2\u662f\u90a3\u4e48\u7684\u4e0d\u540c\uff0c\u4f8b\u5982\u4e00\u822c\u7684php\u9879\u76ee\u90fd\u8981\u6c42\u4ee5\u7a7a\u683c\u4ee3\u66ffTAB\u952e\uff0c\u4f46\u552f\u72ecWordPress\u8981\u6c42\u5fc5\u987b\u7528TAB\u952e\u672c\u8eab\u6765\u4f5c\u7f29\u8fdb\uff0c\u7b49\u7b49\u3002\u4ee5\u81f3\u4e8e\u5fc5\u987b\u4e13\u95e8\u4e3a\u5b83\u7684\u5f00\u53d1\u800c\u8bbe\u7f6e\u4e00\u5957atom\u73af\u5883\u3002<\/p>\n<p>\u5728atom\u4e2d\u67e5\u627e\u5e76\u5b89\u88c5project-manager\u63d2\u4ef6\uff0c\u6709\u4e86\u5b83\uff0c\u6211\u4eec\u624d\u80fd\u5355\u72ec\u4e3aWordPress\u9879\u76ee\u521b\u5efa\u81ea\u5df1\u7279\u6b8a\u7684\u73af\u5883\u3002<\/p>\n<p>\u6309\u7167\u8bf4\u660e\u6587\u6863\uff0c\u5728\u83dc\u5355\u91cc\u9009\u62e9Save Project\u540e\uff0c\u5b83\u4f1a\u521b\u5efa\u4e00\u4e2a~\/.atom\/projects.cson\u6587\u4ef6\uff0c\u91cc\u9762\u6709\u4f60\u7684\u9879\u76ee\u7684\u8def\u5f84\u7b49\u57fa\u672c\u4fe1\u606f\u3002<\/p>\n<p>\u5728\u4f60\u7684\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u5efa\u7acb\u4e00\u4e2a\u6587\u4ef6\u540d\u4e3aproject.cson\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre>settings:\n&nbsp;&nbsp;\"*\":\n&nbsp;&nbsp;&nbsp;&nbsp;\"linter-phpcs.codeStandardOrConfigFile\":&nbsp;\"WordPress\"\n&nbsp;&nbsp;\".html.php.text\":\n&nbsp;&nbsp;&nbsp;&nbsp;\"editor.tabType\":&nbsp;\"hard\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7b2c3\u884c\u7684\u610f\u601d\u662f\u8bf4\uff1a\u53ea\u5bf9\u672c\u9879\u76ee\u8fdb\u884cWordPress\u6821\u9a8c\u3002<\/p>\n<p>\u7b2c4\u884c\u548c\u7b2c5\u884c\u7684\u610f\u601d\u662f\u8bf4\uff1a\u53ea\u5bf9php\u6587\u4ef6\u8fdb\u884c\u786cTAB\u3002<\/p>\n<p>\u8fd9\u6837\uff0c\u4f60\u7684\u5176\u5b83\u6240\u6709PHP\u9879\u76ee\u8fd8\u662f\u7528PSR2\u6807\u51c6\u8fdb\u884c\u6821\u9a8c\uff0c\u5e76\u4e14\u662f\u8f6fTAB\uff0c\u4e5f\u5c31\u662fTAB\u4f1a\u88ab\u8f6c\u6362\u4e3a\u7a7a\u683c\uff0c\u800c\u53ea\u6709\u8fd9\u4e2a\u9879\u76ee\u91cc\u7684PHP\u9879\u76ee\u662f\u786cTAB\uff0c\u5176\u5b83\u6587\u4ef6\u4f8b\u5982JS\u7b49\u8fd8\u662f\u8f6fTAB\u3002<\/p>\n<p>\u5173\u4e8eWordpress\u7f16\u7801\u6807\u51c6\u7684\u5b89\u88c5\uff0c\u8bf7\u53c2\u8003\u4e0a\u4e00\u7bc7\u6587\u7ae0\uff1ahttps:\/\/segmentfault.com\/a\/11&#8230;<\/p>\n<p><strong>\u65b0\u65b9\u6cd5<\/strong><\/p>\n<p>Atom\u4e2d\u7684Project Management\u5e76\u4e0d\u597d\u7528\uff0c\u6700\u540e\u6211\u8fd8\u662f\u91c7\u7528\u4e86editorconfig\u52a0phpcs\u7684\u65b9\u6cd5\u8fdb\u884c\u8bbe\u5b9a\uff1a<\/p>\n<p><strong>editorconfig<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u5efa\u7acb\u4e00\u4e2a.editorconfig\u6587\u4ef6\uff1a<\/p>\n<pre>root&nbsp;=&nbsp;true\n[*.php]\nindent_style&nbsp;=&nbsp;tab\n[*.scss]\nindent_style&nbsp;=&nbsp;space\nindent_size&nbsp;=&nbsp;2<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u89c4\u5b9a\u4e86php\u6587\u4ef6\u7684\u7f29\u8fdb\u65b9\u5f0f\u5fc5\u987b\u7528TAB\u952e\u3002\u6ce8\u610f\uff1aAtom\u5fc5\u987b\u628a\u7f29\u8fdb\u65b9\u5f0f\u6539\u6210Auto\uff0c\u5426\u5219\u5728editorconfig\u91cc\u7684\u8bbe\u7f6e\u4f1a\u4e0d\u8d77\u4f5c\u7528\u3002<\/p>\n<p><strong>phpcs.xml<\/strong><\/p>\n<p>\u7136\u540e\uff0c\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u5efa\u7acb\u4e00\u4e2aphpcs.xml\u6587\u4ef6\uff1a<\/p>\n<pre>&lt;?xml  version=\"1.0\"?&gt;&lt;ruleset&gt;\n&nbsp;&lt;rule&gt;&lt;\/rule&gt;&lt;\/ruleset&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u544a\u8bc9phpcs\uff0c\u8fd9\u4e2a\u9879\u76ee\u5c06\u4f7f\u7528WordPress\u9a8c\u8bc1\u3002<\/p>\n<p>\u76f8\u5173\u63a8\u8350\uff1a\u300a\u300b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4e3aWordPress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883\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\u7ecd\u4e3awordpress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01 WordPress\u771f\u662f\u4e00\u4e2a\u5f88\u5947\u8469\u7684\u9879\u76ee\uff0c\u5b83\u7684\u5f88\u591a\u7f16\u7801\u6807\u51c6\u548cPSR2\u662f\u90a3\u4e48\u7684\u4e0d\u540c\uff0c\u4f8b\u5982\u4e00\u822c\u7684php\u9879\u76ee\u90fd\u8981\u6c42\u4ee5\u7a7a\u683c\u4ee3\u66ffTAB\u952e\uff0c\u4f46\u552f\u72ecWordPress\u8981\u6c42\u5fc5\u987b\u7528TAB\u952e\u672c\u8eab\u6765\u4f5c\u7f29\u8fdb\uff0c\u7b49\u7b49\u3002\u4ee5\u81f3\u4e8e\u5fc5\u987b\u4e13\u95e8\u4e3a\u5b83\u7684\u5f00\u53d1\u800c\u8bbe\u7f6e\u4e00\u5957atom\u73af\u5883\u3002 \u5728atom\u4e2d\u67e5\u627e\u5e76\u5b89\u88c5project-manager\u63d2\u4ef6\uff0c\u6709\u4e86\u5b83\uff0c\u6211\u4eec\u624d\u80fd\u5355\u72ec\u4e3aWordPress\u9879\u76ee\u521b\u5efa\u81ea\u5df1\u7279\u6b8a\u7684\u73af\u5883\u3002 \u6309\u7167\u8bf4\u660e\u6587\u6863\uff0c\u5728\u83dc\u5355\u91cc\u9009\u62e9Save Project\u540e\uff0c\u5b83\u4f1a\u521b\u5efa\u4e00\u4e2a~\/.atom\/projects.cson\u6587\u4ef6\uff0c\u91cc\u9762\u6709\u4f60\u7684\u9879\u76ee\u7684\u8def\u5f84\u7b49\u57fa\u672c\u4fe1\u606f\u3002 \u5728\u4f60\u7684\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u5efa\u7acb\u4e00\u4e2a\u6587\u4ef6\u540d\u4e3aproject.cson\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a settings: &nbsp;&nbsp;&#8220;*&#8221;: &nbsp;&nbsp;&nbsp;&nbsp;&#8220;linter-phpcs.codeStandardOrConfigFile&#8221;:&nbsp;&#8220;WordPress&#8221; &nbsp;&nbsp;&#8220;.html.php.text&#8221;: &nbsp;&nbsp;&nbsp;&nbsp;&#8220;editor.tabType&#8221;:&nbsp;&#8220;hard&#8221; \u767b\u5f55\u540e\u590d\u5236 \u7b2c3\u884c\u7684\u610f\u601d\u662f\u8bf4\uff1a\u53ea\u5bf9\u672c\u9879\u76ee\u8fdb\u884cWordPress\u6821\u9a8c\u3002 \u7b2c4\u884c\u548c\u7b2c5\u884c\u7684\u610f\u601d\u662f\u8bf4\uff1a\u53ea\u5bf9php\u6587\u4ef6\u8fdb\u884c\u786cTAB\u3002 \u8fd9\u6837\uff0c\u4f60\u7684\u5176\u5b83\u6240\u6709PHP\u9879\u76ee\u8fd8\u662f\u7528PSR2\u6807\u51c6\u8fdb\u884c\u6821\u9a8c\uff0c\u5e76\u4e14\u662f\u8f6fTAB\uff0c\u4e5f\u5c31\u662fTAB\u4f1a\u88ab\u8f6c\u6362\u4e3a\u7a7a\u683c\uff0c\u800c\u53ea\u6709\u8fd9\u4e2a\u9879\u76ee\u91cc\u7684PHP\u9879\u76ee\u662f\u786cTAB\uff0c\u5176\u5b83\u6587\u4ef6\u4f8b\u5982JS\u7b49\u8fd8\u662f\u8f6fTAB\u3002 \u5173\u4e8eWordpress\u7f16\u7801\u6807\u51c6\u7684\u5b89\u88c5\uff0c\u8bf7\u53c2\u8003\u4e0a\u4e00\u7bc7\u6587\u7ae0\uff1ahttps:\/\/segmentfault.com\/a\/11&#8230; \u65b0\u65b9\u6cd5 Atom\u4e2d\u7684Project Management\u5e76\u4e0d\u597d\u7528\uff0c\u6700\u540e\u6211\u8fd8\u662f\u91c7\u7528\u4e86editorconfig\u52a0phpcs\u7684\u65b9\u6cd5\u8fdb\u884c\u8bbe\u5b9a\uff1a editorconfig \u9996\u5148\uff0c\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u5efa\u7acb\u4e00\u4e2a.editorconfig\u6587\u4ef6\uff1a root&nbsp;=&nbsp;true [*.php] indent_style&nbsp;=&nbsp;tab [*.scss] indent_style&nbsp;=&nbsp;space indent_size&nbsp;=&nbsp;2 \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u89c4\u5b9a\u4e86php\u6587\u4ef6\u7684\u7f29\u8fdb\u65b9\u5f0f\u5fc5\u987b\u7528TAB\u952e\u3002\u6ce8\u610f\uff1aAtom\u5fc5\u987b\u628a\u7f29\u8fdb\u65b9\u5f0f\u6539\u6210Auto\uff0c\u5426\u5219\u5728editorconfig\u91cc\u7684\u8bbe\u7f6e\u4f1a\u4e0d\u8d77\u4f5c\u7528\u3002 phpcs.xml \u7136\u540e\uff0c\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u5efa\u7acb\u4e00\u4e2aphpcs.xml\u6587\u4ef6\uff1a &lt;?xml version=&#8221;1.0&#8243;?&gt;&lt;ruleset&gt; &nbsp;&lt;rule&gt;&lt;\/rule&gt;&lt;\/ruleset&gt; \u767b\u5f55\u540e\u590d\u5236 \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u544a\u8bc9phpcs\uff0c\u8fd9\u4e2a\u9879\u76ee\u5c06\u4f7f\u7528WordPress\u9a8c\u8bc1\u3002 \u76f8\u5173\u63a8\u8350\uff1a\u300a\u300b \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4e3aWordPress\u5f00\u53d1\u8bbe\u7f6eatom\u73af\u5883\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-29172","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29172","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=29172"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/29172\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=29172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=29172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=29172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}