I’m using these global vars in my theme:
But the theme got rejected with reason “Your global variables should always be named in such a way as to NOT cause conflicts. Try to use a prefix for that.”
I’m already use the prefix ‘st’. Whats wrong with that variables?
Have you opened a support ticket with Envato?
Perhaps they missed the ‘st’ bit.
I don’t see any problem with those variables, so like Webinest suggested, I would open a support ticket with Envato to ask for more info on it. Did you get a Soft or Hard reject?
st may be two short or to common
can you use “st_” in wordpress?
I’ve replaced ’$st…’ prefix within ’$st_…’ and the theme has been approved. Till now I’m not sure about the problem with ’$st’.
I’m getting the same reason for soft rejection – however I have a prefix of $nv_ already ( previous username ) – the reviewer isn’t giving an example, so I’ve no idea if that’s what they mean or not.
So frustrating that I now have to wait another 24hrs to see by trial and error if that is the issue or not.
The best way to prefix these things is to actually use your theme folder name like so:
$themename_some_var // global variable themename_some_func() // function themename_some_hook // hook THEMENAME_SOME_CONSTANT // constant Themename_Some_Class // class theme-folder // textdomain themename-thumbnail // custom image size themename_meta // custom metadata _themename_meta // custom hidden metadata themename_some_option // custom options
Anything within the public namespace should be prefixed.
That’s the standard most WordPress theme/plugin authors should be following. Of course, if your theme name is pretty long, you might want to consider shortening your prefix.
Using a two-letter prefix, while mostly safe, can still lead to conflicts because it’s not very unique. It’s a heck of a lot better than no prefix though. If you’re using the same two-letter prefix across multiple themes, it’s especially not a good idea if that prefix deals with saving data (metadata, options, etc.) because data might be different between themes.