Atom: Build WordPress development environment

Other language site
ja ja
Google Translate
  • -

    シェア
  • ---

    LINEで送る
  • -

    はてなブックマーク
    ブックマーク
  • -

    pocket
  • -

    rss
Atom logo

How to build WordPress development environment with Atom of text editor.

I do not do any difficult things. Just install and configure the required packages.

Premise

In order to build WordPress development environment, it is necessary to install the packages necessary for PHP and WordPress development.

Details are here.

Change atom setting (indent setting)

Indentation is tab in WordPress coding convention. Change indent setting of atom.

Set it with FIle -> Settings -> Editor.

Atom-WordPress環境設定キャプチャ-01

In Atom, indentation is expressed as follows.

tab:hard
space:soft

In WordPress set hard. Incidentally, in PSR the indentation is 4 spaces. For PSR, set soft.

Setting linter-phpcs

From File -> Settings -> Packages, click "Settings" of linter-phpcs to make the setting.

Atom-WordPress環境設定キャプチャ-02

Atom-WordPress環境設定キャプチャ-03

Set "Code Standard Or Config File" to "WordPress-Core".

The setting is over. Let's check the operation at the end.

Atom-WordPress環境設定キャプチャ-04

Let's change the indentation of the php code on line 6 to a space. Then the result is like this.

Portions that do not conform to WordPress's coding conventions are displayed in red. And its contents are displayed in linter's window.

It is more like a debugger than a static coding checking tool.

Unless we modify it so that it conforms to WordPress' s terms, we will continue to put out the red seal.

So, if you code so that red marks do not appear, you are naturally following WordPress coding conventions.

In this case, you can concentrate on coding without worrying about coding conventions except when red marks appear.

Also, when creating in class, WordPress has its own class and class file naming convention.

These packages also recognize these as Error.

Conclusion

In this time, I built WordPress development environment using only the minimum necessary package.

There are many other convenient packages, so it would be possible to build a more efficient environment.

However, I am developing WordPress in this environment, but I am wondering if this is enough at the present time.

SNS also distributes articles.
Leave a Reply

*

If you like this article, share it!