Rewrite attribute helper as a hook.