Customize: Bring custom-logo args closer to custom-header.

Allows themes to specify the desired width and height of logos, and whether
that is flexible or not. Has the benefit of not having to generate a logo-sized
file for every image uploaded.

Props westonruter, celloexpressions.
Fixes #36255.



git-svn-id: https://develop.svn.wordpress.org/trunk@37077 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland
2016-03-24 02:01:50 +00:00
parent e6b5f3316f
commit c35484581d
3 changed files with 31 additions and 7 deletions

View File

@@ -1559,6 +1559,23 @@ function add_theme_support( $feature ) {
$args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] );
break;
case 'custom-logo':
$defaults = array(
'width' => null,
'height' => null,
'flex-width' => false,
'flex-height' => false,
'header-text' => '',
);
$args[0] = wp_parse_args( array_intersect_key( $args[0], $defaults ), $defaults );
// Allow full flexibility if no size is specified.
if ( is_null( $args[0]['width'] ) && is_null( $args[0]['height'] ) ) {
$args[0]['flex-width'] = true;
$args[0]['flex-height'] = true;
}
break;
case 'custom-header-uploads' :
return add_theme_support( 'custom-header', array( 'uploads' => true ) );