Making WordPress.org

Changeset 11958


Ignore:
Timestamp:
07/12/2022 08:30:57 PM (3 years ago)
Author:
iandunn
Message:

GP Profiles: Accept mixed data type to avoid fatal error when null.

Sometimes the user hasn't been set on a translation, so we can't assume that the param is an int.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-profiles/profiles.php

    r11950 r11958  
    8484 * This isn't needed for `gp_translation_set_bulk_action_post` callbacks, since that only gets triggered by the
    8585 * normal UI flow.
     86 *
     87 * @param mixed $user_id Accept mixed so that callers don't have to check the type. `get_userdata()` will do that.
    8688 */
    87 function should_notify( int $user_id ) : bool {
     89function should_notify( $user_id ) : bool {
    8890    $notify = true;
    8991
Note: See TracChangeset for help on using the changeset viewer.