4

I have multiple fields on a field group called Membership Level Feature and which post id is 5112. Now, I want to get all the fields of this post id. I am using:

echo '<pre>';
print_r( get_fields(5112 )  );
echo '</pre>';

But getting empty :(

Please check this image:

enter image description here

Shibbir
  • 1,963
  • 2
  • 25
  • 48

1 Answers1

3

Try this:

if (function_exists('acf_get_field_groups')) {
    $acf_field_group = acf_get_field_group(5112);
    $acf_fields = acf_get_fields(5112);
}
Hillel
  • 811
  • 2
  • 7
  • 19
  • This `acf_get_field('select_this_membership_level_feature')` works for me :)\ – Shibbir Apr 11 '22 at 10:29
  • Good to hear! if you found this helpful, please mark the answer as accepted so that other people can easily find it in the future :) – Hillel Apr 12 '22 at 07:15