-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Remove redundant title attributes from Classic Editor placeholders #8263
Remove redundant title attributes from Classic Editor placeholders #8263
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
@@ -147,7 +147,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { | |||
'class="mce-object" ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting this PR.
To make a visual distinction between the style and script placeholders, you could:
- Add small
style.png
andscript.png
images to thesrc\js\_enqueues\vendor\tinymce\skins\wordpress\images
directory. - Add styles to
src\js\_enqueues\vendor\tinymce\skins\wordpress\wp-content.css
, probably after.mce-content-body img[data-wp-more="nextpage"]
.
.mce-content-body img.mce-object-style {
background-image: url( images/style.png );
}
.mce-content-body img.mce-object-script {
background-image: url( images/script.png );
}
- Add an extra class to the placeholder images.
'class="mce-object" ' + | |
'class="mce-object mce-object-' + tag + '" ' + |
I made these simple images with "CSS" and "JS" (in Trebuchet MS font) at 20 by 20 pixels, if you would like to use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sabernhardt for the suggestions.
I have used SVGs for the images and addressed all the changes in the latest commit.
Hey @sabernhardt, Thanks for reviewing the PR. Now that the changes look good to you, shall I go ahead and make the changes in the other places as you suggested in the ticket 62861? |
No, leave the external libraries as they are. |
Merged in the Changeset [60007] |
Trac ticket: 62861
This PR removes redundant title attributes from Classic Editor placeholder images and moves tooltip text to alt attributes for better accessibility.
Currently, The Classic Editor uses placeholder images for special elements (More tag, Next Page tag, Style/Script tags).
This causes accessibility issues as:
This PR: