23 posts
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in United Kingdom
  • Has been part of the Envato Community for over 1 year
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!

1599 posts Chris Robinson
  • Located in United States
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
contempoinc says

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

23 posts
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in United Kingdom
  • Has been part of the Envato Community for over 1 year
themedesignguru says

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

1484 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

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

1599 posts Chris Robinson
  • Located in United States
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 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