The acf/location/rule_operators filter should be passed the currently selected location “Type” param. Right now the filter applies to all location rules, but sometimes (more often than not I’m sure), an operator would only apply to a single location type.
For example, say you want to add a new type “Post Date”, and you need operators “is after” and “is before”. Those operators do not make sense for any of the other types (ie: Post Category is before Uncategorized, nope). I realize this is an admin only section of the website, so I know that setting a rule like that would never work anyways, but I feel that the option should not even show (perhaps another admin does not know the background and the operators aren’t as specific, it could become frustrating for a user trying to set an operator that does not apply to a type).
This should also apply to the acf/location/rule_values/$type filter as well, it should be passed the current operator, as this could change the values that are available.
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future. https://t.co/HahJUCcyH4