wc_order_attribution_origin_label filter-hookWC 8.5.0

Filter the label for the order origin.

This label should have a %s placeholder for the formatted source to be inserted via sprintf().

Usage

add_filter( 'wc_order_attribution_origin_label', 'wp_kama_wc_order_attribution_origin_label_filter', 10, 4 );

/**
 * Function for `wc_order_attribution_origin_label` filter-hook.
 * 
 * @param string $label            The label for the order origin.
 * @param string $source_type      The source type.
 * @param string $source           The source.
 * @param string $formatted_source The formatted source.
 *
 * @return string
 */
function wp_kama_wc_order_attribution_origin_label_filter( $label, $source_type, $source, $formatted_source ){

	// filter...
	return $label;
}
$label(string)
The label for the order origin.
$source_type(string)
The source type.
$source(string)
The source.
$formatted_source(string)
The formatted source.

Changelog

Since 8.5.0 Introduced.

Where the hook is called

In file: /src/Internal/Traits/OrderAttributionMeta.php
wc_order_attribution_origin_label
woocommerce/src/Internal/Traits/OrderAttributionMeta.php 351-357
$label = (string) apply_filters(
	'wc_order_attribution_origin_label',
	$label,
	$source_type,
	$source,
	$formatted_source
);

Where the hook is used in WooCommerce

Usage not found.