Skip to content

Commit

Permalink
format: improve code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Sep 19, 2023
1 parent d18ebf2 commit 0d6c6d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/class-simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ public function get_simple_local_avatar_url( $id_or_email, $size ) {
return '';
}



// Fetch local avatar from meta and make sure it's properly set.
$local_avatars = get_user_meta( $user_id, $this->user_key, true );
if ( empty( $local_avatars['media_id'] ) ) {
Expand All @@ -357,7 +359,7 @@ public function get_simple_local_avatar_url( $id_or_email, $size ) {
if ( ! empty( $local_avatars['media_id'] ) ) {
// If using shared avatars, make sure we validate the URL on the main site.
if ( $this->is_avatar_shared() ) {
$origin_blog_id = isset( $local_avatars['blog_id'] ) && ! empty( $local_avatars['blog_id'] ) ? $local_avatars['blog_id'] : get_main_site_id();
$origin_blog_id = ! empty( $local_avatars['blog_id'] ) ? $local_avatars['blog_id'] : get_main_site_id();
switch_to_blog( $origin_blog_id );
}

Expand Down Expand Up @@ -419,7 +421,7 @@ public function get_simple_local_avatar_url( $id_or_email, $size ) {
endif;
}

if ( 'http' !== substr( $local_avatars[ $size ], 0, 4 ) ) {
if ( strpos( $local_avatars[ $size ], 'http' ) !== 0 ) {
$local_avatars[ $size ] = home_url( $local_avatars[ $size ] );
}

Expand Down

0 comments on commit 0d6c6d7

Please sign in to comment.