user_row_actions
Filters the action links displayed under each user in the Users list table.
Usage
add_filter( 'user_row_actions', 'wp_kama_user_row_actions_filter', 10, 2 ); /** * Function for `user_row_actions` filter-hook. * * @param string[] $actions An array of action links to be displayed. * @param WP_User $user_object WP_User object for the currently listed user. * * @return string[] */ function wp_kama_user_row_actions_filter( $actions, $user_object ){ // filter... return $actions; }
- $actions(string[])
- An array of action links to be displayed.
Default: 'Edit', 'Delete' for single site, and 'Edit', 'Remove' for Multisite - $user_object(WP_User)
- WP_User object for the currently listed user.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
user_row_actions
wp-admin/includes/class-wp-users-list-table.php 520
$actions = apply_filters( 'user_row_actions', $actions, $user_object );