File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -125,16 +125,21 @@ public function get_preferred_username() {
125125 * @return array|null The User-Icon.
126126 */
127127 public function get_icon () {
128- $ image = wp_get_attachment_image_src ( get_theme_mod ( 'custom_logo ' ) );
129-
130- if ( $ image ) {
131- return array (
132- 'type ' => 'Image ' ,
133- 'url ' => esc_url ( $ image [0 ] ),
134- );
128+ // try site icon first
129+ $ icon_id = get_option ( 'site_icon ' );
130+ // try custom logo second
131+ if ( ! $ icon_id ) {
132+ $ icon_id = get_theme_mod ( 'custom_logo ' );
133+ }
134+ if ( ! $ icon_id ) {
135+ return null ;
135136 }
136137
137- return null ;
138+ $ image = wp_get_attachment_image_src ( $ icon_id , 'full ' );
139+ return array (
140+ 'type ' => 'Image ' ,
141+ 'url ' => esc_url ( $ image [0 ] ),
142+ );
138143 }
139144
140145 /**
You can’t perform that action at this time.
0 commit comments