Ticket #7134: wordpress-gallery-rtl.patch
File wordpress-gallery-rtl.patch, 901 bytes (added by , 16 years ago) |
---|
-
wp-includes/media.php
old new 335 335 add_shortcode('gallery', 'gallery_shortcode'); 336 336 337 337 function gallery_shortcode($attr) { 338 global $post ;338 global $post, $wp_locale; 339 339 340 340 // Allow plugins/themes to override the default gallery template. 341 341 $output = apply_filters('post_gallery', '', $attr); … … 377 377 $captiontag = tag_escape($captiontag); 378 378 $columns = intval($columns); 379 379 $itemwidth = $columns > 0 ? floor(100/$columns) : 100; 380 $float = $wp_locale->text_direction == 'rtl' ? 'right' : 'left'; 380 381 381 382 $output = apply_filters('gallery_style', " 382 383 <style type='text/css'> … … 384 385 margin: auto; 385 386 } 386 387 .gallery-item { 387 float: left;388 float: {$float}; 388 389 margin-top: 10px; 389 390 text-align: center; 390 391 width: {$itemwidth}%; }