23 posts
  • Exclusive Author
  • United Kingdom
  • Bought between 10 and 49 items
  • Has been a member for 0-1 years
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!

1564 posts Chris Robinson
  • United States
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 5-6 years
  • Author had a File in an Envato Bundle
  • Referred between 500 and 999 users
  • Author had a Free File of the Month
+5 more
contempoinc says

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

23 posts
  • Exclusive Author
  • United Kingdom
  • Bought between 10 and 49 items
  • Has been a member for 0-1 years
themedesignguru says

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

1402 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
OriginalEXE says

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

1564 posts Chris Robinson
  • United States
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 5-6 years
  • Author had a File in an Envato Bundle
  • Referred between 500 and 999 users
  • Author had a Free File of the Month
+5 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