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
+9
View File
@@ -100,6 +100,7 @@
color: #2c3338;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
line-height: 1.38461538;
}
.media-frame input[type="text"],
@@ -529,6 +530,13 @@
resize: vertical;
}
.media-sidebar .alt-text textarea,
.attachment-details .alt-text textarea,
.compat-item .alt-text textarea,
.alt-text textarea {
height: 50px;
}
.compat-item {
float: left;
width: 100%;
@@ -2798,6 +2806,7 @@
.media-frame textarea,
.media-frame select {
font-size: 16px;
line-height: 1.5;
}
.media-frame .media-toolbar input[type="search"] {