is_user_option_local() WP 3.0.0
Deprecated in from version 4.9.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.
Check whether a usermeta key has to do with the current blog.
No Hooks.
Return
true/false.
Usage
is_user_option_local( $key, $user_id, $blog_id );
- $key(string) (required)
- $user_id(int)
- Optional.
Default: current user - $blog_id(int)
- Optional.
Default: current blog
Notes
- Global. wpdb. $wpdb WordPress database abstraction object.
Changelog
Since 3.0.0 | Introduced. | |
Deprecated | 4.9.0 |
Code of is_user_option_local() is user option local WP 5.6
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 );
}