Filter hook 'user_row_actions'

in WP Core File wp-admin/includes/class-wp-users-list-table.php at line 520

View Source

user_row_actions

Filter Hook
Description
Filters the action links displayed under each user in the Users list table.

Hook Information

File Location wp-admin/includes/class-wp-users-list-table.php View on GitHub
Hook Type Filter
Line Number 520

Hook Parameters

Type Name Description
string[] $actions An array of action links to be displayed. Default 'Edit', 'Delete' for single site, and 'Edit', 'Remove' for Multisite.
WP_User $user_object WP_User object for the currently listed user.

Usage Examples

Basic Usage
<?php
// Hook into user_row_actions
add_filter('user_row_actions', 'my_custom_filter', 10, 2);

function my_custom_filter($actions, $user_object) {
    // Your custom filtering logic here
    return $actions;
}

Source Code Context

wp-admin/includes/class-wp-users-list-table.php:520 - How this hook is used in WordPress core
<?php
 515  			 * @param string[] $actions     An array of action links to be displayed.
 516  			 *                              Default 'Edit', 'Delete' for single site, and
 517  			 *                              'Edit', 'Remove' for Multisite.
 518  			 * @param WP_User  $user_object WP_User object for the currently listed user.
 519  			 */
 520  			$actions = apply_filters( 'user_row_actions', $actions, $user_object );
 521  
 522  			// Role classes.
 523  			$role_classes = esc_attr( implode( ' ', array_keys( $user_roles ) ) );
 524  
 525  			// Set up the checkbox (because the user is editable, otherwise it's empty).

PHP Documentation

<?php
/**
			 * Filters the action links displayed under each user in the Users list table.
			 *
			 * @since 2.8.0
			 *
			 * @param string[] $actions     An array of action links to be displayed.
			 *                              Default 'Edit', 'Delete' for single site, and
			 *                              'Edit', 'Remove' for Multisite.
			 * @param WP_User  $user_object WP_User object for the currently listed user.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-users-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.