[wp-trac] [WordPress Trac] #27850: WP 3.9 - PHP Warnings in Customizer if Theme has set a default image for Custom Header

WordPress Trac noreply at wordpress.org
Thu Apr 17 05:50:37 UTC 2014


#27850: WP 3.9 - PHP Warnings in Customizer if Theme has set a default image for
Custom Header
--------------------------+-----------------------------
 Reporter:  MH Themes     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  3.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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. ;-)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27850>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list