Skip to content

Commit

Permalink
Merge pull request #278 from 10up/revert-260-fix/231
Browse files Browse the repository at this point in the history
Fix Gravatar Fallback
  • Loading branch information
dkotter authored May 13, 2024
2 parents a3b5c67 + a032dd9 commit 1345384
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/class-simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ public function get_avatar_data( $args, $id_or_email ) {

// Local only mode
if ( ! $simple_local_avatar_url ) {
$args['url'] = $this->get_default_avatar_url( $args['size'] );
$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'] ) ) {
Expand Down Expand Up @@ -1470,6 +1475,7 @@ public function add_avatar_default_field( $defaults ) {
<input type="hidden" name="simple-local-avatar-file-id" id="simple-local-avatar-file-id" value="<?php echo ! empty( $default_avatar_file_id ) ? esc_attr( $default_avatar_file_id ) : ''; ?>"/>
<input type="hidden" name="simple-local-avatar-file-url" id="simple-local-avatar-file-url" value="<?php echo ! empty( $default_avatar_file_url ) ? esc_url( $default_avatar_file_url ) : ''; ?>"/>
<input type="button" name="simple-local-avatar" id="simple-local-avatar-default" class="button-secondary" value="<?php esc_attr_e( 'Choose Default Avatar', 'simple-local-avatar' ); ?>"/>
<p class="description" style="margin-left: 23px;"><?php esc_html_e( 'Note that this avatar needs to be publicly available or a broken image will be shown.', 'simple-local-avatar' ); ?></p>
<?php
$defaults['simple_local_avatar'] = ob_get_clean();

Expand Down

0 comments on commit 1345384

Please sign in to comment.