Warning: This function has been deprecated.

is_user_option_local() WordPress Function

The is_user_option_local() function checks whether a user option has a local value. This function is useful for checking if a user has set an option value locally, as opposed to having the option value be set by a network administrator. Returns true if the user option has a local value, false otherwise.

is_user_option_local( string $key, int $user_id, int $blog_id ) #

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


Parameters

$key

(string)(Required)

$user_id

(int)(Optional) Defaults to current user.

$blog_id

(int)(Optional) Defaults to current blog.


Top ↑

Return

(bool)


Top ↑

Source

File: wp-includes/ms-deprecated.php

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

	_deprecated_function( __FUNCTION__, '4.9.0' );

	$current_user = wp_get_current_user();
	if ( $blog_id == 0 ) {
		$blog_id = get_current_blog_id();
	}
	$local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;

	return isset( $current_user->$local_key );
}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0This function has been deprecated.
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.