add site logo support to blog user (#400)
This commit is contained in:
parent
9e73081668
commit
d38bf60d11
1 changed files with 13 additions and 8 deletions
|
@ -125,18 +125,23 @@ class Blog_User extends User {
|
||||||
* @return array|null The User-Icon.
|
* @return array|null The User-Icon.
|
||||||
*/
|
*/
|
||||||
public function get_icon() {
|
public function get_icon() {
|
||||||
$image = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ) );
|
// try site icon first
|
||||||
|
$icon_id = get_option( 'site_icon' );
|
||||||
|
// try custom logo second
|
||||||
|
if ( ! $icon_id ) {
|
||||||
|
$icon_id = get_theme_mod( 'custom_logo' );
|
||||||
|
}
|
||||||
|
if ( ! $icon_id ) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if ( $image ) {
|
$image = wp_get_attachment_image_src( $icon_id, 'full' );
|
||||||
return array(
|
return array(
|
||||||
'type' => 'Image',
|
'type' => 'Image',
|
||||||
'url' => esc_url( $image[0] ),
|
'url' => esc_url( $image[0] ),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the User-Header-Image.
|
* Get the User-Header-Image.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue