apply_filters( 'wcml_new_order_admin_email_language', $admin_language, $recipient, $order_id )
- Type
- filter
- Category
- Miscellaneous
- WooCommerce Multilingual Version
- 4.7.0
Description
Use this filter to set the language of the email sent to the administrator when a new order is placed or the status of an existing one changes.
Arguments
There are three parameters being passed to this filter:- $admin_language
- (string) The admin user language.
- $recipient
- (string) The admin user email.
- $order_id
- (integer) The order ID.
- admin user language
- $recipient admin user email
- order id
Example usage
Example
add_filter( 'wcml_new_order_admin_email_language', 'use_order_language_for_new_order_admin_email', 10, 3 );
function use_order_language_for_new_order_admin_email( $admin_language, $recipient, $order_id ){
$order_language = get_post_meta( $order_id, 'wpml_language', true );
return $order_language ? $order_language : $admin_language;
}
Related hooks
translate_shipping_methods_in_package, wcml_gui_additional_box_html, wcml_current_gateway_language, wcml_variation_term_taxonomy_ids, wcml_is_attributes_page, wcml_is_variable_product, wcml_gui_additional_box_data, wcml_after_load_lock_fields_js, wcml_wc_installed_pages, wcml_not_display_single_fields_to_translate