Added UTM params to vendor URL.
This commit is contained in:
parent
a31f874763
commit
dd53c8d62b
|
@ -164,6 +164,21 @@ function wccom_get_star_class( $rating, $index ) {
|
||||||
<?php if ( ! empty( $addon->vendor_name ) && ! empty( $addon->vendor_url ) ) : ?>
|
<?php if ( ! empty( $addon->vendor_name ) && ! empty( $addon->vendor_url ) ) : ?>
|
||||||
<div class="product-developed-by">
|
<div class="product-developed-by">
|
||||||
<?php
|
<?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(
|
printf(
|
||||||
/* translators: %s vendor link */
|
/* translators: %s vendor link */
|
||||||
esc_html__( 'Developed by %s', 'woocommerce' ),
|
esc_html__( 'Developed by %s', 'woocommerce' ),
|
||||||
|
|
Loading…
Reference in New Issue