WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r8607 r8321  
    6868function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
    6969
    70     if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html;
     70    // CAPTIONS_OFF is temporary. Do not use it.
     71    if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html;
    7172    $id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
    7273
     
    103104
    104105    if ( isset($file['error']) )
    105         return new WP_Error( 'upload_error', $file['error'] );
     106        return new wp_error( 'upload_error', $file['error'] );
    106107
    107108    $url = $file['url'];
     
    143144
    144145    if ( isset($file['error']) )
    145         return new WP_Error( 'upload_error', $file['error'] );
     146        return new wp_error( 'upload_error', $file['error'] );
    146147
    147148    $url = $file['url'];
     
    281282        $keys = array_keys($_POST['send']);
    282283        $send_id = (int) array_shift($keys);
    283         $attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
     284        $attachment = $_POST['attachments'][$send_id];
    284285        $html = $attachment['post_title'];
    285286        if ( !empty($attachment['url']) ) {
     
    510511        $form_fields['post_title']['required'] = true;
    511512
    512         $form_fields['post_excerpt']['label'] = __('Caption');
    513         $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
     513        // CAPTIONS_OFF is temporary. Do not use it.
     514        if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {
     515            $form_fields['post_excerpt']['label'] = __('Alternate Text');
     516            $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"');
     517        } else {
     518            $form_fields['post_excerpt']['label'] = __('Caption');
     519            $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
     520        }
    514521
    515522        $form_fields['post_content']['label'] = __('Description');
     
    600607    $link = get_attachment_link($post->ID);
    601608
     609    // CAPTIONS_OFF is temporary. Do not use it.
     610    if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )
     611        $alt = __('Alternate Text');
     612    else
     613        $alt = __('Caption');
     614
    602615    $form_fields = array(
    603616        'post_title'   => array(
     
    606619        ),
    607620        'post_excerpt' => array(
    608             'label'      => __('Caption'),
     621            'label'      => $alt,
    609622            'value'      => $edit_post->post_excerpt,
    610623        ),
     
    872885
    873886?>
     887<input type='hidden' name='post_id' value='<?php echo (int) $post_id; ?>' />
    874888<div id="media-upload-notice">
    875889<?php if (isset($errors['upload_notice']) ) { ?>
     
    934948<?php do_action('pre-html-upload-ui'); ?>
    935949    <p>
    936     <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onclick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
     950    <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onClick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
    937951    </p>
     952    <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
    938953    <br class="clear" />
    939954    <?php if ( is_lighttpd_before_150() ): ?>
     
    10071022        if ( f.alt.value ) {
    10081023            alt = f.alt.value.replace(/['"<>]+/g, '');
    1009 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
     1024<?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it. ?>
    10101025            caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
    10111026<?php } ?>
     
    10681083</div>
    10691084<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
    1070 </form>
    10711085<?php
    10721086    endif;
     
    12651279
    12661280function type_form_image() {
    1267 
    1268     if ( apply_filters( 'disable_captions', '' ) ) {
    1269         $alt = __('Alternate Text');
    1270         $alt_help = __('Alt text for the image, e.g. "The Mona Lisa"');
    1271     } else {
    1272         $alt = __('Image Caption');
    1273         $alt_help = __('Also used as alternate text for the image');
    1274     }
    1275 
    1276     return '
     1281    $form = '
    12771282    <table class="describe"><tbody>
    12781283        <tr>
     
    12811286                <span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span>
    12821287            </th>
    1283             <td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
     1288            <td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()"></td>
    12841289        </tr>
    12851290
     
    12911296            <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
    12921297        </tr>
    1293 
     1298';
     1299    // CAPTIONS_OFF is temporary. Do not use it.
     1300    if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {
     1301        $form .= '
    12941302        <tr>
    12951303            <th valign="top" scope="row" class="label">
    1296                 <span class="alignleft"><label for="alt">' . $alt . '</label></span>
     1304                <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span>
    12971305            </th>
    12981306            <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
    1299             <p class="help">' . $alt_help . '</p></td>
    1300         </tr>
    1301 
     1307            <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td>
     1308        </tr>
     1309';
     1310
     1311    } else {
     1312        $form .= '
     1313        <tr>
     1314            <th valign="top" scope="row" class="label">
     1315                <span class="alignleft"><label for="alt">' . __('Image Caption') . '</label></span>
     1316            </th>
     1317            <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
     1318            <p class="help">' . __('Also used as alternate text for the image') . '</p></td>
     1319        </tr>
     1320';
     1321    }
     1322        $form .= '
    13021323        <tr class="align">
    13031324            <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
     
    13341355';
    13351356
     1357    return $form;
    13361358}
    13371359
Note: See TracChangeset for help on using the changeset viewer.