api_acf_field_group_get_fields

The Advanced Custom Fields api acf field group get fields function.

Description

api_acf_field_group_get_fields( $fields, $post_id ); 

Parameters (2)

0. $fields
The fields.
1. $post_id
The post id.

Usage

  1. if ( !function_exists( 'api_acf_field_group_get_fields' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'advanced-custom-fields/core/api.php'; 
  3.  
  4. // The fields. 
  5. $fields = null; 
  6.  
  7. // The post id. 
  8. $post_id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = api_acf_field_group_get_fields($fields, $post_id); 
  12.  

Defined (1)

The function is defined in the following location(s).

/core/api.php  
  1. function api_acf_field_group_get_fields( $fields, $post_id ) 
  2. // validate 
  3. if( !empty($GLOBALS['acf_register_field_group']) ) 
  4. foreach( $GLOBALS['acf_register_field_group'] as $acf ) 
  5. if( $acf['id'] == $post_id ) 
  6. foreach( $acf['fields'] as $f ) 
  7. $fields[] = apply_filters('acf/load_field', $f, $f['key']); 
  8.  
  9. break; 
  10.  
  11. return $fields; 
  12.