/wordpress

WordPress managed via Composer.

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

WordPress

This is a WordPress project managed via Composer

This project serves as an example, and a baseline for Composer managed WordPress projects.

It's built using John P. Bloch's composer-ized WordPress mirror for the core; WordPress Packagist for registered WordPress plugins, and themes; and oomphinc/composer-installers-extender package for custom installation path support.

Besides the WordPress core, following also added as minimalist examples:

Installation

composer create-project gormus/wordpress your_folder

PHP_CodeSniffer

The first time this project is installed, WordPress coding standards are installed as well. They can also be installed via following command: composer run-script install-codestandards

Try running ./vendor/bin/phpcs -i to list all installed standards; following should be listed in the output: WordPress, WordPress-Extra, WordPress-Docs and WordPress-Core.

The installed code sniffer, and standards can be used either via Composer, in shell scripts, or even in your favorite IDE. Here are a few examples:

Run PHP_CodeSniffer in current directory using WordPress standard:

composer run phpcs .

Fix wp-config.local.php file using WordPress standard:

composer run phpcbf wp-config.local.php

Configure Visual Studio Code and phpcs plugin to use WordPress standard

{
    "phpcs.standard": "./vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml"
}