[theme-reviewers] Prefixing Non-Global Variables

Otto otto at ottodestruct.com
Wed May 28 02:47:48 UTC 2014


No, because that's stupid.

Feel free to correct the reviewers when you think they are wrong. Theme
review is a dialog, not a word handed down from up on high. Everybody makes
mistakes. Don't judge, just try to achieve balance.

The goal is to produce the best code possible and to not give broken code
users. Work towards that end, all around.


On May 27, 2014 7:16 PM, "Evan Henley" <henleyedition at gmail.com> wrote:

> Hi all,
>
> This is regarding the following ticket:
> https://themes.trac.wordpress.org/ticket/18381
>
> There is some conflict over the interpretation of the rules for prefixing
> variables:
>
> Themes are required to use theme-slug ( or a reasonably unique slug) as a
> prefix for anything in the public namespace, including all custom function
> names, classes, hooks, public/global variables, database entries (Theme
> options, post custom metadata, etc.)
>
>
> I am being told I need to prefix every variable used in my theme. Is it
> correct that even non-global variables need to be prefixed?
>
> For instance, I’m told that $title needs to be changed to
> $counterpoint_title:
>
> function counterpoint_no_title($title) {
>     if ( $title == '' ) $title = __('Untitled', 'counterpoint');
>     return $title;
> }
> add_filter( 'the_title', 'counterpoint_no_title' );
>
>
> Any insight would be much appreciated.
>
> Thanks,
> Evan
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140527/41e9bd32/attachment.html>


More information about the theme-reviewers mailing list