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.

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.

Tags: , , , , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

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

SEARCH NOW