mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-30 23:30:05 +00:00
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:
@@ -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 ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user