WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/10/2012 11:32:48 PM (9 years ago)
Author:
koopersmith
Message:

Caption editing in the media modal library.

  • Adds a describe option to the workflow controller to support inline caption editing.
  • For images, descriptions are mapped to the caption attribute.
  • For other media items, descriptions are mapped to the title attribute.
  • Descriptions are saved when the textarea's change event fires (i.e. when the textarea is blurred).

fixes #21807, see #21390.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r22170 r22173  
    13461346            <% } %>
    13471347        </div>
    1348         <div class="describe"></div>
     1348        <% if ( describe ) { %>
     1349            <% if ( 'image' === type ) { %>
     1350                <textarea class="describe"
     1351                    placeholder="<?php esc_attr_e('Describe this image&hellip;'); ?>"
     1352                    ><%- caption %></textarea>
     1353            <% } else { %>
     1354                <textarea class="describe"
     1355                    <% if ( 'video' === type ) { %>
     1356                        placeholder="<?php esc_attr_e('Describe this video&hellip;'); ?>"
     1357                    <% } else if ( 'audio' === type ) { %>
     1358                        placeholder="<?php esc_attr_e('Describe this audio file&hellip;'); ?>"
     1359                    <% } else { %>
     1360                        placeholder="<?php esc_attr_e('Describe this media file&hellip;'); ?>"
     1361                    <% } %>
     1362                    ><%- title %></textarea>
     1363            <% } %>
     1364        <% } %>
    13491365    </script>
    13501366
Note: See TracChangeset for help on using the changeset viewer.