[theme-reviewers] Prefixing Non-Global Variables

Emil Uzelac emil at uzelac.me
Wed May 28 00:50:23 UTC 2014


(*I haven't seen the ticket in question*)

Not sure what difference would $counterpoint_title make.
This is not a *deal breaker* and it could be accepted as-is.

Em


On Tue, May 27, 2014 at 7:15 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/c38e4734/attachment.html>


More information about the theme-reviewers mailing list