diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php
index e5666e7..d079670 100644
a
|
b
|
class Custom_Background { |
134 | 134 | |
135 | 135 | if ( isset($_POST['background-repeat']) ) { |
136 | 136 | check_admin_referer('custom-background'); |
137 | | if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y')) ) |
| 137 | if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y', 'full-screen')) ) |
138 | 138 | $repeat = $_POST['background-repeat']; |
139 | 139 | else |
140 | 140 | $repeat = 'repeat'; |
… |
… |
if ( get_background_image() ) { |
205 | 205 | $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); |
206 | 206 | // background-image URL must be single quote, see below |
207 | 207 | $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' |
208 | | . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';' |
| 208 | . _custom_background_repeat() . ';' |
209 | 209 | . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); |
210 | 210 | } |
211 | 211 | ?> |
… |
… |
if ( get_background_image() ) { |
297 | 297 | <label><input type="radio" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?> /> <?php _e('Tile'); ?></label> |
298 | 298 | <label><input type="radio" name="background-repeat" value="repeat-x"<?php checked( 'repeat-x', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?> /> <?php _e('Tile Horizontally'); ?></label> |
299 | 299 | <label><input type="radio" name="background-repeat" value="repeat-y"<?php checked( 'repeat-y', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?> /> <?php _e('Tile Vertically'); ?></label> |
| 300 | <label><input type="radio" name="background-repeat" value="full-screen"<?php checked( 'full-screen', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?> /> <?php _e('Full Screen'); ?></label> |
300 | 301 | </fieldset></td> |
301 | 302 | </tr> |
302 | 303 | |
diff --git a/wp-includes/theme.php b/wp-includes/theme.php
index e109125..b75086e 100644
a
|
b
|
function background_color() { |
1263 | 1263 | * |
1264 | 1264 | * @since 3.0.0 |
1265 | 1265 | * @access protected |
| 1266 | * @uses _custom_background_repeat |
1266 | 1267 | */ |
1267 | 1268 | function _custom_background_cb() { |
1268 | 1269 | // $background is the saved custom image, or the default image. |
… |
… |
function _custom_background_cb() { |
1280 | 1281 | if ( $background ) { |
1281 | 1282 | $image = " background-image: url('$background');"; |
1282 | 1283 | |
1283 | | $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ); |
1284 | | if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) |
1285 | | $repeat = 'repeat'; |
1286 | | $repeat = " background-repeat: $repeat;"; |
| 1284 | $repeat = _custom_background_repeat(); |
1287 | 1285 | |
1288 | 1286 | $position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); |
1289 | 1287 | if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) |
… |
… |
function wp_customize_support_script() { |
1891 | 1889 | }()); |
1892 | 1890 | </script> |
1893 | 1891 | <?php |
| 1892 | } |
| 1893 | |
| 1894 | /** |
| 1895 | * Outputs CSS for Custom Background Repeat |
| 1896 | * |
| 1897 | * @since 3.8.0 |
| 1898 | */ |
| 1899 | |
| 1900 | function _custom_background_repeat() { |
| 1901 | $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ); |
| 1902 | if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat', 'full-screen' ) ) ) |
| 1903 | $repeat = 'repeat'; |
| 1904 | if ( $repeat === 'full-screen' ) { |
| 1905 | $cb_repeat = "background-repeat: no-repeat; -webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;background-attachment:fixed;background-position:center;"; |
| 1906 | } |
| 1907 | else { |
| 1908 | $cb_repeat = " background-repeat: $repeat;"; |
| 1909 | } |
| 1910 | return $cb_repeat; |
1894 | 1911 | } |
| 1912 | No newline at end of file |