Media: Change alt attribute field to textarea in media library.

Change the input field used for `alt` attributes in the media library views from a text input to a textarea. This gives users more flexibility in resizing the field for easier management of longer alt attributes. 

This patch includes a less-common use of `esc_attr` for a `textarea`. This is because the primary usage of the `alt` attribute will be escaped using `esc_attr`, and the value in editing should match the value output on the front end.

Props edent, sabernhardt, afercia, JavierCasares, audrasjb, joedolson.
Fixes #50066.

git-svn-id: https://develop.svn.wordpress.org/trunk@54243 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson
2022-09-20 04:00:35 +00:00
parent f450acf7af
commit 4c173550a2
5 changed files with 52 additions and 25 deletions
+20 -2
View File
@@ -781,8 +781,8 @@ border color while dragging a file over the uploader drop area */
.edit-attachment-frame input,
.edit-attachment-frame textarea {
padding: 6px 8px;
line-height: 1.14285714;
padding: 4px 8px;
line-height: 1.42857143;
}
.edit-attachment-frame .attachment-info {
@@ -849,6 +849,11 @@ border color while dragging a file over the uploader drop area */
margin-bottom: 5px;
}
.wp_attachment_details #attachment_alt {
max-width: 500px;
height: 3.28571428em;
}
.wp_attachment_details .attachment-alt-text-description {
margin-top: 5px;
}
@@ -1231,11 +1236,24 @@ audio, video {
}
@media screen and (max-width: 782px) {
.edit-attachment-frame input,
.edit-attachment-frame textarea {
line-height: 1.5;
}
.wp_attachment_details label[for="content"] {
font-size: 14px;
line-height: 1.5;
}
.wp_attachment_details textarea {
line-height: 1.5;
}
.wp_attachment_details #attachment_alt {
height: 3.375em;
}
.media-upload-form .media-item.error,
.media-upload-form .media-item .error {
font-size: 13px;