Changeset 8358 for trunk/wp-admin/includes/media.php
- Timestamp:
- 07/16/2008 09:36:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r8321 r8358 68 68 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 69 69 70 // CAPTIONS_OFF is temporary. Do not use it. 71 if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; 70 if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; 72 71 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 73 72 … … 511 510 $form_fields['post_title']['required'] = true; 512 511 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 } 512 $form_fields['post_excerpt']['label'] = __('Caption'); 513 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 521 514 522 515 $form_fields['post_content']['label'] = __('Description'); … … 607 600 $link = get_attachment_link($post->ID); 608 601 609 // CAPTIONS_OFF is temporary. Do not use it.610 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )611 $alt = __('Alternate Text');612 else613 $alt = __('Caption');614 615 602 $form_fields = array( 616 603 'post_title' => array( … … 619 606 ), 620 607 'post_excerpt' => array( 621 'label' => $alt,608 'label' => __('Caption'), 622 609 'value' => $edit_post->post_excerpt, 623 610 ), … … 1022 1009 if ( f.alt.value ) { 1023 1010 alt = f.alt.value.replace(/['"<>]+/g, ''); 1024 <?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it.?>1011 <?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?> 1025 1012 caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 1026 1013 <?php } ?> … … 1279 1266 1280 1267 function type_form_image() { 1281 $form = ' 1268 1269 if ( apply_filters( 'disable_captions', '' ) ) { 1270 $alt = __('Alternate Text'); 1271 $alt_help = __('Alt text for the image, e.g. "The Mona Lisa"'); 1272 } else { 1273 $alt = __('Image Caption'); 1274 $alt_help = __('Also used as alternate text for the image'); 1275 } 1276 1277 return ' 1282 1278 <table class="describe"><tbody> 1283 1279 <tr> … … 1296 1292 <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 1297 1293 </tr> 1298 '; 1299 // CAPTIONS_OFF is temporary. Do not use it. 1300 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 1301 $form .= ' 1294 1302 1295 <tr> 1303 1296 <th valign="top" scope="row" class="label"> 1304 <span class="alignleft"><label for="alt">' . __('Alternate Text'). '</label></span>1297 <span class="alignleft"><label for="alt">' . $alt . '</label></span> 1305 1298 </th> 1306 1299 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 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 .= ' 1300 <p class="help">' . $alt_help . '</p></td> 1301 </tr> 1302 1323 1303 <tr class="align"> 1324 1304 <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> … … 1355 1335 '; 1356 1336 1357 return $form;1358 1337 } 1359 1338
Note: See TracChangeset
for help on using the changeset viewer.