api_acf_field_group_get_fields
The Advanced Custom Fields api acf field group get fields function.
Description
Parameters (2)
- 0. $fields
- The fields.
- 1. $post_id
- The post id.
Usage
if ( !function_exists( 'api_acf_field_group_get_fields' ) ) { require_once ABSPATH . PLUGINDIR . 'advanced-custom-fields/core/api.php'; } // The fields. $fields = null; // The post id. $post_id = null; // NOTICE! Understand what this does before running. $result = api_acf_field_group_get_fields($fields, $post_id);
Defined (1)
The function is defined in the following location(s).
- /core/api.php
- function api_acf_field_group_get_fields( $fields, $post_id )
- {
- // validate
- if( !empty($GLOBALS['acf_register_field_group']) )
- {
- foreach( $GLOBALS['acf_register_field_group'] as $acf )
- {
- if( $acf['id'] == $post_id )
- {
- foreach( $acf['fields'] as $f )
- {
- $fields[] = apply_filters('acf/load_field', $f, $f['key']);
- }
- break;
- }
- }
- }
- return $fields;
- }