DEV: Extract out compound conditional (PR #13008)

GitHub