Dev Resources

  • Home
  • Reference
  • BuddyX Theme
  • Functions
  • Hooks
  • Classes
Filter by type:
Search
Browse: Home / Reference / Classes / BP_Signup / BP_Signup::validate()

BP_Signup::validate( string $key = '' )

Activate a signup.

Contents

  • Description
    • Parameters
    • Return
    • Source
    • Changelog
  • User Contributed Notes

Description #Description


Parameters #Parameters

$key

(Optional) Activation key.

Default value: ''


Top ↑

Return #Return

(bool) True on success, false on failure.


Top ↑

Source #Source

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

	public static function validate( $key = '' ) {
		global $wpdb;

		if ( empty( $key ) ) {
			return;
		}

		$activated = $wpdb->update(
			// Signups table.
			buddypress()->members->table_name_signups,
			array(
				'active' => 1,
				'activated' => current_time( 'mysql', true ),
			),
			array(
				'activation_key' => $key,
			),
			// Data sanitization format.
			array(
				'%d',
				'%s',
			),
			// WHERE sanitization format.
			array(
				'%s',
			)
		);

		/**
		 * Filters the status of the activated user.
		 *
		 * @since 2.0.0
		 *
		 * @param bool $activated Whether or not the activation was successful.
		 */
		return apply_filters( 'bp_core_signups_validate', $activated );
	}

Expand full source code Collapse full source code


Top ↑

Changelog #Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

Proudly powered by WordPress