[wp-hackers] Code formatting

Andrew Nacin wp at andrewnacin.com
Tue Jul 5 19:58:42 UTC 2011


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

>  Should be $_POST['link_url']. That said, if it were a variable, then it
>> should probably have spaces: $_POST[ $link_url ].
>>
>
> After reading this I looked at the Codex again and saw that it's not
> explained for round brackets neither. In the code there are both versions
>
> ---
> current_user_can('edit_posts')
> do_action( 'in_admin_footer' );


For parentheses, spaces are in order. But as Peter said (as well as others
in the ticket), we have some standards when it comes to refactoring:
http://wpdevel.wordpress.com/2011/03/23/code-refactoring/.

Nacin


More information about the wp-hackers mailing list