Make WordPress Core

Ticket #50066: 50066.edit-media.diff

File 50066.edit-media.diff, 3.4 KB (added by sabernhardt, 5 years ago)

including the Edit Media screen alt text field, without editing styles

  • src/wp-admin/includes/media.php

     
    31823182        <?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>
    31833183                <p class="attachment-alt-text">
    31843184                        <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />
    3185                         <input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" aria-describedby="alt-text-description" value="<?php echo esc_attr( $alt_text ); ?>" />
     3185                        <textarea class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" aria-describedby="alt-text-description"><?php echo esc_attr( $alt_text ); ?></textarea>
    31863186                </p>
    31873187                <p class="attachment-alt-text-description" id="alt-text-description">
    31883188                <?php
  • src/wp-includes/media-template.php

     
    454454                                <# if ( 'image' === data.type ) { #>
    455455                                        <span class="setting has-description" data-setting="alt">
    456456                                                <label for="attachment-details-two-column-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label>
    457                                                 <input type="text" id="attachment-details-two-column-alt-text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} />
     457                                                <textarea id="attachment-details-two-column-alt-text" aria-describedby="alt-text-description" {{ maybeReadOnly }}>{{ data.alt }}</textarea>
    458458                                        </span>
    459459                                        <p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
    460460                                <# } #>
     
    655655                <# if ( 'image' === data.type ) { #>
    656656                        <span class="setting has-description" data-setting="alt">
    657657                                <label for="attachment-details-alt-text" class="name"><?php _e( 'Alt Text' ); ?></label>
    658                                 <input type="text" id="attachment-details-alt-text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} />
     658                                <textarea id="attachment-details-alt-text" aria-describedby="alt-text-description" {{ maybeReadOnly }}>{{ data.alt }}</textarea>
    659659                        </span>
    660660                        <p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
    661661                <# } #>
     
    957957
    958958                <span class="setting alt-text has-description">
    959959                        <label for="embed-image-settings-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label>
    960                         <input type="text" id="embed-image-settings-alt-text" data-setting="alt" aria-describedby="alt-text-description" />
     960                        <textarea id="embed-image-settings-alt-text" data-setting="alt" aria-describedby="alt-text-description"></textarea>
    961961                </span>
    962962                <p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
    963963
     
    10201020                                <div class="column-settings">
    10211021                                        <span class="setting alt-text has-description">
    10221022                                                <label for="image-details-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label>
    1023                                                 <input type="text" id="image-details-alt-text" data-setting="alt" value="{{ data.model.alt }}" aria-describedby="alt-text-description" />
     1023                                                <textarea id="image-details-alt-text" data-setting="alt" aria-describedby="alt-text-description">{{ data.model.alt }}</textarea>
    10241024                                        </span>
    10251025                                        <p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
    10261026