Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#20734 closed defect (bug) (fixed)

Registered Background image does not display in preview.

Reported by: mfields's profile mfields Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords: has-patch commit
Focuses: Cc:

Description

I'm using code similar to the following to register custom background support on the latest version of trunk with a clean database:

function mytheme_register_custom_background_support() {
	add_theme_support( 'custom-background', array(
		'default-color' => 'f6f4f2',
		'default-image' => get_template_directory_uri() . '/images/background.png',
	) );
}
add_action( 'after_setup_theme', 'mytheme_register_custom_background_support' );

When I navigate to Appearance -> Background, I only see the background color in the "Preview" box. I would assume that the image should be shown here as well if a url is supplied as default-image in the add_theme_support() call.

I'll uploaded a patch which works for me, but may not be the best solution.

Attachments (1)

20734.diff (1.6 KB) - added by mfields 12 years ago.

Download all attachments as: .zip

Change History (7)

@mfields
12 years ago

#1 @nacin
12 years ago

  • Keywords commit added; dev-feedback removed
  • Milestone changed from Awaiting Review to 3.4

Does color work?

#2 @mfields
12 years ago

Color appears to work fine upon theme activation - displaying the default-color automatically. However, after a custom color was selected and then the clear button is pressed, the preview shows a white background. I think that it might be best to revert to the value of default-color is specified. What do you think?

Version 0, edited 12 years ago by mfields (next)

#3 @ryan
12 years ago

Related: #18041

#4 @nacin
12 years ago

I think that it might be best to revert to the value of default-color is specified. What do you think?

That would certainly make sense, yes. I recalled running into that, which is why I asked.

#5 @nacin
12 years ago

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

In [20901]:

Preview by default the registered default image for custom backgrounds. props mfields, billerickson.

If there is a default color registered, show a 'Default' action rather than a 'Clear' action, as clearing the value would simply return to the default.

Make current_theme_supports() accept a second argument for 'custom-background' requests, the same as get_theme_support(). Missed in earlier changes, see #20249.

fixes #20734, fixes #18041.

#36 @nacin
12 years ago

In [21004]:

Custom background color: Show the 'Default' link when the input is empty and there is a default color registered. fixes #20448. see #20734.

Note: See TracTickets for help on using tickets.