Add support for only_if pre-hook