Reputation:
It seems cleaner to make a plugin and use add_action -- why would you use add_filter?
Upvotes: 0
Views: 264
Reputation: 2398
add_filter
hook is mainly used to change the content before displaying it ..
Suppose I want to print the title as bold when I use the_title()
function of WordPress. So to modify this function only in terms of display, we can use add_filters
.
Example : add_filter( 'the_title', function( $title ) { return '<b>' . $title . '</b>'; } );
Upvotes: 1