diff --git a/assets/img/mp.jpg b/assets/img/mp.jpg index 0356f91..05964b4 100644 Binary files a/assets/img/mp.jpg and b/assets/img/mp.jpg differ diff --git a/assets/img/wp-logo.png b/assets/img/wp-logo.png new file mode 100644 index 0000000..b48f08e Binary files /dev/null and b/assets/img/wp-logo.png differ diff --git a/build/follow-me/style-index.css b/build/follow-me/style-index.css index 4091e2c..2d3e377 100644 --- a/build/follow-me/style-index.css +++ b/build/follow-me/style-index.css @@ -1 +1 @@ -.activitypub-follow-me-block-wrapper .activitypub-profile,.editor-styles-wrapper .activitypub-profile{align-items:self-start;display:flex;padding:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__avatar,.editor-styles-wrapper .activitypub-profile .activitypub-profile__avatar{height:75px;margin-right:1rem;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__name,.editor-styles-wrapper .activitypub-profile .activitypub-profile__name{font-size:var(--wp--preset--font-size--large);line-height:1;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__follow,.editor-styles-wrapper .activitypub-profile .activitypub-profile__follow{align-self:center;background-color:var(--wp--preset--color--black);color:var(--wp--preset--color--white);margin-left:auto}.activitypub-follow-me__dialog{max-width:30em}.activitypub-follow-me__dialog h4{line-height:1;margin:0}.activitypub-follow-me__dialog .apmfd__section{margin-bottom:2em}.activitypub-follow-me__dialog .apfmd-description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub-follow-me__dialog .apfmd__button-group{display:flex;justify-content:flex-end}.activitypub-follow-me__dialog .apfmd__button-group svg{height:21px;margin-right:.5em;width:21px}.activitypub-follow-me__dialog .apfmd__button-group input{flex:1;padding-left:1em;padding-right:1em} +.activitypub-follow-me-block-wrapper .activitypub-profile,.editor-styles-wrapper .activitypub-profile{align-items:self-start;display:flex;padding:1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__avatar,.editor-styles-wrapper .activitypub-profile .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__name,.editor-styles-wrapper .activitypub-profile .activitypub-profile__name{font-size:var(--wp--preset--font-size--large);line-height:1;margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .activitypub-profile__follow,.editor-styles-wrapper .activitypub-profile .activitypub-profile__follow{align-self:center;background-color:var(--wp--preset--color--black);color:var(--wp--preset--color--white);margin-left:auto}.activitypub-follow-me__dialog{max-width:30em}.activitypub-follow-me__dialog h4{line-height:1;margin:0}.activitypub-follow-me__dialog .apmfd__section{margin-bottom:2em}.activitypub-follow-me__dialog .apfmd-description{font-size:var(--wp--preset--font-size--normal,.75rem);margin:.33em 0 1em}.activitypub-follow-me__dialog .apfmd__button-group{display:flex;justify-content:flex-end}.activitypub-follow-me__dialog .apfmd__button-group svg{height:21px;margin-right:.5em;width:21px}.activitypub-follow-me__dialog .apfmd__button-group input{flex:1;padding-left:1em;padding-right:1em} diff --git a/includes/model/class-blog-user.php b/includes/model/class-blog-user.php index 8de46df..14d087e 100644 --- a/includes/model/class-blog-user.php +++ b/includes/model/class-blog-user.php @@ -122,23 +122,34 @@ class Blog_User extends User { /** * Get the User-Icon. * - * @return array|null The User-Icon. + * @return array The User-Icon. */ public function get_icon() { // 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; + + $icon_url = false; + + if ( $icon_id ) { + $icon = wp_get_attachment_image_src( $icon_id, 'full' ); + if ( $icon ) { + $icon_url = $icon[0]; + } + } + + if ( ! $icon_url ) { + // fallback to default icon + $icon_url = plugins_url( '/assets/img/wp-logo.png', ACTIVITYPUB_PLUGIN_FILE ); } - $image = wp_get_attachment_image_src( $icon_id, 'full' ); return array( 'type' => 'Image', - 'url' => esc_url( $image[0] ), + 'url' => esc_url( $icon_url ), ); } diff --git a/src/follow-me/style.scss b/src/follow-me/style.scss index 9a29f4b..73a7812 100644 --- a/src/follow-me/style.scss +++ b/src/follow-me/style.scss @@ -8,6 +8,7 @@ height: 75px; width: 75px; margin-right: 1rem; + border-radius: 50%; } .activitypub-profile__name { margin: 0;