Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




is_user_option_local [ WordPress Function ]

is_user_option_local ( $key, $user_id = 0, $blog_id = 0 )
Parameters:
  • (string) $key
  • (int) $user_id Optional. Defaults to current user.
  • (int) $blog_id Optional. Defaults to current blog.
Uses:
Returns:
  • (bool)
Defined at:



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

Source


<?php
function is_user_option_local$key$user_id 0$blog_id ) {
    global 
$wpdb;

    
$current_user wp_get_current_user();
    if ( 
$user_id == )
        
$user_id $current_user->ID;
    if ( 
$blog_id == )
        
$blog_id $wpdb->blogid;

    
$local_key $wpdb->get_blog_prefix$blog_id ) . $key;

    if ( isset( 
$current_user->$local_key ) )
        return 
true;

    return 
false;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics