WordPress Action Hook

by Bhumi // Dec 17,2012 // 5 comments

Wordpress Action Hook

WordPress provide functionality of action hook with which you can create your own action hook too.you can create new action hooks by calling do_action() function and just need to specify the name of the new hook as $tag parameter.Whereas add_action() is used to hooks a function on to a specific action.

SYNTAX for do_action


$tag is the name of the action to be executed.

$arg is an optional arguments which are passed on to the functions hooked to the action.

SYNTAX for add_action

Here is add_action,same like do_action $tag is the name of the action to be executed.Next argument is the name of the function to add for an action.Third argument defines the priority of code and fourth argument is for number of argument in the function.

Here in an example, going to show how to create an action hook that customize the login functionality just before the user logged into dashboard.

First of,place below code into the wp-login.php file after post request for a form.

Next is use the function, which we can put in the functions.php of the theme to add an action for the login

Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.


ColorDots to highlight Event in FullCalendar

Here I am going to explain how to add colordots to highlight event in Full Calendar. Few months ago, I have used Full Calendar for READ MORE

To get Latitude and longitude using address

Here, I am going to explain function which will return latitude and longitude value by passing address. Google map provides great functionality to get latitude READ MORE

Auto tagging in WordPress

WordPress is the most used content management system but now a days wordpress is used for developing any kind of site like Restaurant, Job Search,shopping READ MORE

How to Extend WordPress Website Functionality Using Code Snippets?

This is a guest post by Sarah Parker, a WordPress developer and a reader of CreativeDev Who doesn’t love WordPress plugins? Well, almost all of READ MORE

WordPress Multisite Explained

WordPress Multisite is good option for those who want to run multiple sites, multiple blogs or want to offer blog hosting services to others.WordPress.com and READ MORE

Feedback 5

  1. It is visible that wrote is acquainted with these issues and knows how to present it in a way easily understood for a greenhorn.
    I admit that I”m very interested in this entry despite the fact that I”m not much interested in this subject-matter.

  2. Wow, incredible weblog structure! How long have you been running a blog for? you created running a blog look simple. The entire look of your website is magnificent, neatly as the content material!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">