Skip to content

Instantly share code, notes, and snippets.

@solepixel
Created October 28, 2014 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solepixel/c1f7377a8784a185b1c6 to your computer and use it in GitHub Desktop.
Save solepixel/c1f7377a8784a185b1c6 to your computer and use it in GitHub Desktop.
render_field() method in ACF-Reusable-Field-Group extension for Advanced Custom Fields/Pro Plugin
<?php
// ...
// @ line 137
# see https://github.com/tybruffy/ACF-Reusable-Field-Group/blob/master/acf-reusable_field_group-v5.php#L137
function render_field( $field ) {
global $post;
$current_id = $post->ID; ### $post is not defined/availabe on a Settings page
$group = _acf_get_field_group_by_key($field["group_key"]);
$fields = acf_get_fields($group);
acf_render_fields($current_id, $fields);
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment