BP_Core_Members_Switching::filter_user_row_actions( string[] $actions, WP_User $user )
Adds a ‘View As’ link to each list of user actions on the Users screen.
Description
Parameters
- $actions
-
(Required) The actions to display for this user row.
- $user
-
(Required) The user object displayed in this row.
Return
(string[]) The actions to display for this user row.
Source
File: bp-members/classes/class-bp-core-members-switching.php
public function filter_user_row_actions( array $actions, WP_User $user ) { $link = self::maybe_switch_url( $user ); if ( ! $link ) { return $actions; } $actions['switch_to_user'] = '<a href="' . esc_url( $link ) . '">' . esc_html__( 'Switch To', 'buddyboss' ) . '</a>'; return $actions; }
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.