seiya-n1987 of WordPress
9/8/2017 - 12:57 AM

Adjustment of custom logo (temporary)

Function for rewriting size of custom logo

<?php
/***********************************************
 *カスタムロゴ調整
 ***********************************************/
function site_custom_logo($size=null){
	if( has_custom_logo() ) {
		$logo = get_custom_logo();
		
		if( isset($size) ){
			$logo = preg_replace( '/width="\d+"/i', '/width="'.$size.'"/', $logo);
			$logo = preg_replace( '/height="\d+"/i', '/height="'.$size.'"/', $logo);
		}
		
		return htmlspecialchars_decode( esc_html( $logo ) );
		
	} else {
		return false;
	}
	

}