1

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' ];
2

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.

https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.