Changeset 7496
- Timestamp:
- 03/24/2008 02:57:19 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r7491 r7496 461 461 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 462 462 $form_fields['post_title']['required'] = true; 463 $form_fields['post_excerpt']['label'] = __(' Description');463 $form_fields['post_excerpt']['label'] = __('Caption'); 464 464 $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"'); 465 465 466 $form_fields['post_content']['label'] = __(' LongDescription');466 $form_fields['post_content']['label'] = __('Description'); 467 467 468 468 $thumb = wp_get_attachment_thumb_url($post->ID); … … 555 555 ), 556 556 'post_excerpt' => array( 557 'label' => __(' Description'),557 'label' => __('Caption'), 558 558 'value' => $edit_post->post_excerpt, 559 559 ), 560 560 'post_content' => array( 561 'label' => __(' Long description'),561 'label' => __('Description'), 562 562 'value' => $edit_post->post_content, 563 563 'input' => 'textarea', -
trunk/wp-includes/media.php
r7478 r7496 340 340 if ( $output != '' ) 341 341 return $output; 342 343 $attachments = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&orderby=\"menu_order ASC, ID ASC\""); 342 343 extract(shortcode_atts(array( 344 'orderby' => 'menu_order ASC, ID ASC', 345 'id' => $post->ID, 346 'itemtag' => 'dl', 347 'icontag' => 'dt', 348 'captiontag' => 'dd', 349 'columns' => 3, 350 'size' => 'thumbnail', 351 ), $attr)); 352 353 $id = intval($id); 354 $orderby = addslashes($orderby); 355 $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby=\"{$orderby}\""); 344 356 345 357 if ( empty($attachments) ) … … 349 361 $output = "\n"; 350 362 foreach ( $attachments as $id => $attachment ) 351 $output .= wp_get_attachment_link($id, 'thumbnail', true) . "\n";363 $output .= wp_get_attachment_link($id, $size, true) . "\n"; 352 364 return $output; 353 365 } 354 366 367 $listtag = tag_escape($listtag); 368 $itemtag = tag_escape($itemtag); 369 $captiontag = tag_escape($captiontag); 370 $columns = intval($columns); 371 355 372 $output = apply_filters('gallery_style', " 356 373 <style type='text/css'> … … 358 375 margin: auto; 359 376 } 360 .gallery div{377 .gallery-item { 361 378 float: left; 362 379 margin-top: 10px; … … 366 383 border: 2px solid #cfcfcf; 367 384 } 385 .gallery-caption { 386 margin-left: 0; 387 } 368 388 </style> 369 389 <!-- see gallery_shortcode() in wp-includes/media.php --> … … 371 391 372 392 foreach ( $attachments as $id => $attachment ) { 373 $link = wp_get_attachment_link($id, 'thumbnail', true); 393 $link = wp_get_attachment_link($id, $size, true); 394 $output .= "<{$itemtag} class='gallery-item'>"; 374 395 $output .= " 375 < div>396 <{$icontag} class='gallery-icon'> 376 397 $link 377 </div>"; 378 if ( ++$i % 3 == 0 ) 398 </{$icontag}>"; 399 if ( $captiontag && trim($attachment->post_excerpt) ) { 400 $output .= " 401 <{$captiontag} class='gallery-caption'> 402 {$attachment->post_excerpt} 403 </{$captiontag}>"; 404 } 405 $output .= "</{$itemtag}>"; 406 if ( $columns > 0 && ++$i % $columns == 0 ) 379 407 $output .= '<br style="clear: both" />'; 380 408 } -
trunk/wp-includes/shortcodes.php
r7172 r7496 119 119 120 120 function shortcode_atts($pairs, $atts) { 121 $atts = (array)$atts; 121 122 $out = array(); 122 123 foreach($pairs as $name => $default) {
Note: See TracChangeset
for help on using the changeset viewer.