• Resolved cvladan

    (@cvladan)


    There’s a bug in the get_current_url() function. Actually, the bug lies in the way the function home_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 function get_current_url becomes https://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:

    1. to insert some hook into the get_current_url function
    2. to fix bug and ensure that this problem doesn’t exist no more

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug: bad URL in @id’ is closed to new replies.