-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Bug - Class removed from links whenever they are edited #38878
Comments
I noticed there's been some previous discussion here about adding classes to links - #13368. |
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks. |
The issue is that there is no way to add a class to a link in the current iteration of WordPress. I'm not sure how else to put it. You need to include this functionality. Pushing an update that removed it was a regression that broke websites all over the place. What additional information are you after? You say you can't reproduce but then you described that in fact you could. "I did notice the class is removed when editing and resubmitting the link" That is a critical issue. "Were you testing using the paragraph block or a different block?" Which block you use is irrelevant. No blocks support putting a class on a link any more. The functionality was inexplicably removed. But yes, the paragraph would be the most pertinent, as well as lists. |
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks. |
I don't believe this is true. From my testing I too can add a class to a link using 'Edit as HTML', and it is able to be published. The issue I see (and I think this is what @talldan found as well), is that if the link is edited afterwards (text or URL) the class is removed. As such I think it should be treated as a bug and in order to get this addressed the title should be changed to 'Link editing: HTML Please respond if you think otherwise. |
That may be a bug, but it was also a completely ridiculous move to remove the ability to add this via the GUI. |
We feel your frustration. A ticket tracking Link Control enhancement now covers this functionality: #23011 (comment) If you’d like this bug addressed separately I’d suggest updating the title and description to help our community maintainers work on it. |
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks. |
What more information do you need? It's not like it's hard to reproduce. Just stop removing the class from the link after the block is edited. |
Hey @frogdesk, could you add a bit of context? I'm curious what your use case is here for adding classes to links. |
|
Modals is the biggest use case for me as well. Additionally there are times that I want a link to be highlighted or displayed differently than other links. Perhaps the font or color is different. Perhaps I want to add an icon. Regardless, CSS Classes is a pretty standard thing to want to apply to elements. It should have an interface where classes can be added to links. It exists elsewhere in wordpress (menus, image links, etc.). It needs to be added to text links as well. |
Description
There is absolutely no way to add a class to a link in the current version of WordPress. Additionally, when saving a post, any classes added in previous versions are removed. These are critical bugs that should have been release blockers.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
Current
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: