How to create an Action Function in WordPress

| Last Updated: | In: WordPress, WordPress Themes, WP Labs

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.


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.

Tags: , , , , ,

About: Prem Tiwari

Prem Tiwari is the founder of and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.

You may also like:

Follow us!

Get Free Access of 400+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...


Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...