Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#20816 closed enhancement (fixed)

custom-background $args enhancement

Reported by: frumph's profile frumph Owned by: duck_'s profile duck_
Milestone: 3.8 Priority: high
Severity: normal Version: 3.4
Component: Customize Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Looking to have added the rest of the arguments to pass through the $args to include the rest of the appearance -> background parameters including but not limited to position(x/y), repeat and attachment.

add_theme_support('custom-background', $args);


	'default-color' => '000000', 
	'default-image' => get_stylesheet_directory_uri() . '/images/background-wolfbw.jpg',
	'repeat' => 'no-repeat',
	'position-x' => 'center',
	'attachment' => 'fixed'

ie. the repeat position(x/y) and attachment parameters

Main themes even child themes have looks which sometimes need to incorporate fixed or positioning that cannot be set with the current $arguments and it would benefit theme designers to allow those arguments to be passed

Attachments (2)

20816.diff (7.0 KB) - added by obenland 12 years ago.
20816.1.diff (7.1 KB) - added by obenland 11 years ago.

Download all attachments as: .zip

Change History (25)

#1 @SergeyBiryukov
12 years ago

  • Description modified (diff)

#2 @iandstewart
12 years ago

  • Cc ian@… added

#3 @ethitter
12 years ago

  • Cc erick@… added

#4 @lancewillett
12 years ago

  • Cc lancewillett added

#5 @iamtakashi
12 years ago

  • Cc takashi@… added

#6 follow-up: @bradthomas127
12 years ago

  • Cc bradthomas127@… added

12 years ago

#7 in reply to: ↑ 6 @obenland
12 years ago

  • Keywords has-patch added

20816.diff​ lets themes define background position, repeat, and attachment for their default image in add_theme_support()

#8 @obenland
11 years ago

  • Keywords 3.7-early added

#9 @sixhours
11 years ago

  • Cc caroline@… added

#10 @wonderboymusic
11 years ago

  • Milestone changed from Awaiting Review to 3.7

these are all marked 3.7-early

11 years ago

#11 @obenland
11 years ago

  • Keywords 3.7-early removed

Refreshed patch, tested against latest trunk.

#12 @nacin
11 years ago

  • Milestone changed from 3.7 to Future Release

I like this but let's wait for 3.8 on this.

#13 @greenshady
11 years ago

  • Cc justin@… added

#14 @lancewillett
11 years ago

  • Milestone changed from Future Release to 3.8

Can we get this into 3.8 please?

#15 @duck_
11 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In 26352:

Allow customisation of theme mod defaults via custom-background theme support.

Give the power to theme authors to select defaults when registering
custom-background support.

Props obenland. Fixes #20816.

#16 @greenshady
11 years ago

Do you think we can change the background-position argument to background-position-x? This to just make sure we're consistent with naming and in case we ever add a background-position-y argument.

#17 @SergeyBiryukov
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#18 @nacin
11 years ago

Reviewing this a bit more, I agree with adding -x to position. However, I am not sure these should be background-position, background-attachment, etc. We already have default-color and default-image. These too are defaults. So I am thinking default-position-x, default-attachment, etc. Alternatively, drop the prefix all together.

#19 @nacin
11 years ago

  • Priority changed from normal to high

#20 @greenshady
11 years ago

I prefer the approach of using default- over background-. I don't see anything wrong with dropping it altogether either except that it wouldn't be consistent with default-image and default-color.

#21 @dreamwhisper
11 years ago

  • Cc dreamwhisper added

#22 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 26594:

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.

#23 @lancewillett
11 years ago

  • Component changed from Themes to Appearance
Note: See TracTickets for help on using tickets.