WordPress provides an API called "actions" which allow functions to be executed at specific times during a request.