Bug: bad URL in @id
-
There’s a bug in the
get_current_url()
function. Actually, the bug lies in the way the functionhome_url()
is being used.My specific case is when WP is installed in a subfolder “/blog” and the URL is also like “site.com/blog”. In this scenario, both the WordPress Address (URL) and Site Address (URL) are set to
https://site.com/blog
.However, in this case, the
$url
that we generate in the functionget_current_url
becomeshttps://site.com/blog/blog/some/more/
. So, you’ll notice “/blog” is duplicated.This duplicate string part is visible in the generated schema as
@id
. Although it’s not catastrophic, I felt the need to address it.Since the plugin doesn’t provide any hook here, I had to hook into
home_url
itself to correct the value.I would like to ask the author to do one of the two:
- to insert some hook into the
get_current_url
function - to fix bug and ensure that this problem doesn’t exist no more
Thanks!
- to insert some hook into the
- The topic ‘Bug: bad URL in @id’ is closed to new replies.