Opened 12 years ago
Closed 12 years ago
#28586 closed defect (bug) (fixed)
Customiser fails to honour theme support defaults for background images
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.0 | Priority: | normal |
| Severity: | normal | Version: | 3.9.1 |
| Component: | Customize | Keywords: | has-patch commit |
| Focuses: | administration | Cc: |
Description
When using add_theme_support() to set defaults for the background image, an unexpected consequence of using the customiser is that those defaults are ignored.
For example, consider the following code, used in functions.php;
add_theme_support( 'custom-background', array( 'default-image' => get_stylesheet_directory_uri() . '/bg.png', 'default-repeat' => 'repeat-x', 'default-position-x' => 'center', 'default-attachment' => 'scroll', ) );
As would be expected, the customiser honours the "default-image" setting but the repeat, position-x and attachment settings are all ignored. Instead, the customiser chooses "repeat", "left" and "fixed" respectively.
This means that the first Save in the customiser will overwrite the theme's default settings, changing the look and feel of the site despite the user not having changed any settings.
Attachments (2)
Change History (8)
#2
@
12 years ago
- Keywords needs-refresh added; has-patch removed
- Milestone changed from Awaiting Review to 4.0
Couple of things:
global $_wp_theme_features;should be droppeddefault-attachmentdefaults toscrollin the$_wp_theme_features, but the default in Customizer wasfixed. I suspect it's fine to change it toscroll, but wanted to flag just in case.
Note: See
TracTickets for help on using
tickets.
Proposed fix