-
Notifications
You must be signed in to change notification settings - Fork 877
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
Link tag attributes "data-type" and "data-id" missing #17035
Comments
Confirmed and copied to our internal bugtracker at https://yoast.atlassian.net/browse/IM-171 |
Hey all! I'd love to see a fix for this. I'm using the data-id attribute to check if the link is to the current page so that I can apply a 'current-page' class with JS. This bug completely breaks that functionality. |
Hi everyone! This feature is very important. Does anyone knows a workaround to fix this? Thanks! |
+1 |
Please give us a description of what happened.
When we add an internal link to a wordpress page inline (see https://wordpress.com/support/links/#method-one-the-link-button, second gif), the generated html tag has no attributes
data-type="page"
anddata-id="<id>"
with Yoast SEO activated.Please describe what you expected to happen and why.
The html tag for the link has the attributes
data-type="page"
anddata-id="<id>"
, because this is WordPress default. Having the attributes attached is crucial when using the rest api in a consuming application. E.g. in a single page application, such a link has to be modified to trigger a callback function that is fetching the content of the linked page instead of including the link as is. Without the information, that the link is a link to an internal page with a known id, it is hard to decide for the spa how to handle it. Corresponding support topic: https://wordpress.org/support/topic/link-tag-attributes-missing/How can we reproduce this behavior?
Technical info
Used versions
The text was updated successfully, but these errors were encountered: