$wpdb->prepare referencing a const without a coding guideline warning

I’d really like to get rid of the messages about coding style Despite not recommended, you can ignore/whitelist warnings and errors for a line or block of code using special PHPCS/WPCS comments which you can find here: Ignoring Parts of a File Whitelisting code which flags errors Working examples: ( Note: WordPress accepts all these … Read more

spaces inside parenthesis

This is mostly just for readability. The semantics change before and after a parenthesis, and we are used to read spaces as word separators in western languages, so we can read such code faster. Another point is search: If you want to search for all changes on variables beginning with $post it is easier to … Read more

Sandwich Coding Standards

What happen if the user don’t have capability to eat sandwich? WSOF? If I’d want to follow average default themes templates, I’d go for // eat-sandwich.php (as @Rarst said avoid wp-lunch.php as it’s not part of WP core) get_header( ‘sandwich’ ); if ( current_user_can( ‘eat_sandwich’ ) ) { get_template_part( ‘eat-sandwich’, ‘content’ ); } else { … Read more