WordPress.org

Making WordPress.org

Changeset 6685


Ignore:
Timestamp:
02/18/2018 02:54:16 PM (3 years ago)
Author:
ocean90
Message:

Rosetta Roles: Pass the full user object to the translation_editor_* actions.

Also include the list of added/removed project IDs.

See #1613.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php

    r6684 r6685  
    399399        ", $user->ID, $this->gp_locale->slug ) );
    400400
    401         do_action( 'translation_editor_removed', $user->ID );
     401        do_action( 'translation_editor_removed', $user );
    402402
    403403        return true;
     
    485485
    486486        if ( $update ) {
    487             do_action( 'translation_editor_updated', $user->ID );
     487            do_action( 'translation_editor_updated', $user, $projects_to_add, $projects_to_remove );
    488488        } else {
    489             do_action( 'translation_editor_added', $user->ID );
     489            do_action( 'translation_editor_added', $user, $projects_to_add, $projects_to_remove );
    490490        }
    491491
     
    497497     * profiles.wordpress.org.
    498498     *
    499      * @param int $user_id User ID.
    500      */
    501     public function update_wporg_profile_badge( $user_id ) {
     499     * @param \WP_User $user The user object of the translation editor.
     500     */
     501    public function update_wporg_profile_badge( $user ) {
    502502        $action = 'translation_editor_added' === current_filter() ? 'add' : 'remove';
    503503
    504         $this->notify_profiles_wporg_translation_editor_update( $user_id, $action );
     504        $this->notify_profiles_wporg_translation_editor_update( $user->ID, $action );
    505505    }
    506506
Note: See TracChangeset for help on using the changeset viewer.