Add before_format hook.