Making WordPress.org

Changeset 12424


Ignore:
Timestamp:
02/27/2023 01:54:42 AM (4 years ago)
Author:
dd32
Message:

Translate: Fix constant PHP Notices.

See https://github.com/GlotPress/gp-translation-helpers/pull/162

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php

    r12405 r12424  
    580580                                'translation_id'       => isset( $this->data['translation_id'] ) ? $this->data['translation_id'] : null,
    581581                                'locale_slug'          => $this->data['locale_slug'],
    582                                 'original_permalink'   => $this->data['original_permalink'],
     582                                'original_permalink'   => $this->data['original_permalink'] ?? false,
    583583                                'original_id'          => $this->data['original_id'],
    584584                                'project'              => $this->data['project'],
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-wporg-notifications.php

    r12274 r12424  
    148148                                                        }
    149149
    150                                                                 $user = get_user_by( 'email', $email );
     150                                                        $user = get_user_by( 'email', $email );
     151                                                        if ( $user ) {
    151152                                                                return array(
    152153                                                                        'ID'            => $user->ID,
     
    157158                                                                        'image_URL'     => get_avatar_url( $user->ID ),
    158159                                                                );
     160                                                        }
     161
     162                                                        return false;
    159163                                                },
    160164                                                $all_email_addresses
    161165                                        );
    162                                                         return $users;
     166
     167                                        $users = array_filter( $users );
     168
     169                                        return $users;
    163170                                },
    164171                                10,
Note: See TracChangeset for help on using the changeset viewer.