/**
  * Make sure no signups will show in users list.
  *
  * This is needed to handle signups that may have not been activated
  * before the 2.0.0 upgrade.
  *
  * @since 2.0.0
  *
  * @param WP_User_Query|null $query The users query.
  * @return WP_User_Query The users query without the signups.
  */
 public function remove_signups_from_user_query($query = null)
 {
     global $wpdb;
     // Bail if this is an ajax request.
     if (defined('DOING_AJAX')) {
         return;
     }
     // Bail if updating BuddyPress.
     if (bp_is_update()) {
         return;
     }
     // Bail if there is no current admin screen.
     if (!function_exists('get_current_screen') || !get_current_screen()) {
         return;
     }
     // Get current screen.
     $current_screen = get_current_screen();
     // Bail if not on a users page.
     if (!isset($current_screen->id) || $this->users_page !== $current_screen->id) {
         return;
     }
     // Bail if already querying by an existing role.
     if (!empty($query->query_vars['role'])) {
         return;
     }
     $query->query_where .= " AND {$wpdb->users}.user_status != 2";
 }
 /**
  * Make sure no signups will show in users list.
  *
  * This is needed to handle signups that may have not been activated
  * before the 2.0.0 upgrade.
  *
  * @since BuddyPress (2.0.0)
  *
  * @param  WP_User_Query $query The users query.
  * @return WP_User_Query The users query without the signups.
  */
 public function remove_signups_from_user_query($query = null)
 {
     global $wpdb;
     // Bail if this is an ajax request
     if (defined('DOING_AJAX')) {
         return;
     }
     if (bp_is_update()) {
         return;
     }
     if (!function_exists('get_current_screen')) {
         return;
     }
     if ($this->users_page != get_current_screen()->id) {
         return;
     }
     if (!empty($query->query_vars['role'])) {
         return;
     }
     $query->query_where .= " AND {$wpdb->users}.user_status != 2";
 }
/**
 * Setup the BuddyPress updater
 *
 * @since BuddyPress (1.6)
 */
function bp_setup_updater()
{
    // Are we running an outdated version of BuddyPress?
    if (!bp_is_update()) {
        return;
    }
    bp_version_updater();
}
Esempio n. 4
0
/**
 * Setup the BuddyPress updater
 *
 * @since BuddyPress (1.6)
 *
 * @uses BBP_Updater
 */
function bp_setup_updater()
{
    // Are we running an outdated version of BuddyPress?
    if (bp_is_update()) {
        // Bump the version
        bp_version_bump();
        // Run the deactivation function to wipe roles, caps, and rewrite rules
        bp_deactivation();
        // Run the activation function to reset roles, caps, and rewrite rules
        bp_activation();
    }
}