Title: is_user_option_local
Published: April 25, 2014
Last modified: May 20, 2026

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#wp--skip-link--target)

This function has been deprecated since 4.9.0.

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#parameters)󠁿

 `$key`stringrequired

`$user_id`intoptional

Defaults to current user.

`$blog_id`intoptional

Defaults to current blog.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#return)󠁿

 bool

## 󠀁[Source](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#source)󠁿

    ```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 );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/ms-deprecated.php#L543)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/ms-deprecated.php#L543-L555)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_current_user()](https://developer.wordpress.org/reference/functions/wp_get_current_user/)`wp-includes/pluggable.php` |

Retrieves the current user object.

  | 
| [wpdb::get_blog_prefix()](https://developer.wordpress.org/reference/classes/wpdb/get_blog_prefix/)`wp-includes/class-wpdb.php` |

Gets blog prefix.

  | 
| [get_current_blog_id()](https://developer.wordpress.org/reference/functions/get_current_blog_id/)`wp-includes/load.php` |

Retrieves the current site ID.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/is_user_option_local/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Deprecated.  | 
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_user_option_local%2F)
before being able to contribute a note or feedback.