Making WordPress.org


Ignore:
Timestamp:
01/14/2021 06:30:11 AM (13 months ago)
Author:
dd32
Message:

Support Forums: Add a user log entry when a user is blocked or unblocked.

See #4691.
See #2537.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r10578 r10580  
    12851285    /**
    12861286     * Catch a user being blocked / unblocked and set their password appropriately.
     1287     *
     1288     * Note: This method is called even when the users role is not changed.
    12871289     */
    12881290    public function user_blocked_password_handler( $new_role, $user_id, \WP_User $user ) {
     
    13191321            $manager->destroy_all();
    13201322
     1323            // Add a user note about this action.
     1324            Plugin::get_instance()->user_notes->add_user_note(
     1325                $user->ID,
     1326                sprintf(
     1327                    'Forum role changed to %s.',
     1328                    get_role( $new_role )->name
     1329                )
     1330            );
    13211331        } else if (
    13221332            $password_broken &&
     
    13361346
    13371347            clean_user_cache( $user );
    1338         }
     1348
     1349            // Add a user note about this action.
     1350            Plugin::get_instance()->user_notes->add_user_note(
     1351                $user->ID,
     1352                sprintf(
     1353                    'Forum role changed to %s.',
     1354                    get_role( $new_role )->name
     1355                )
     1356            );
     1357        }
     1358
    13391359    }
    13401360}
Note: See TracChangeset for help on using the changeset viewer.