[wp-hackers] Code formatting

Andrew Nacin wp at andrewnacin.com
Tue Jul 5 16:33:26 UTC 2011

On Tue, Jul 5, 2011 at 12:24 PM, Lutz Schröer <latz at elektroelch.de> wrote:

> I've started to format the code of older files to make them WP coding
> standard compliant. The codex says that there should be spaces at round
> brackets:
> function( parameter ) {}
> but it does not say anything about square brackets. So what's the preferred
> style?
> $_POST['link_url']
> or
> $_POST[ 'link_url' ]

Should be $_POST['link_url']. That said, if it were a variable, then it
should probably have spaces: $_POST[ $link_url ].


More information about the wp-hackers mailing list