|
@@ -36,6 +36,8 @@ add_action( 'customize_register', 'photos_logo_resizer_customize_register' );
|
|
|
* Add support for logo resizing by filtering `get_custom_logo`.
|
|
|
*/
|
|
|
function photos_customize_logo_resize( $html ) {
|
|
|
+ $max = [];
|
|
|
+ $img = [];
|
|
|
$size = get_theme_mod( 'logo_size' );
|
|
|
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
|
|
// set the short side minimum
|
|
@@ -91,6 +93,8 @@ add_filter( 'get_custom_logo', 'photos_customize_logo_resize' );
|
|
|
|
|
|
/* Helper function to determine the max size of the logo */
|
|
|
function photos_logo_resize_min_max( $short, $long, $short_max, $long_max, $percent, $min ){
|
|
|
+ $max = [];
|
|
|
+ $size = [];
|
|
|
$ratio = ( $long / $short );
|
|
|
$max['long'] = ( $long_max >= $long ) ? $long : $long_max;
|
|
|
$max['short'] = ( $short_max >= ( $max['long'] / $ratio ) ) ? floor( $max['long'] / $ratio ) : $short_max;
|