title: How to check for field groups in Wordpress Advanced Custom Fields plugin?
body: <p>I'm using the acf Advanced Custom Fields plugin for Wordpress. 
  I'm working with a generic template that outputs all field groups by default. 
  As some fields are only shown on specific pages I'd like to determine what fields need to be outputted.
  My current workaround is the following:</p>
  
  <p>1, I created a acf- field group (e.g. with the name "My Field Group") in
      the backend;<br>
   2, I set a role in the acf-menu for "My Field Group" to
      show it only on e.g. a specific page (the role could also be a category etc.)<br>
   3, I created a custom field with a checkbox and the
      name "mygroup" within "My Field Group" that always returns "yes".</p>
  
  <p>4, Then in the code I can check if the group "My Field Group" is available on a
      page by checking the value of the custom field "mygroup". If yes, it will return all fields of "My Field Group"</p>
  
  <p>The code:</p>
  
  <pre><code>//check if the field group "My Field Group" is available by checking the value of its custom field "mygroup" 
  &lt;?php if(get_field('mygroup') == "yes") { ?&gt;
      &lt;div&gt;
          //load all other fields in the field group "My Field Group"
      &lt;/div&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>As this requires an additional field only to check if the field group is available on a page (respectively to determine the role), I was wondering if there is a more elegant way to achieve that</p>
  
  <p><img src="https://i.stack.imgur.com/74nDW.jpg" alt="acf editor"></p>
  
  <p><img src="https://i.stack.imgur.com/Dmbtu.jpg" alt="page"></p>
  
  <p><strong>Update:</strong>
  Here's the feedback from the programmer:</p>
  
  <blockquote>
    <p>ACF does not save any information about the specific field group that
    appeared on the post, only the field values.</p>
    
    <p>I believe that your method is minimal, efficient and smart. I would
    continue to use this.</p>
    
    <p>Cheers Elliot</p>
  </blockquote>