Skip to content

Commit c0d2873

Browse files
authored
Fix custom website icon should not be overwritten (#598)
1 parent e49e8a3 commit c0d2873

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

functions/theme.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ function sunflower_theme_class() {
1818
}
1919

2020
/**
21-
* Change path to favicon.ico to sunflower.
21+
* Change URL to site icon to sunflower as default.
22+
*
23+
* @param string $url Site icon URL.
2224
*/
23-
function sunflower_get_site_icon_url_defaults() {
25+
function sunflower_get_site_icon_url_defaults( $url ) {
26+
// A custom site icon seems to be set. Keep it untouched.
27+
if ( filter_var( $url, FILTER_VALIDATE_URL ) ) {
28+
return $url;
29+
}
30+
// Set default site icon to sunflower.
2431
return sunflower_parent_or_child( 'assets/img/favicon.ico' );
2532
}
2633

inc/customizer.php

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function sunflower_customize_register( $wp_customize ) {
3131
)
3232
);
3333

34-
$wp_customize->remove_control( 'site_icon' );
3534
}
3635
}
3736

0 commit comments

Comments
 (0)