One of the keys in the success of WordPress as one of the most popular content management systems lies in its flexibility to add new functionality, or modify the existing functionality, by means of plugins. WordPress plugins attach the extra functionality thy implement to “hooks” in the wordpress code.
Hooks are points defined in many places of the wordpress base code. A hook can be an action or a filter: filters are used when part of the HTML code being generated needs to be modified. The original HTML code is passed as an argument to the filter, and the filter return the modified code.This post explains the implementation details of action and filter hooks in wordpress.