Prefix Everything in WordPress Coding

Simple but very important rule in the WordPress development practices is to Prefix Everything. It means,
  • Suppose your project i.e. theme or plugin name is WPGear
  • You should prefix everything with wpgear_ in WordPress coding.



function wpgear_featured_content() {
  // ...


class WPGear_Counter {
  // ...


$wpgear_color = '';

It is very simple concept that you should prefix everything with your project. It will be helpful in avoiding any possible conflict with the coding of other plugins or themes.

Why Prefix Everything:

WordPress is a masterpiece open source software. Many developers release and maintain awesome plugins or themes daily. So, in the global namespace it is very easy to have a conflict with other codes if you fail to prefix your code.

You can read an excellent article on prefix everything here.


Popular posts from this blog

Best Free Minimalist WordPress Themes 2017