top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is hooks and types of hooks in wordpress?Where it used?

+2 votes
287 views
What is hooks and types of hooks in wordpress?Where it used?
posted Apr 28, 2015 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

In WordPress theme and development, Hooks are functions that can be applied to an Action or a Filter in WordPress. Actions and Filters in WordPress are functions that can be modified by theme and plugin developers to change the default WordPress functionality.

Functions used to modify Actions/Filters in WordPress can be hooked into WordPress. However, it is important to note that actions and filters are not the same thing. Actions are functions performed when a certain even occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. But they are different in functionality and how they behave.

For more information:http://www.wpbeginner.com/glossary/hooks/

answer Apr 29, 2015 by Rahul Singh
Similar Questions
+1 vote

I am working on a Wordpress project. I have a layout like shown in below the screenshot with a select field and boxes with news (two or more different post types). I want to filter with the select the post type so there should show up only the selected. How can i do that?

Screenshot :
enter image description here

0 votes

I want to create a database table with a column corresponding to the time in my wordpress site, so that I can save user actions into this table and know when they did it.

Creating a table:

$sql = "CREATE TABLE IF NOT EXISTS $table_name (
        id INT NOT NULL AUTO_INCREMENT,
        actiontime NOT NULL DATETIME,
        PRIMARY KEY (id)
    ) $charset_collSate;";
    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    // execute the query
    dbDelta( $sql );

Is this correct?

I would want a time stamp such that I can get the difference on minute/second intervals.

...