In today’s post, i will let you know the very useful tips when you are going to develop your own WordPress plugin. After this post you will how to create an action function in wordpress.

I assumes that you’ve read how to create a Plugin, giving an overview of how to develop a plugin. Let’s start creating an action function in your plugin is create a PHP function with action functionality for your plugin feature.

wordpress-action-functions

Avoiding Function Name Collisions

Please alway make sure to avoid common function name in your plugin, because it may be your function named the same as one in your another plugin OR wordpress core codes. Here is the function name suggestion for your custom plugins.

Just assume your plugin name is “Email Friends”, then create your functions with prefix like this ef_function_name. This will prevent from collision with others plugins.

WordPress Action Function

Below is an example of wordpress action function. Below action function will sent an email to your friends when something updated on your blog/website.

Please do like & share with your friends and don’t forgot to subscribe this blog to get update from freewebmentor.