post-template-default,single,single-post,postid-6594,single-format-standard,select-core-1.6,pitch-theme-ver-3.5,ajax_fade,page_not_loaded,smooth_scroll,grid_1300,vertical_menu_with_scroll,blog_installed,wpb-js-composer js-comp-ver-6.7.0,vc_responsive

A couple of WordPress tricks for plugin developers

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,

Belinda Vesey-Brown About the author
No Comments

Post a Comment