• Knowledge Base
    • All Articles
    • BuddyBoss Platform
    • BuddyBoss Theme
    • BuddyBoss App
    • Integrations
    • Advanced Setup
    • Troubleshooting
    • Release Notes
      • BuddyBoss Platform
      • BuddyBoss Platform Pro
      • BuddyBoss Theme
      • BuddyBoss App
      • BuddyBoss App Plugin
      • Other Products
  • Developers
    • Developer Tutorials
      • Web Development
      • App Development
    • Code Reference
      • Functions
      • Hooks
      • Classes
      • Methods
      • Commands
      • App Codex
    • REST API
      • BuddyBoss Platform
      • BuddyBoss App
    • Font Cheatsheet
    • Github Project
  • Roadmap
  • Go to BuddyBoss
    Contact Support
    Filter
    • Knowledge Base
      • All Articles
      • BuddyBoss Platform
      • BuddyBoss Theme
      • BuddyBoss App
      • Integrations
      • Advanced Setup
      • Troubleshooting
      • Release Notes
        • BuddyBoss Platform
        • BuddyBoss Platform Pro
        • BuddyBoss Theme
        • BuddyBoss App
        • BuddyBoss App Plugin
        • Other Products
    • Developers
      • Developer Tutorials
        • Web Development
        • App Development
      • Code Reference
        • Functions
        • Hooks
        • Classes
        • Methods
        • Commands
        • App Codex
      • REST API
        • BuddyBoss Platform
        • BuddyBoss App
      • Font Cheatsheet
      • Github Project
    • Roadmap
    • Go to BuddyBoss
    Filter
    Filter

    Contents

    • Description
    • Parameters
    • Return
    • Source
    • Changelog
    • Related
    Code Reference Classes BP_Signup BP_Signup::get()

    BP_Signup::get( array $args = array() )

    Fetch signups based on parameters.

    Description

    Parameters

    $args

    (Optional) The argument to retrieve desired signups.

    • 'offset'
      (int) Offset amount. Default 0.
    • 'number'
      (int) How many to fetch. Default 1.
    • 'usersearch'
      (bool|string) Whether or not to search for a username. Default false.
    • 'orderby'
      (string) Order By parameter. Default 'signup_id'.
    • 'order'
      (string) Order direction. Default 'DESC'.
    • 'include'
      (bool) Whether or not to include more specific query params.
    • 'activation_key'
      (string) Activation key to search for.
    • 'user_login'
      (string) Specific user login to return.
    • 'fields'
      (string) Which fields to return. Specify 'ids' to fetch a list of signups IDs. Default: 'all' (return BP_Signup objects).

    Default value: array()

    Return

    (array)

    • 'signups'
      (array) Located signups. (IDs only if fields is set to ids.)
    • 'total'
      (int) Total number of signups matching params.

    Source

    File: bp-members/classes/class-bp-signup.php

    	public static function get( $args = array() ) {
    		global $wpdb;
    
    		$r = bp_parse_args( $args,
    			array(
    				'offset'         => 0,
    				'number'         => 1,
    				'usersearch'     => false,
    				'orderby'        => 'signup_id',
    				'order'          => 'DESC',
    				'include'        => false,
    				'activation_key' => '',
    				'user_login'     => '',
    				'fields'         => 'all',
    			),
    			'bp_core_signups_get_args'
    		);
    
    		// @todo whitelist sanitization
    		if ( $r['orderby'] !== 'signup_id' ) {
    			$r['orderby'] = 'user_' . $r['orderby'];
    		}
    
    		$r['orderby'] = sanitize_title( $r['orderby'] );
    
    		$sql = array();
    		$signups_table  = buddypress()->members->table_name_signups;
    		$sql['select']  = "SELECT * FROM {$signups_table}";
    		$sql['where']   = array();
    		$sql['where'][] = "active = 0";
    
    		if ( empty( $r['include'] ) ) {
    
    			// Search terms.
    			if ( ! empty( $r['usersearch'] ) ) {
    				$search_terms_like = '%' . bp_esc_like( $r['usersearch'] ) . '%';
    				$sql['where'][]    = $wpdb->prepare( "( user_login LIKE %s OR user_email LIKE %s OR meta LIKE %s )", $search_terms_like, $search_terms_like, $search_terms_like );
    			}
    
    			// Activation key.
    			if ( ! empty( $r['activation_key'] ) ) {
    				$sql['where'][] = $wpdb->prepare( "activation_key = %s", $r['activation_key'] );
    			}
    
    			// User login.
    			if ( ! empty( $r['user_login'] ) ) {
    				$sql['where'][] = $wpdb->prepare( "user_login = %s", $r['user_login'] );
    			}
    
    			$sql['orderby'] = "ORDER BY {$r['orderby']}";
    			$sql['order']	= bp_esc_sql_order( $r['order'] );
    			$sql['limit']	= $wpdb->prepare( "LIMIT %d, %d", $r['offset'], $r['number'] );
    		} else {
    			$in = implode( ',', wp_parse_id_list( $r['include'] ) );
    			$sql['in'] = "AND signup_id IN ({$in})";
    		}
    
    		// Implode WHERE clauses.
    		$sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] );
    
    		/**
    		 * Filters the Signups paged query.
    		 *
    		 * @since BuddyPress 2.0.0
    		 *
    		 * @param string $value SQL statement.
    		 * @param array  $sql   Array of SQL statement parts.
    		 * @param array  $args  Array of original arguments for get() method.
    		 * @param array  $r     Array of parsed arguments for get() method.
    		 */
    		$paged_signups = $wpdb->get_results( apply_filters( 'bp_members_signups_paged_query', join( ' ', $sql ), $sql, $args, $r ) );
    
    		if ( empty( $paged_signups ) ) {
    			return array( 'signups' => false, 'total' => false );
    		}
    
    		// We only want the IDs.
    		if ( 'ids' === $r['fields'] ) {
    			$paged_signups = wp_list_pluck( $paged_signups, 'signup_id' );
    		} else {
    
    			// Used to calculate a diff between now & last
    			// time an activation link has been resent.
    			$now = current_time( 'timestamp', true );
    
    			foreach ( (array) $paged_signups as $key => $signup ) {
    
    				$signup->id   = intval( $signup->signup_id );
    
    				$signup->meta = ! empty( $signup->meta ) ? maybe_unserialize( $signup->meta ) : false;
    
    				$signup->user_name = '';
    				if ( ! empty( $signup->meta['field_1'] ) ) {
    					$signup->user_name = wp_unslash( $signup->meta['field_1'] );
    				}
    
    				// Sent date defaults to date of registration.
    				if ( ! empty( $signup->meta['sent_date'] ) ) {
    					$signup->date_sent = $signup->meta['sent_date'];
    				} else {
    					$signup->date_sent = $signup->registered;
    				}
    
    				$sent_at = mysql2date('U', $signup->date_sent );
    				$diff    = $now - $sent_at;
    
    				/**
    				 * Add a boolean in case the last time an activation link
    				 * has been sent happened less than a day ago.
    				 */
    				if ( $diff < 1 * DAY_IN_SECONDS ) {
    					$signup->recently_sent = true;
    				}
    
    				if ( ! empty( $signup->meta['count_sent'] ) ) {
    					$signup->count_sent = absint( $signup->meta['count_sent'] );
    				} else {
    					$signup->count_sent = 1;
    				}
    
    				$paged_signups[ $key ] = $signup;
    			}
    		}
    
    		unset( $sql['limit'] );
    		$sql['select'] = preg_replace( "/SELECT.*?FROM/", "SELECT COUNT(*) FROM", $sql['select'] );
    
    		/**
    		 * Filters the Signups count query.
    		 *
    		 * @since BuddyPress 2.0.0
    		 *
    		 * @param string $value SQL statement.
    		 * @param array  $sql   Array of SQL statement parts.
    		 * @param array  $args  Array of original arguments for get() method.
    		 * @param array  $r     Array of parsed arguments for get() method.
    		 */
    		$total_signups = $wpdb->get_var( apply_filters( 'bp_members_signups_count_query', join( ' ', $sql ), $sql, $args, $r ) );
    
    		return array( 'signups' => $paged_signups, 'total' => $total_signups );
    	}
    

    Expand full source code Collapse full source code

    Changelog

    Changelog
    Version Description
    BuddyPress 2.0.0 Introduced.

    Related

    Uses

    Uses
    Uses Description
    bp-loader.php: buddypress()

    The main function responsible for returning the one true BuddyBoss Instance to functions everywhere.

    bp-members/classes/class-bp-signup.php: bp_members_signups_paged_query

    Filters the Signups paged query.

    bp-members/classes/class-bp-signup.php: bp_members_signups_count_query

    Filters the Signups count query.

    bp-core/bp-core-functions.php: bp_parse_args()

    Merge user defined arguments into defaults array.

    bp-core/bp-core-functions.php: bp_esc_like()

    Escape special characters in a SQL LIKE clause.

    bp-core/bp-core-functions.php: bp_esc_sql_order()

    Sanitize an ‘order’ parameter for use in building SQL queries.

    Show 1 more use Hide more uses

    Used By
    Used By Description
    bp-members/classes/class-bp-rest-signup-endpoint.php: BP_REST_Signup_Endpoint::get_items()

    Retrieve signups.

    bp-members/classes/class-bp-rest-signup-endpoint.php: BP_REST_Signup_Endpoint::get_signup_object()

    Get signup object.

    bp-members/bp-members-functions.php: bp_core_signup_disable_inactive()

    Display a “resend email” link when an unregistered user attempts to log in.

    bp-members/bp-members-functions.php: bp_core_validate_user_signup()

    Validate a user name and email address when creating a new user.

    bp-members/bp-members-functions.php: bp_core_activate_signup()

    Activate a signup, as identified by an activation key.

    bp-members/classes/class-bp-signup.php: BP_Signup::resend()

    Resend an activation email.

    bp-members/classes/class-bp-signup.php: BP_Signup::activate()

    Activate a pending account.

    bp-members/classes/class-bp-signup.php: BP_Signup::delete()

    Delete a pending account.

    bp-members/classes/class-bp-members-admin.php: BP_Members_Admin::signups_admin_manage()

    This is the confirmation screen for actions.

    bp-members/classes/class-bp-members-ms-list-table.php: BP_Members_MS_List_Table::prepare_items()

    Set up items for display in the list table.

    bp-members/classes/class-bp-members-list-table.php: BP_Members_List_Table::prepare_items()

    Set up items for display in the list table.

    Show 6 more used by Hide more used by

    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.

    © 2025 • BuddyBoss