Why is colon : striped out of url when returned in shortcode
-
I’m trying to return the site_url in a shortcode. In simple PHP I’m verifying with inspecting the following statement and it is fine…
get_site_url() // echos string(20) "https://mydomain.com
… but the following strips out the colon : from the url.
add_shortcode('site_url', 'shortcode_site_url'); function shortcode_site_url() { return get_site_url(); } // Shortcode returns "https//mydomain.com". Notice that the : is missing from the shortcode return.
Why does the shortcode function strip out the colon? I searched through the forum and there are a number of other reports all with the same / similar issue, though I have not found any solution or reason.
To me, this is a bug.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Why is colon : striped out of url when returned in shortcode’ is closed to new replies.