acf/load_field

The Advanced Custom Fields acf load field hook.

Description

apply_filters( 'acf/load_field', (array) $array, (unknown) $options_ancestor ); 

Parameters (2)

0. $array (array) => array()
The array.
1. $options_ancestor (unknown)
The options ancestor.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'acf/load_field', $array, $options_ancestor ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the acf/load_field callback 
  2. function filter_acf_load_field( $array, $options_ancestor ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'acf/load_field', 'filter_acf_load_field', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'acf/load_field', 'filter_acf_load_field', 10, 2 ); 

Defined (7)

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

/core/fields/relationship.php  
  1. $ancestor = apply_filters('acf/load_field', array(), $options['ancestor'] ); 
  1. $field = apply_filters('acf/load_field', array(), $options['field_key'] ); 
/core/controllers/field_group.php  
  1. $field = apply_filters('acf/load_field', false, $row['meta_key'], $post_id ); 
/core/api.php  
  1. $field = apply_filters('acf/load_field', false, $field_key ); 
  1. $field = apply_filters('acf/load_field', $field, $field['key'] ); 
  1. $fields[] = apply_filters('acf/load_field', $f, $f['key']); 
/acf.php  
  1. $f = apply_filters('acf/load_field', false, $k );