BP_Members_Admin::signup_filter_view( array $views = array() )
Filter the WP Users List Table views to include ‘bp-signups’.
Description
Parameters
- $views
-
(Optional) WP List Table views.
Default value: array()
Return
(array) The views with the signup view added.
Source
File: bp-members/classes/class-bp-members-admin.php
public function signup_filter_view( $views = array() ) {
global $role;
// Remove the 'current' class from All if we're on the signups view.
if ( 'registered' === $role ) {
$views['all'] = str_replace( 'class="current"', '', $views['all'] );
$class = 'current';
} else {
$class = '';
}
$signups = BP_Signup::count_signups();
if ( is_network_admin() ) {
$base_url = network_admin_url( 'users.php' );
} else {
$base_url = bp_get_admin_url( 'users.php' );
}
$url = add_query_arg( 'page', 'bp-signups', $base_url );
$text = sprintf( __( 'Pending %s', 'buddyboss' ), '<span class="count">(' . number_format_i18n( $signups ) . ')</span>' );
$views['registered'] = sprintf( '<a href="%1$s" class="%2$s">%3$s</a>', esc_url( $url ), $class, $text );
return $views;
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.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.