A filter is a function that attaches to a hook, extending the functionality of WordPress. A filter runs when an event occurs in WordPress. Filters allow us to modify data before it is processed for display in a browser. A filter accepts variables, modifies the passed value, and returns data for further processing.