23 posts
  • Collector Level 2
  • Exclusive Author
  • Moldova, Republic of
  • 2 Years of Membership
themedesignguru
says

Hello, I would like to know if I should add an unique theme prefix to all php variables I create as well as for functions?

Thanks for your advice!

1680 posts Chris Robinson
  • Elite Author
  • Author Level 10
  • 7 Years of Membership
  • United States
+13 more
contempoinc
says

Yes, its a must and good practice. I prefix all mine with ct_

23 posts
  • Collector Level 2
  • Exclusive Author
  • Moldova, Republic of
  • 2 Years of Membership
themedesignguru
says

Doesn’t function scope isolate our variables away from other parts of WP like plugins?

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Of course you don’t need to prefix your variables, only functions, classes, global variables and constants.

1680 posts Chris Robinson
  • Elite Author
  • Author Level 10
  • 7 Years of Membership
  • United States
+13 more
contempoinc
says

Yes, its a must and good practice. I prefix all mine with ct_

Forgot to mention not variables, but functions, classes and globals and constants.

by
by
by
by
by
by