Link generated with shortcode issue…
-
Hi!
When using the Button Group widget, and using a shortcode as the link, it seems like some encoding occurs and prevents WP from functioning properly. Let me explain.
My custom shortcode returns a URL, that I build dynamically with
add_query_arg
. If there is only one argument, it’s fine. But my URL has 2 arguments. The code is similar to this:$url = add_query_arg(array( 'type' => 'tmp', 'slid' => get_the_ID() ), get_permalink(1111)); return $url;
For some reason, when I’m using the shortcode with your Button Group widget, the URL I’m getting is this:
https://dev.com/?type=tmp<span style=”text-decoration: underline;”>&</span>slid=364
But I should be getting this (note the
&
not being encoded):https://dev.com/?type=tmp<span style=”text-decoration: underline;”>&</span>slid=364
When using that same shortcode on an Elementor basic button, it’s working fine. Even as a plain shortcode I’m getting the right URL. That’s why I’m leaning toward a manipulation from your plugin. Are you guys using
htmlentities
before rendering the link?That being said, normally I wouldn’t care much. But using
get_query_var
is not working if the&
is encoded as&
.Please advise ??
- The topic ‘Link generated with shortcode issue…’ is closed to new replies.