wp_password_change_notification

Definition:
function wp_password_change_notification(&$user) {}

Notify the blog admin of a user changing password, normally via email.

Parameters

  • object $user: User Object
  • &$user

Source code

function wp_password_change_notification(&$user) {

	// send a copy of password change notification to the admin

	// but check to see if it's the admin whose password we're changing, and skip this

	if ( $user->user_email != get_option('admin_email') ) {

		$message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";

		// The blogname option is escaped with esc_html on the way into the database in sanitize_option

		// we want to reverse this for the plain text arena of emails.

		$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

		wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message);

	}

}

3979

wp_parse_str

Definition:
function wp_parse_str( $string, &$array ) {}

Parses a string into variables to be stored in an array.
Uses parse_str() and stripslashes if magic_quotes_gpc is on.

Parameters

  • string $string: The string to be parsed.
  • array $array: Variables will be stored in this array.
  • &$array

Defined filters

  • wp_parse_str
    apply_filters( 'wp_parse_str', $array )

Source code

function wp_parse_str( $string, &$array ) {

	parse_str( $string, $array );

	if ( get_magic_quotes_gpc() )

		$array = stripslashes_deep( $array );

	$array = apply_filters( 'wp_parse_str', $array );

}

3977

wp_parse_id_list

Definition:
function wp_parse_id_list( $list ) {}

Clean up an array, comma- or space-separated list of IDs.

Parameters

  • array|string $list

Return values

returns:Sanitized array of IDs

Source code

function wp_parse_id_list( $list ) {

	if ( !is_array($list) )

		$list = preg_split('/[\s,]+/', $list);



	return array_unique(array_map('absint', $list));

}

3975

wp_parse_auth_cookie

Definition:
function wp_parse_auth_cookie($cookie = '', $scheme = '') {}

Parse a cookie into its components

Parameters

  • string $cookie
  • string $scheme: Optional. The cookie scheme to use: auth, secure_auth, or logged_in

Return values

returns:Authentication cookie components

Source code

function wp_parse_auth_cookie($cookie = '', $scheme = '') {

	if ( empty($cookie) ) {

		switch ($scheme){

			case 'auth':

				$cookie_name = AUTH_COOKIE;

				break;

			case 'secure_auth':

				$cookie_name = SECURE_AUTH_COOKIE;

				break;

			case "logged_in":

				$cookie_name = LOGGED_IN_COOKIE;

				break;

			default:

				if ( is_ssl() ) {

					$cookie_name = SECURE_AUTH_COOKIE;

					$scheme = 'secure_auth';

				} else {

					$cookie_name = AUTH_COOKIE;

					$scheme = 'auth';

				}

	    }



		if ( empty($_COOKIE[$cookie_name]) )

			return false;

		$cookie = $_COOKIE[$cookie_name];

	}



	$cookie_elements = explode('|', $cookie);

	if ( count($cookie_elements) != 3 )

		return false;



	list($username, $expiration, $hmac) = $cookie_elements;



	return compact('username', 'expiration', 'hmac', 'scheme');

}

3973

wp_parse_args

Definition:
function wp_parse_args( $args, $defaults = '' ) {}

Merge user defined arguments into defaults array.
This function is used throughout WordPress to allow for both string or array to be merged into another array.

Parameters

  • string|array $args: Value to merge with $defaults
  • array $defaults: Array that serves as the defaults.

Return values

returns:Merged user defined values with defaults.

Source code

function wp_parse_args( $args, $defaults = '' ) {

	if ( is_object( $args ) )

		$r = get_object_vars( $args );

	elseif ( is_array( $args ) )

		$r =& $args;

	else

		wp_parse_str( $args, $r );



	if ( is_array( $defaults ) )

		return array_merge( $defaults, $r );

	return $r;

}

3971