#27850 closed defect (bug) (fixed)
WP 3.9 - PHP Warnings in Customizer if Theme has set a default image for Custom Header
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9.1 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
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
@
9 years ago
- Version changed from 3.9 to 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.
9 years ago
#6
@
9 years ago
- Version changed from 3.4 to 3.9
This appears to be a regression introduced in [27849]. Restoring the correct version number.
Introduced in r27849.
Themes can specify a default image without registering it as a default header.
In that scenario
$this->default_headers
would be null.