Moved add_action below function for compatibility with WordPress standards.