Changeset 8313 for trunk/wp-admin/includes/media.php
- Timestamp:
- 07/11/2008 03:59:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r8312 r8313 68 68 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 69 69 70 if ( empty($alt) ) return $html;70 if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; 71 71 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 72 72 … … 78 78 if ( empty($align) ) $align = 'none'; 79 79 80 $shcode = '[ wp_caption id="' . $id . '" align="align' . $align81 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/ wp_caption]';80 $shcode = '[caption id="' . $id . '" align="align' . $align 81 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; 82 82 83 83 return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); … … 509 509 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 510 510 $form_fields['post_title']['required'] = true; 511 $form_fields['post_excerpt']['label'] = __('Caption'); 512 $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"'); 511 512 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 513 $form_fields['post_excerpt']['label'] = __('Alternate Text'); 514 $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); 515 } else { 516 $form_fields['post_excerpt']['label'] = __('Caption'); 517 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 518 } 513 519 514 520 $form_fields['post_content']['label'] = __('Description'); … … 599 605 $link = get_attachment_link($post->ID); 600 606 607 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 608 $alt = __('Alternate Text'); 609 else 610 $alt = __('Caption'); 611 601 612 $form_fields = array( 602 613 'post_title' => array( … … 605 616 ), 606 617 'post_excerpt' => array( 607 'label' => __('Caption'),618 'label' => $alt, 608 619 'value' => $edit_post->post_excerpt, 609 620 ), … … 1008 1019 if ( f.alt.value ) { 1009 1020 alt = f.alt.value.replace(/['"<>]+/g, ''); 1021 <?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { ?> 1010 1022 caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 1023 <?php } ?> 1011 1024 } 1012 1025 … … 1019 1032 1020 1033 if ( caption ) 1021 html = '[ wp_caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/wp_caption]';1034 html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]'; 1022 1035 1023 1036 var win = window.dialogArguments || opener || parent || top; … … 1263 1276 1264 1277 function type_form_image() { 1265 return'1278 $form = ' 1266 1279 <table class="describe"><tbody> 1267 1280 <tr> … … 1280 1293 <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 1281 1294 </tr> 1282 1295 '; 1296 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 1297 $form .= ' 1298 <tr> 1299 <th valign="top" scope="row" class="label"> 1300 <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span> 1301 </th> 1302 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1303 <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td> 1304 </tr> 1305 '; 1306 1307 } else { 1308 $form .= ' 1283 1309 <tr> 1284 1310 <th valign="top" scope="row" class="label"> … … 1288 1314 <p class="help">' . __('Also used as alternate text for the image') . '</p></td> 1289 1315 </tr> 1290 1316 '; 1317 } 1318 $form .= ' 1291 1319 <tr class="align"> 1292 1320 <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> … … 1322 1350 </tbody></table> 1323 1351 '; 1352 1353 return $form; 1324 1354 } 1325 1355
Note: See TracChangeset
for help on using the changeset viewer.