is_wp_error

Definition:
function is_wp_error($thing) {}

Check whether variable is a WordPress Error.
Looks at the object and if a WP_Error class. Does not check to see if the parent is also WP_Error, so can’t inherit WP_Error and still use this function.

Parameters

  • mixed $thing: Check if unknown variable is WordPress Error object.

Return values

returns:True, if WP_Error. False, if not WP_Error.

Source code

function is_wp_error($thing) {

	if ( is_object($thing) && is_a($thing, 'WP_Error') )

		return true;

	return false;

}

2229

is_wpmu_sitewide_plugin

Definition:
function is_wpmu_sitewide_plugin( $file ) {}

Parameters

  • $file

Source code

function is_wpmu_sitewide_plugin( $file ) {

	_deprecated_function(__FUNCTION__, '3.0', 'is_network_only_plugin()' );

	return is_network_only_plugin( $file );

}

2227

is_user_spammy

Definition:
function is_user_spammy( $username = 0 ) {}

Check to see whether a user is marked as a spammer, based on username

Parameters

  • string $username

Source code

function is_user_spammy( $username = 0 ) {

	if ( $username == 0 ) {

		$user_id = get_current_user_id();

	} else {

		$user_id = get_user_id_from_string( $username );

	}

	$u = new WP_User( $user_id );



	return ( isset( $u->spam ) && $u->spam == 1 );

}

2225

is_user_option_local

Definition:
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {}

Check whether a usermeta key has to do with the current blog.

Parameters

  • string $key
  • int $user_id: Optional. Defaults to current user.
  • int $blog_id: Optional. Defaults to current blog.

Source code

function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {

	global $wpdb;



	$current_user = wp_get_current_user();

	if ( $user_id == 0 )

		$user_id = $current_user->ID;

	if ( $blog_id == 0 )

		$blog_id = $wpdb->blogid;



	$local_key = $wpdb->base_prefix . $blog_id . '_' . $key;



	if ( isset( $current_user->$local_key ) )

		return true;



	return false;

}

2223

is_user_member_of_blog

Definition:
function is_user_member_of_blog( $user_id, $blog_id = 0 ) {}

Find out whether a user is a member of a given blog.

Parameters

  • int $user_id: The unique ID of the user
  • int $blog: Optional. If no blog_id is provided, current site is used
  • $blog_id

Source code

function is_user_member_of_blog( $user_id, $blog_id = 0 ) {

	$user_id = (int) $user_id;

	$blog_id = (int) $blog_id;



	if ( $blog_id == 0 ) {

		global $wpdb;

		$blog_id = $wpdb->blogid;

	}



	$blogs = get_blogs_of_user( $user_id );

	if ( is_array( $blogs ) )

		return array_key_exists( $blog_id, $blogs );

	else

		return false;

}

2221