#27850 closed defect (bug) (fixed)
WP 3.9 - PHP Warnings in Customizer if Theme has set a default image for Custom Header
| Reported by: | MH Themes | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9.1 |
| Component: | Customize | Version: | 3.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
I just noticed a bug which did not appear in WP 3.8.3. When a theme has defined a default image for custom header support like:
$header = array(
'default-image' => get_template_directory_uri() . '/images/logo.png',
'default-text-color' => '000',
'width' => 300,
'height' => 100,
'flex-width' => true,
'flex-height' => true
);
add_theme_support('custom-header', $header);
The customizer outputs PHP warnings when loading:
Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/wordpress/wp-admin/custom-header.php on line 1248
Warning: array_merge(): Argument #2 is not an array in /Applications/MAMP/htdocs/wordpress/wp-admin/custom-header.php on line 1268
Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/wordpress/wp-admin/custom-header.php on line 1248
Warning: array_merge(): Argument #2 is not an array in /Applications/MAMP/htdocs/wordpress/wp-admin/custom-header.php on line 1268
If I comment out:
'default-image' => get_template_directory_uri() . '/images/logo.png'
Then everything works fine. Except that there is no default image defined anymore. ;-)
Attachments (1)
Change History (13)
#3
@
13 years ago
- Version 3.9 → 3.4
There's also the same warning in reset_header_image(), fixed by the same patch.
This ticket was mentioned in IRC in #wordpress-dev by SergeyBiryukov. View the logs.
12 years ago
#6
@
12 years ago
- Version 3.4 → 3.9
This appears to be a regression introduced in [27849]. Restoring the correct version number.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Introduced in r27849.
Themes can specify a default image without registering it as a default header.
In that scenario
$this->default_headerswould be null.