Make the gallery shortcode float the right way for RTL languages. Fixes #7134 props ikonst.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eae8a055c6
commit
2bfe9c548b
|
@ -648,7 +648,7 @@ add_shortcode('gallery', 'gallery_shortcode');
|
|||
* @return string HTML content to display gallery.
|
||||
*/
|
||||
function gallery_shortcode($attr) {
|
||||
global $post;
|
||||
global $post, $wp_locale;
|
||||
|
||||
static $instance = 0;
|
||||
$instance++;
|
||||
|
@ -711,6 +711,7 @@ function gallery_shortcode($attr) {
|
|||
$captiontag = tag_escape($captiontag);
|
||||
$columns = intval($columns);
|
||||
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
|
||||
$float = $wp_locale->text_direction == 'rtl' ? 'right' : 'left';
|
||||
|
||||
$selector = "gallery-{$instance}";
|
||||
|
||||
|
@ -720,7 +721,7 @@ function gallery_shortcode($attr) {
|
|||
margin: auto;
|
||||
}
|
||||
#{$selector} .gallery-item {
|
||||
float: left;
|
||||
float: {$float};
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
width: {$itemwidth}%; }
|
||||
|
|
Loading…
Reference in New Issue