Changeset 23072
- Timestamp:
- 12/05/2012 10:29:24 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r22948 r23072 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 ); … … 1315 1317 $values[] = $term->slug; 1316 1318 $t['value'] = join(', ', $values); 1319 $t['taxonomy'] = true; 1317 1320 1318 1321 $form_fields[$taxonomy] = $t; … … 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' " : ''; … … 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'] ) ) -
trunk/wp-includes/js/media-views.js
r23070 r23072 1544 1544 editable: true, 1545 1545 1546 // If the user isn't allowed to edit fields, 1547 // can they still edit it locally? 1548 allowLocalEdits: true, 1549 1546 1550 // Show the attachment display settings. 1547 1551 displaySettings: true, … … 2841 2845 } 2842 2846 2847 if ( this.controller.state().get('allowLocalEdits') ) 2848 options.allowLocalEdits = true; 2849 2843 2850 this.views.detach(); 2844 2851 this.$el.html( this.template( options ) ); -
trunk/wp-includes/media.php
r23061 r23072 1659 1659 <# } #> 1660 1660 </div> 1661 <# if ( data.describe ) { #> 1661 <# 1662 var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : '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" … … 1671 1673 <# } else { #> 1672 1674 placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 1673 <# } #> />1675 <# } #> {{ maybeReadOnly }} /> 1674 1676 <# } #> 1675 1677 <# } #> … … 1714 1716 </div> 1715 1717 1716 <# if ( 'image' === data.type ) { #> 1718 <# 1719 var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : '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> … … 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…'); ?>"
Note: See TracChangeset
for help on using the changeset viewer.