customize-section-button icon indicating copy to clipboard operation
customize-section-button copied to clipboard

Consider escaping button_url with esc_url_raw instead of esc_url for query args.

Open JiveDig opened this issue 4 years ago • 0 comments

I'm planning to add an upsell in our theme and add some Google Tag Manager utm query args. Using esc_url() replaces entities for display the & in the url.

I'm not sure this is an issue with GTM, but knowing how finicky things have been in the past I'm leery to have anything but exactly what they ask for in the URL.

I have https://example.com/?utm_source=engine&utm_medium=customizer&utm_campaign=mt-plugins (via add_query_arg)

esc_url gives: https://bizbudding.com/product-category/plugins?utm_source=engine&utm_medium=customizer&utm_campaign=mt-plugins

esc_url_raw gives: https://example.com/?utm_source=engine&utm_medium=customizer&utm_campaign=mt-plugins

JiveDig avatar Dec 15 '20 22:12 JiveDig