/** * Filter the WP Users List Table views to include 'bp-signups'. * * @since BuddyPress (2.0.0) * * @param array $views WP List Table views. * @return array The views with the signup view added. */ public function signup_filter_view($views = array()) { $class = ''; $signups = BP_Signup::count_signups(); // Remove the 'current' class from All if we're on the signups // view if ($this->signups_page == get_current_screen()->id) { $views['all'] = str_replace('class="current"', '', $views['all']); $class = ' class="current"'; } $views['registered'] = '<a href="' . add_query_arg('page', 'bp-signups', bp_get_admin_url('users.php')) . '"' . $class . '>' . sprintf(_x('Pending <span class="count">(%s)</span>', 'signup users', 'buddypress'), number_format_i18n($signups)) . '</a>'; return $views; }
/** * Filter the WP Users List Table views to include 'bp-signups'. * * @since 2.0.0 * * @param array $views WP List Table views. * @return array The views with the signup view added. */ 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(_x('Pending %s', 'signup users', 'buddypress'), '<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; }
/** * Filter the WP Users List Table views to include 'bp-signups'. * * @since BuddyPress (2.0.0) * * @param array $views WP List Table views. * @return array The views with the signup view added. */ public function signup_filter_view($views = array()) { // Remove the 'current' class from All if we're on the signups view if ($this->signups_page == get_current_screen()->id) { $views['all'] = str_replace('class="current"', '', $views['all']); $class = 'current'; } else { $class = ''; } $signups = BP_Signup::count_signups(); $url = add_query_arg('page', 'bp-signups', bp_get_admin_url('users.php')); $text = sprintf(_x('Pending %s', 'signup users', 'buddypress'), '<span class="count">(' . number_format_i18n($signups) . ')</span>'); $views['registered'] = sprintf('<a href="%1$s" class="%2$s">%3$s</a>', $url, $class, $text); return $views; }