best wordperss tips and tricks

This blog is all about basics of wordpress i.e. best wordperss tips and tricks,
In wordpress there are two different type of hooks
1) Action : These are to be called on certain event.
2) Filter : filters are mainly used while adding data into the database, pulling data from database and before showing them to front end.

Step 1: Define function inside plugin file.

Step 2: Register it with WordPress. Best place to keep this function is plugin file.
Defination:

  	add_action ( 'hook_name', 'your_function_name', [priority], [accepted_args] );
        	add_filter ( 'hook_name', 'your_filter', [priority], [accepted_args] );

Likewise you can also remove actions. using function “remove_action”.

      Defination: remove_action('action_hook','action_function')
   		    remove_filter('filter_hook','filter_function')

Step 3: Move you file into WordPress plugin directory and make it active via admin panel.

Pluggable Functions : It’s the way to override default behaviour of WordPress functions.
How to do this : define these functions inside wp-includes/pluggable.php

Share this nice post:

One thought on “best wordperss tips and tricks

Leave a Reply

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