Dev Resources

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

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

Update the meta for a signup.

Contents

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

Description #Description

This is the way we use to "trace" the last date an activation email was sent and how many times activation was sent.


Parameters #Parameters

$args

(Optional) Array of arguments for the signup update.

  • 'signup_id'
    (int) User signup ID.
  • 'meta'
    (array) Meta to update.

Default value: array()


Top ↑

Return #Return

(int) The signup id.


Top ↑

Source #Source

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

	public static function update( $args = array() ) {
		global $wpdb;

		$r = bp_parse_args( $args,
			array(
				'signup_id'  => 0,
				'meta'       => array(),
			),
			'bp_core_signups_update_args'
		);

		if ( empty( $r['signup_id'] ) || empty( $r['meta'] ) ) {
			return false;
		}

		$wpdb->update(
			// Signups table.
			buddypress()->members->table_name_signups,
			// Data to update.
			array(
				'meta' => serialize( $r['meta'] ),
			),
			// WHERE.
			array(
				'signup_id' => $r['signup_id'],
			),
			// Data sanitization format.
			array(
				'%s',
			),
			// WHERE sanitization format.
			array(
				'%d',
			)
		);

		/**
		 * Filters the signup ID which received a meta update.
		 *
		 * @since 2.0.0
		 *
		 * @param int $value The signup ID.
		 */
		return apply_filters( 'bp_core_signups_update', $r['signup_id'] );
	}

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