acf/load_field
The Advanced Custom Fields acf load field hook.
Description
Parameters (2)
- 0. $array (array) =>
array()
- The array.
- 1. $options_ancestor (unknown)
- The options ancestor.
Usage
- To run the hook, copy the example below.
- $array = apply_filters( 'acf/load_field', $array, $options_ancestor );
- if ( !empty( $array ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the acf/load_field callback
- function filter_acf_load_field( $array, $options_ancestor ) {
- // make filter magic happen here...
- return $array;
- };
- // add the filter
- add_filter( 'acf/load_field', 'filter_acf_load_field', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- $ancestor = apply_filters('acf/load_field', array(), $options['ancestor'] );
- $field = apply_filters('acf/load_field', array(), $options['field_key'] );
- /core/controllers/field_group.php
- $field = apply_filters('acf/load_field', false, $row['meta_key'], $post_id );
- /core/api.php
- $field = apply_filters('acf/load_field', false, $field_key );
- $field = apply_filters('acf/load_field', $field, $field['key'] );
- $fields[] = apply_filters('acf/load_field', $f, $f['key']);
- /acf.php
- $f = apply_filters('acf/load_field', false, $k );