A couple of WordPress tricks for plugin developers
A couple of little tricks plugin developers should use when creating a WordPress plugin are:
1. Always have debugging on
In wp-config.php you need to look for the line – define(‘WP_DEBUG’, false);
Change this to – define(‘WP_DEBUG’, true);
This will show any errors within database queries, and errors that you may come across as by default WordPress actually hides all these.
2. Prefix your function names
You need to make sure your plugin function names are unique. Functions in WordPress live together in the WordPress execution space so if there are two functions named the same then this creates an error which is not good!
So, I generally prefix function names with the name of the plugin and that should keep you out of trouble.
There you go! A couple of quick little things to keep in mind while writing a WordPress plugin, and perhaps I may even provide a couple of more in my next post.
Yours in WordPress development,
Lee