Make WordPress Core


Ignore:
Timestamp:
12/03/2013 09:35:26 PM (11 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.