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!

1613 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?

1497 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
+2 more
OriginalEXE says

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

1613 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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by