Opened 8 years ago
Closed 8 years ago
#36332 closed defect (bug) (fixed)
Custom Logo: PHP warnings in add_theme_support
Reported by: | obenland | Owned by: | obenland |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Themes | Keywords: | commit has-patch |
Focuses: | Cc: |
Description
From the support forums: https://wordpress.org/support/topic/custom-logo-with-no-args-causing-php-warnings
Hi,
I'm testing the new WP4.5 development releases. Since current 4.5-RC1-37079 update I get these PHP warnings:
Warning: array_intersect_key(): Argument #1 is not an array in /srv/www/wordpress-default/wp-includes/theme.php on line 1570`
Warning: Cannot use a scalar value as an array in /srv/www/wordpress-default/wp-includes/theme.php on line 1570
Warning: Cannot use a scalar value as an array in /srv/www/wordpress-default/wp-includes/theme.php on line 1574
Warning: Cannot use a scalar value as an array in /srv/www/wordpress-default/wp-includes/theme.php on line 1575
I was able to trace these down to add_theme_support( 'custom-logo' );
. When I use it in plain with no additional args, the PHP warnings above are thrown.
If I set custom logo with args, it works fine:
add_theme_support( 'custom-logo', array(
'height' => 160,
'width' => 160,
'flex-height' => true,
'flex-width' => true,
) );
Is it required to set the args? Shouldn't it work without the args? What happens if no args are passed, will it take the full size of the uploaded image?
Thanks for addressing this issue!
Attachments (1)
Change History (6)
#3
@
8 years ago
36332.diff makes sense.
36332.diff solves this problem like
custom-header
andcustom-background
do a few lines below.