api_acf_load_field

The Advanced Custom Fields api acf load field function.

Description

api_acf_load_field( $field, $field_key ); 

Parameters (2)

0. $field
The field.
1. $field_key
The field key.

Usage

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

Defined (1)

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

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