Ticket #22613: 22613.3.diff
| File 22613.3.diff, 4.0 KB (added by helenyhou, 7 months ago) |
|---|
-
wp-includes/media.php
1658 1658 <a class="check" href="#" title="<?php _e('Deselect'); ?>"><div class="media-modal-icon"></div></a> 1659 1659 <# } #> 1660 1660 </div> 1661 <# if ( data.describe ) { #> 1661 <# 1662 var maybeReadOnly = data.can.save ? '' : 'readonly'; 1663 if ( data.describe ) { #> 1662 1664 <# if ( 'image' === data.type ) { #> 1663 1665 <input type="text" value="{{ data.caption }}" class="describe" data-setting="caption" 1664 placeholder="<?php esc_attr_e('Describe this image…'); ?>" />1666 placeholder="<?php esc_attr_e('Describe this image…'); ?>" {{ maybeReadOnly }} /> 1665 1667 <# } else { #> 1666 1668 <input type="text" value="{{ data.title }}" class="describe" data-setting="title" 1667 1669 <# if ( 'video' === data.type ) { #> … … 1670 1672 placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 1671 1673 <# } else { #> 1672 1674 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 1673 <# } #> />1675 <# } #> {{ maybeReadOnly }} /> 1674 1676 <# } #> 1675 1677 <# } #> 1676 1678 </script> … … 1713 1715 </div> 1714 1716 </div> 1715 1717 1716 <# if ( 'image' === data.type ) { #> 1718 <# 1719 var maybeReadOnly = data.can.save ? '' : 'readonly'; 1720 if ( 'image' === data.type ) { #> 1717 1721 <label class="setting" data-setting="title"> 1718 1722 <span><?php _e('Title'); ?></span> 1719 <input type="text" value="{{ data.title }}" />1723 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 1720 1724 </label> 1721 1725 <label class="setting" data-setting="caption"> 1722 1726 <span><?php _e('Caption'); ?></span> 1723 <textarea 1727 <textarea {{ maybeReadOnly }} 1724 1728 placeholder="<?php esc_attr_e('Describe this image…'); ?>" 1725 1729 >{{ data.caption }}</textarea> 1726 1730 </label> 1727 1731 <label class="setting" data-setting="alt"> 1728 1732 <span><?php _e('Alt Text'); ?></span> 1729 <input type="text" value="{{ data.alt }}" />1733 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 1730 1734 </label> 1731 1735 <# } else { #> 1732 1736 <label class="setting" data-setting="title"> 1733 1737 <span><?php _e('Title'); ?></span> 1734 <input type="text" value="{{ data.title }}" 1738 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} 1735 1739 <# if ( 'video' === data.type ) { #> 1736 1740 placeholder="<?php esc_attr_e('Describe this video…'); ?>" 1737 1741 <# } else if ( 'audio' === data.type ) { #> -
wp-admin/includes/media.php
1290 1290 'description' => false, 1291 1291 ); 1292 1292 1293 $user_can_edit = current_user_can( 'edit_post', $attachment_id ); 1294 1293 1295 $args = wp_parse_args( $args, $default_args ); 1294 1296 $args = apply_filters( 'get_media_item_args', $args ); 1295 1297 … … 1314 1316 foreach ( $terms as $term ) 1315 1317 $values[] = $term->slug; 1316 1318 $t['value'] = join(', ', $values); 1319 $t['taxonomy'] = true; 1317 1320 1318 1321 $form_fields[$taxonomy] = $t; 1319 1322 } … … 1363 1366 continue; 1364 1367 } 1365 1368 1369 $readonly = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? " readonly='readonly' " : ''; 1366 1370 $required = $field['required'] ? '<span class="alignright"><abbr title="required" class="required">*</abbr></span>' : ''; 1367 1371 $aria_required = $field['required'] ? " aria-required='true' " : ''; 1368 1372 $class = 'compat-field-' . $id; … … 1381 1385 } 1382 1386 $item .= "<textarea id='$id_attr' name='$name' $aria_required>" . $field['value'] . '</textarea>'; 1383 1387 } else { 1384 $item .= "<input type='text' class='text' id='$id_attr' name='$name' value='" . esc_attr( $field['value'] ) . "' $ aria_required />";1388 $item .= "<input type='text' class='text' id='$id_attr' name='$name' value='" . esc_attr( $field['value'] ) . "' $readonly $aria_required />"; 1385 1389 } 1386 1390 if ( !empty( $field['helps'] ) ) 1387 1391 $item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';