As per the WordPress Codex, the add_action () function needs to pass at least two parameters: Name of the action to hook into. Name of the callback function that’ll run when the action is triggered. The add_action () function also accepts two optional parameters for setting the priority and the number of arguments.