user_pass_ok

Definition:
function user_pass_ok($user_login, $user_pass) {}

Check that the user login name and password is correct.

Parameters

  • string $user_login: User name.
  • string $user_pass: User password.

Return values

returns:False if does not authenticate, true if username and password authenticates.

Source code

function user_pass_ok($user_login, $user_pass) {

	$user = wp_authenticate($user_login, $user_pass);

	if ( is_wp_error($user) )

		return false;



	return true;

}

3299

user_can_richedit

Definition:
function user_can_richedit() {}

Whether the user should have a WYSIWIG editor.
Checks that the user requires a WYSIWIG editor and that the editor is supported in the users browser.

Defined filters

  • user_can_richedit
    apply_filters('user_can_richedit', $wp_rich_edit)

Source code

function user_can_richedit() {

	global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_iphone, $is_IE;



	if ( !isset($wp_rich_edit) ) {

		$wp_rich_edit = false;



		if ( get_user_option( 'rich_editing' ) == 'true' || !is_user_logged_in() ) { // default to 'true' for logged out users

			if ( $is_safari ) {

				if ( !$is_iphone || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 534 ) )

					$wp_rich_edit = true;

			} elseif ( $is_gecko || $is_opera || $is_chrome || $is_IE ) {

				$wp_rich_edit = true;

			}

		}

	}



	return apply_filters('user_can_richedit', $wp_rich_edit);

}

3295

user_can_edit_user

Definition:
function user_can_edit_user($user_id, $other_user) {}

Can user can edit other user.

Parameters

  • int $user_id
  • int $other_user

Source code

function user_can_edit_user($user_id, $other_user) {

	_deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' );



	$user  = get_userdata($user_id);

	$other = get_userdata($other_user);

	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )

		return true;

	else

		return false;

}

3293