get_translated_template( $template_id, $locale ); if( empty( $translated_template ) ) return $body; return $translated_template->post_content; } function translated_subject( $body, $headers, $data, $created, $user_id ){ $locale = ACUI_Helper::get_value_from_row( 'locale', $headers, $data, $user_id ); if( empty( $locale ) ) return $body; $template_id = get_option( "acui_mail_template_id" ); $locale = substr( $locale, 0, 2 ); $translated_template = $this->get_translated_template( $template_id, $locale ); if( empty( $translated_template ) ) return $body; return $translated_template->post_title; } } $acui_wpml = new ACUI_WPML(); $acui_wpml->hooks();