On this page
is_user_option_local( string $key, int $user_id, int $blog_id ): bool
This function has been deprecated.
Check whether a usermeta key has to do with the current blog.
Parameters
$keystring Required$user_idint Optional-
Defaults to current user.
$blog_idint Optional-
Defaults to current blog.
Return
bool
Source
File: wp-includes/ms-deprecated.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_get_current_user() wp-includes/pluggable.php | Retrieves the current user object. |
| wpdb::get_blog_prefix() wp-includes/class-wpdb.php | Gets blog prefix. |
| get_current_blog_id() wp-includes/load.php | Retrieve the current site ID. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | This function has been deprecated. |
| MU (3.0.0) | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_user_option_local