Added UTM params to vendor URL.

This commit is contained in:
And Finally 2021-10-13 14:14:49 +01:00 committed by Timur Gogolev
parent a31f874763
commit dd53c8d62b
1 changed files with 24 additions and 9 deletions

View File

@ -164,6 +164,21 @@ function wccom_get_star_class( $rating, $index ) {
<?php if ( ! empty( $addon->vendor_name ) && ! empty( $addon->vendor_url ) ) : ?>
<div class="product-developed-by">
<?php
$parsed_vendor_url = parse_url( $addon->vendor_url );
if ( $parsed_vendor_url['path'] == null ) {
$addon->vendor_url .= '/';
}
$separator = ( $parsed_vendor_url['query'] == null ) ? '?' : '&';
$query = http_build_query(
array(
'utm_source' => 'extensionsscreen',
'utm_medium' => 'product',
'utm_campaign' => 'wcaddons',
'utm_content' => 'devpartner',
)
);
$addon->vendor_url .= $separator . $query;
printf(
/* translators: %s vendor link */
esc_html__( 'Developed by %s', 'woocommerce' ),