Changeset 58213
- Timestamp:
- 05/27/2024 04:39:13 PM (7 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r57789 r58213 1025 1025 1026 1026 $custom_logo_id = get_theme_mod( 'custom_logo' ); 1027 $is_image = wp_attachment_is_image( $custom_logo_id ); 1027 1028 1028 1029 if ( $switched_blog ) { … … 1030 1031 } 1031 1032 1032 return (bool) $custom_logo_id;1033 return $is_image; 1033 1034 } 1034 1035 … … 1053 1054 } 1054 1055 1055 $custom_logo_id = get_theme_mod( 'custom_logo' );1056 1057 1056 // We have a logo. Logo is go. 1058 if ( $custom_logo_id ) { 1057 if ( has_custom_logo() ) { 1058 $custom_logo_id = get_theme_mod( 'custom_logo' ); 1059 1059 $custom_logo_attr = array( 1060 1060 'class' => 'custom-logo', … … 1098 1098 $image = wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ); 1099 1099 1100 if ( $unlink_homepage_logo && is_front_page() && ! is_paged() ) { 1101 // If on the home page, don't link the logo to home. 1102 $html = sprintf( 1103 '<span class="custom-logo-link">%1$s</span>', 1104 $image 1105 ); 1106 } else { 1107 $aria_current = is_front_page() && ! is_paged() ? ' aria-current="page"' : ''; 1108 1109 $html = sprintf( 1110 '<a href="%1$s" class="custom-logo-link" rel="home"%2$s>%3$s</a>', 1111 esc_url( home_url( '/' ) ), 1112 $aria_current, 1113 $image 1114 ); 1100 // Check that we have a proper HTML img element. 1101 if ( $image ) { 1102 1103 if ( $unlink_homepage_logo && is_front_page() && ! is_paged() ) { 1104 // If on the home page, don't link the logo to home. 1105 $html = sprintf( 1106 '<span class="custom-logo-link">%1$s</span>', 1107 $image 1108 ); 1109 } else { 1110 $aria_current = is_front_page() && ! is_paged() ? ' aria-current="page"' : ''; 1111 1112 $html = sprintf( 1113 '<a href="%1$s" class="custom-logo-link" rel="home"%2$s>%3$s</a>', 1114 esc_url( home_url( '/' ) ), 1115 $aria_current, 1116 $image 1117 ); 1118 } 1115 1119 } 1116 1120 } elseif ( is_customize_preview() ) { -
trunk/src/wp-includes/theme.php
r57987 r58213 3435 3435 * @since 4.3.0 Also removes `header_image_data`. 3436 3436 * @since 4.5.0 Also removes custom logo theme mods. 3437 * @since 6.6.0 Also removes `site_logo` option set by the site logo block. 3437 3438 * 3438 3439 * @param int $id The attachment ID. … … 3443 3444 $background_image = get_background_image(); 3444 3445 $custom_logo_id = get_theme_mod( 'custom_logo' ); 3446 $site_logo_id = get_option( 'site_logo' ); 3445 3447 3446 3448 if ( $custom_logo_id && $custom_logo_id == $id ) { 3447 3449 remove_theme_mod( 'custom_logo' ); 3448 3450 remove_theme_mod( 'header_text' ); 3451 } 3452 3453 if ( $site_logo_id && $site_logo_id == $id ) { 3454 delete_option( 'site_logo' ); 3449 3455 } 3450 3456
Note: See TracChangeset
for help on using the changeset viewer.