Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't echo hreflang if returned value is empty #1038

Closed
reekrd opened this issue Jun 9, 2021 · 3 comments
Closed

Don't echo hreflang if returned value is empty #1038

reekrd opened this issue Jun 9, 2021 · 3 comments
Labels
core Core functionalities, including the admin section enhancement New feature or request

Comments

@reekrd
Copy link

reekrd commented Jun 9, 2021

Hi,

our site is translated into two languages and a subpart of it is translated into five languages.

We want to avoid having <link hreflang=...> to all languages on pages where content is only translated in english and dutch.

I have not installed the latest release so have not tried the new filter. But looking at qtranxf_wp_head if the returned value from the filter qtranslate_hreflang returns empty then don't echo <link hreflang=...>

Cheers and thank you for the excellent work
.rickard

@reekrd
Copy link
Author

reekrd commented Jun 9, 2021

I was looking at code here: https://github.com/qtranslate/qtranslate-xt/blob/6837ebb4733a030fb0ef64f75ba0be59a747b9eb/qtranslate_frontend.php

I know I see that is not part of a release

@herrvigg
Copy link
Collaborator

I was looking at code here: https://github.com/qtranslate/qtranslate-xt/blob/6837ebb4733a030fb0ef64f75ba0be59a747b9eb/qtranslate_frontend.php

I know I see that is not part of a release

It was a temporary attempt but I removed it as I wasn't so happy with it for the handling of the locales, in relation to #668 and #1030.

Your need is different as I can see in #1039 but I have to rethink this better to come up with a filter better suited for all cases.

@herrvigg herrvigg added core Core functionalities, including the admin section enhancement New feature or request labels Jun 12, 2021
@herrvigg
Copy link
Collaborator

herrvigg commented Aug 8, 2021

Closed by #1039 (still to be done).

@herrvigg herrvigg closed this as completed Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionalities, including the admin section enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants