WordPress.org

Make WordPress Core

Ticket #12186: background-repeat-options.diff

File background-repeat-options.diff, 1.8 KB (added by jshreve, 4 years ago)

adds 'Horizontally' and 'Vertically' as repeat options

  • wp-admin/custom-background.php

     
    9898                } 
    9999 
    100100                if ( isset($_POST['background-repeat']) ) { 
    101                         if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat')) ) 
     101                        if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y')) ) 
    102102                                $repeat = $_POST['background-repeat']; 
    103103                        else 
    104104                                $repeat = 'repeat'; 
     
    199199<input name="background-repeat" type="radio" value="repeat" <?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> 
    200200<?php _e('Tile') ?> 
    201201</label> 
     202<label> 
     203<input name="background-repeat" type="radio" value="repeat-x" <?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?> /> 
     204<?php _e('Horizontally') ?> 
     205</label> 
     206<label> 
     207<input name="background-repeat" type="radio" value="repeat-y" <?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?> /> 
     208<?php _e('Vertically') ?> 
     209</label> 
    202210</fieldset></td> 
    203211 
    204212<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Attachment' ); ?></span></legend> 
  • wp-includes/theme.php

     
    14431443        $repeat = get_theme_mod('background_repeat', 'repeat'); 
    14441444        if ( 'no-repeat' == $repeat ) 
    14451445                $repeat = 'background-repeat: no-repeat;'; 
     1446        elseif( 'repeat-x' == $repeat ) 
     1447                $repeat = 'background-repeat: repeat-x;'; 
     1448        elseif( 'repeat-y' == $repeat ) 
     1449                $repeat = 'background-repeat: repeat-y;'; 
    14461450        else 
    14471451                $repeat = 'background-repeat: repeat;'; 
    14481452        $position = get_theme_mod('background_position', 'left');