acf/rest/get_fields filter-hookACF 1.0

Filter the fields available to the REST API.

Usage

add_filter( 'acf/rest/get_fields', 'wp_kama_acf_rest_get_fields_filter', 10, 3 );

/**
 * Function for `acf/rest/get_fields` filter-hook.
 * 
 * @param array  $fields      The ACF fields for this field group.
 * @param array  $resource    Contextual information about the current resource request.
 * @param string $http_method The HTTP method of the current request (GET, POST, PUT, PATCH, DELETE,
 *                            OPTION, HEAD).
 *
 * @return array
 */
function wp_kama_acf_rest_get_fields_filter( $fields, $resource, $http_method ){
	// filter...
	return $fields;
}
$fields(array)
The ACF fields for this field group.
$resource(array)
Contextual information about the current resource request.
$http_method(string)
The HTTP method of the current request (GET, POST, PUT, PATCH, DELETE, OPTION, HEAD).

Where the hook is called

ACF_Rest_Api::get_fields()
acf/rest/get_fields
acf/includes/rest-api/class-acf-rest-api.php 566
return (array) apply_filters( 'acf/rest/get_fields', $fields, $resource, $http_method );

Where the hook is used in Advanced Custom Fields PRO

Usage not found.