From 9a150d213ea438285fa41fa3d4992645f7c7f042 Mon Sep 17 00:00:00 2001 From: faisal-alvi Date: Tue, 14 May 2024 02:38:40 +0530 Subject: [PATCH] pass image as default param when 'Local only' disabled; fix #231 --- includes/class-simple-local-avatars.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/class-simple-local-avatars.php b/includes/class-simple-local-avatars.php index 8bd49a2..0306775 100644 --- a/includes/class-simple-local-avatars.php +++ b/includes/class-simple-local-avatars.php @@ -275,8 +275,13 @@ public function get_avatar_data( $args, $id_or_email ) { } // Local only mode - if ( ! $simple_local_avatar_url && ! empty( $this->options['only'] ) ) { - $args['url'] = $this->get_default_avatar_url( $args['size'] ); + if ( ! $simple_local_avatar_url ) { + $default_url = $this->get_default_avatar_url( $args['size'] ); + if ( ! empty( $this->options['only'] ) ) { + $args['url'] = $default_url; + } else { + $args['default'] = $default_url; + } } if ( ! empty( $args['url'] ) ) { @@ -1470,6 +1475,7 @@ public function add_avatar_default_field( $defaults ) { +