Remove unneeded empty "Unknown" code handling in Order Attribution (#46654)
* Remove empty "Unknown" handling. This is because `get_origin_label` would return "Unknown" by default, and therefore empty($origin) would not be true. If someone use a wc_order_attribution_origin_formatted_source filter to return '' as the formatted source, we should respect it anyway and we should not override it with "Unknown". * Add changelog.
This commit is contained in:
parent
1fddbb1001
commit
6e78a1c6ca
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: tweak
|
||||
|
||||
Remove unneeded empty "Unknown" code handling in Order Attribution.
|
|
@ -335,9 +335,6 @@ class OrderAttributionController implements RegisterHooksInterface {
|
|||
$source_type = $order->get_meta( $this->get_meta_prefixed_field_name( 'source_type' ) );
|
||||
$source = $order->get_meta( $this->get_meta_prefixed_field_name( 'utm_source' ) );
|
||||
$origin = $this->get_origin_label( $source_type, $source );
|
||||
if ( empty( $origin ) ) {
|
||||
$origin = __( 'Unknown', 'woocommerce' );
|
||||
}
|
||||
echo esc_html( $origin );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue