woocommerce_filter_fields_for_order_confirmation
Filter fields for order confirmation (thank you page, email).
Used in methods: WC_Email::additional_checkout_fields WC_Email::additional_address_fields CheckoutFieldsFrontend::render_order_other_fields AdditionalFields::render_content
Usage
add_filter( 'woocommerce_filter_fields_for_order_confirmation', 'wp_kama_woocommerce_filter_fields_for_order_confirmation_filter', 10, 5 );
/**
* Function for `woocommerce_filter_fields_for_order_confirmation` filter-hook.
*
* @param bool $condition Whether the field should be shown.
* @param array $field Field data.
* @param array $fields All fields for better context when field should be shown or hidden based on other fields values.
* @param array $context Additional context for the filter. Data depends in which method filter_fields_for_order_confirmation is called.
* @param CheckoutFields $that The CheckoutFields instance.
*
* @return bool
*/
function wp_kama_woocommerce_filter_fields_for_order_confirmation_filter( $condition, $field, $fields, $context, $that ){
// filter...
return $condition;
}
- $condition(true|false)
- Whether the field should be shown.
- $field(array)
- Field data.
- $fields(array)
- All fields for better context when field should be shown or hidden based on other fields values.
- $context(array)
- Additional context for the filter. Data depends in which method filter_fields_for_order_confirmation is called.
- $that(CheckoutFields)
- The CheckoutFields instance.
Changelog
| Since 10.1.0 | Introduced. |
Where the hook is called
woocommerce_filter_fields_for_order_confirmation
woocommerce/src/Blocks/Domain/Services/CheckoutFields.php 1408
return apply_filters( 'woocommerce_filter_fields_for_order_confirmation', ! empty( $field['show_in_order_confirmation'] ), $field, $fields, $context, $this );