'custom-logo', 'itemprop' => 'logo', ]; /** * If the logo alt attribute is empty, get the site title and explicitly * pass it to the attributes used by wp_get_attachment_image(). */ $image_alt = get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true ); if ( empty( $image_alt ) ) { $custom_logo_attr['alt'] = get_bloginfo( 'name', 'display' ); } $image_output = ''; add_filter( 'wp_get_attachment_image_attributes', 'blocksy_handle_retina_logo_mobile_menu', 10, 3 ); $image_output .= wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ); remove_filter( 'wp_get_attachment_image_attributes', 'blocksy_handle_retina_logo_mobile_menu', 10, 3 ); /** * If the alt attribute is not empty, there's no need to explicitly pass * it because wp_get_attachment_image() already adds the alt attribute. */ $html = sprintf( '%2$s', esc_url( home_url( '/' ) ), $image_output ); return $html; } function blocksy_output_mobile_menu_site_branding($is_mobile = false) { if (get_theme_mod('has_mobile_menu_logo', 'no') === 'no') { return; } ?>