How to create an Action Function in WordPress

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.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Solved Programs