bbp_add_user_options( $user_id )

Add default user options


Description Description

This is destructive, so existing bbPress user options will be overridden.


Source Source

File: includes/users/options.php

function bbp_add_user_options( $user_id = 0 ) {

	// Validate user id
	$user_id = bbp_get_user_id( $user_id );
	if ( empty( $user_id ) ) {
		return;
	}

	// Add default options
	foreach ( bbp_get_default_user_options() as $key => $value ) {
		update_user_option( $user_id, $key, $value );
	}

	// Allow previously activated plugins to append their own user options.
	do_action( 'bbp_add_user_options', $user_id );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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