Ticket #6368: gallery-improvements-r7493-2.patch
| File gallery-improvements-r7493-2.patch, 4.5 kB (added by tellyworth, 7 months ago) |
|---|
-
wp-includes/shortcodes.php
old new 118 118 } 119 119 120 120 function shortcode_atts($pairs, $atts) { 121 $atts = (array)$atts; 121 122 $out = array(); 122 123 foreach($pairs as $name => $default) { 123 124 if ( array_key_exists($name, $atts) ) -
wp-includes/media.php
old new 339 339 $output = apply_filters('post_gallery', '', $attr); 340 340 if ( $output != '' ) 341 341 return $output; 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)); 342 352 343 $attachments = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&orderby=\"menu_order ASC, ID ASC\""); 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) ) 346 358 return ''; … … 348 360 if ( is_feed() ) { 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'> 357 374 .gallery { 358 375 margin: auto; 359 376 } 360 .gallery div{377 .gallery-item { 361 378 float: left; 362 379 margin-top: 10px; 363 380 text-align: center; … … 365 382 .gallery img { 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 --> 370 390 <div class='gallery'>"); 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 } 381 409 -
wp-admin/includes/media.php
old new 460 460 function image_attachment_fields_to_edit($form_fields, $post) { 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); 469 469 … … 554 554 'value' => $edit_post->post_title, 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', 564 564 ), -
wp-includes/formatting.php
old new 1182 1182 $safe_text = wp_specialchars($text, true); 1183 1183 return apply_filters('attribute_escape', $safe_text, $text); 1184 1184 } 1185 1186 // Escape a HTML tag name 1187 function tag_escape($tag_name) { 1188 $safe_tag = strtolower( preg_replace('[^a-zA-Z_:]', '', $tag_name) ); 1189 return apply_filters('tag_escape', $safe_tag, $tag_name); 1190 } 1191 1185 1192 /** 1186 1193 * Escapes text for SQL LIKE special characters % and _ 1187 1194 *
