rest_(object_type)_additional_fields filter-hookWC 10.2.0

Filter additional fields for objects of this type.

Usage

add_filter( 'rest_(object_type)_additional_fields', 'wp_kama_rest_object_type_additional_fields_filter', 10, 2 );

/**
 * Function for `rest_(object_type)_additional_fields` filter-hook.
 * 
 * @param array  $fields      Additional fields registered for the object type.
 * @param string $object_type Object type.
 *
 * @return array
 */
function wp_kama_rest_object_type_additional_fields_filter( $fields, $object_type ){

	// filter...
	return $fields;
}
$fields(array)
Additional fields registered for the object type.
$object_type(string)
Object type.

Changelog

Since 10.2.0 Introduced.

Where the hook is called

UpdateUtils::get_additional_fields()
rest_(object_type)_additional_fields
woocommerce/src/Internal/RestApi/Routes/V4/Customers/UpdateUtils.php 165
$fields = apply_filters( "rest_{$this->get_object_type()}_additional_fields", $fields, 'user' );

Where the hook is used in WooCommerce

Usage not found.