Make WordPress Core

Changeset 26594


Ignore:
Timestamp:
12/03/2013 09:35:26 PM (12 years ago)
Author:
nacin
Message:

Rename the new custom-background arguments passed to add_theme_support().

  • background-position becomes default-position-x
  • background-attachment becomes default-attachment
  • background-repeat becomes default-repeat

These are in line with existing default-image and default-color arguments, and also makes the position argument unambiguous and forwards compatible.

fixes #20816.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-background.php

    r26518 r26594  
    206206    // background-image URL must be single quote, see below
    207207    $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');'
    208         . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'background-repeat' ) ) . ';'
    209         . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'background-position' ) );
     208        . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';'
     209        . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
    210210}
    211211?>
     
    277277<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend>
    278278<label>
    279 <input name="background-position-x" type="radio" value="left"<?php checked( 'left', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'background-position' ) ) ); ?> />
     279<input name="background-position-x" type="radio" value="left"<?php checked( 'left', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ) ); ?> />
    280280<?php _e('Left') ?>
    281281</label>
    282282<label>
    283 <input name="background-position-x" type="radio" value="center"<?php checked( 'center', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'background-position' ) ) ); ?> />
     283<input name="background-position-x" type="radio" value="center"<?php checked( 'center', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ) ); ?> />
    284284<?php _e('Center') ?>
    285285</label>
    286286<label>
    287 <input name="background-position-x" type="radio" value="right"<?php checked( 'right', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'background-position' ) ) ); ?> />
     287<input name="background-position-x" type="radio" value="right"<?php checked( 'right', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ) ); ?> />
    288288<?php _e('Right') ?>
    289289</label>
     
    294294<th scope="row"><?php _e( 'Repeat' ); ?></th>
    295295<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend>
    296 <label><input type="radio" name="background-repeat" value="no-repeat"<?php checked( 'no-repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'background-repeat' ) ) ); ?> /> <?php _e('No Repeat'); ?></label>
    297     <label><input type="radio" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'background-repeat' ) ) ); ?> /> <?php _e('Tile'); ?></label>
    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', 'background-repeat' ) ) ); ?> /> <?php _e('Tile Horizontally'); ?></label>
    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', 'background-repeat' ) ) ); ?> /> <?php _e('Tile Vertically'); ?></label>
     296<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked( 'no-repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?> /> <?php _e('No Repeat'); ?></label>
     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    <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    <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>
    300300</fieldset></td>
    301301</tr>
     
    305305<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend>
    306306<label>
    307 <input name="background-attachment" type="radio" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'background-attachment' ) ) ); ?> />
     307<input name="background-attachment" type="radio" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?> />
    308308<?php _e( 'Scroll' ); ?>
    309309</label>
    310310<label>
    311 <input name="background-attachment" type="radio" value="fixed" <?php checked( 'fixed', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'background-attachment' ) ) ); ?> />
     311<input name="background-attachment" type="radio" value="fixed" <?php checked( 'fixed', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?> />
    312312<?php _e( 'Fixed' ); ?>
    313313</label>
  • trunk/src/wp-includes/theme.php

    r26501 r26594  
    12811281        $image = " background-image: url('$background');";
    12821282
    1283         $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'background-repeat' ) );
     1283        $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
    12841284        if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) )
    12851285            $repeat = 'repeat';
    12861286        $repeat = " background-repeat: $repeat;";
    12871287
    1288         $position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'background-position' ) );
     1288        $position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
    12891289        if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )
    12901290            $position = 'left';
    12911291        $position = " background-position: top $position;";
    12921292
    1293         $attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'background-attachment' ) );
     1293        $attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
    12941294        if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )
    12951295            $attachment = 'scroll';
     
    14841484            $defaults = array(
    14851485                'default-image'          => '',
    1486                 'background-repeat'      => 'repeat',
    1487                 'background-position'    => 'left',
    1488                 'background-attachment'  => 'scroll',
     1486                'default-repeat'         => 'repeat',
     1487                'default-position-x'     => 'left',
     1488                'default-attachment'     => 'scroll',
    14891489                'default-color'          => '',
    14901490                'wp-head-callback'       => '_custom_background_cb',
Note: See TracChangeset for help on using the changeset viewer.