Can I submit a plugin that follows the PSR-2 coding style guide?

Can I submit a plugin that follows the PSR-2 coding style guide?

This

if ($a === $b) {

}

$array = ['foo', 'bar'];

instead of

if ( $a === $b ) {

}

$array = [ 'foo', 'bar' ];

1 Answer
1

I would guess to the official plugin directory? Yes, the WP’s own coding standards are recommended, but not required:

  1. Keep your code (mostly) human readable.

Intentionally obscuring code by hiding it with techniques or systems […] Minified code may be used, however the unminified versions should be included whenever possible. We recommend following WordPress Core Coding Standards.

Detailed Plugin Guidelines

PSR-2 is perfectly readable and there should be no issue with using it.

Leave a Comment