I am looking to implement a basic check on my ACF field. I have an ACF field called
Featured Article on all my custom post-type articles. It's a simple switch allowing for
off functionality. I want to allow a max of 3 articles at the same time with the
on setting, to display at most 3 articles to the user on the front-end.
For this functionality I have to write some code that checks for the setting on the backend on all the articles. For example, when the user is on a fourth article and switches the select of the ACF to
on, there should be an error of sorts that says "you already have three other articles selected. Ideally, it would somehow gather the titles of the other articles and allow a quick switch-off for those.
I understand that this would be adding a lot of custom features to the WP backend, so let's start with the basics. How do I enable the ACF field to cross-check for the value of all other articles?