WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-includes/ms-functions.php

    r15186 r15452  
    210210    $user = new WP_User($user_id);
    211211
    212     if ( empty($user) || !$user->ID )
     212    if ( empty( $user->ID ) )
    213213        return new WP_Error('user_does_not_exist', __('That user does not exist.'));
    214214
     
    254254    // wp_revoke_user($user_id);
    255255    $user = new WP_User($user_id);
     256    if ( empty( $user->ID ) )
     257        return new WP_Error('user_does_not_exist', __('That user does not exist.'));
     258
    256259    $user->remove_all_caps();
    257260
     
    373376
    374377function is_blog_user( $blog_id = 0 ) {
    375     global $current_user, $wpdb;
    376 
     378    global $wpdb;
     379 
     380    $current_user = wp_get_current_user();
    377381    if ( !$blog_id )
    378382        $blog_id = $wpdb->blogid;
     
    653657    $message = sprintf( apply_filters( 'wpmu_signup_blog_notification_email', __( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ) ), $activate_url, esc_url( "http://{$domain}{$path}" ), $key );
    654658    // TODO: Don't hard code activation link.
    655     $subject = sprintf( apply_filters( 'wpmu_signup_blog_notification_subject', __( '[%1s] Activate %2s' ) ), $from_name, esc_url( 'http://' . $domain . $path ) );
     659    $subject = sprintf( apply_filters( 'wpmu_signup_blog_notification_subject', __( '[%1$s] Activate %2$s' ) ), $from_name, esc_url( 'http://' . $domain . $path ) );
    656660    wp_mail($user_email, $subject, $message, $message_headers);
    657661    return true;
     
    670674    $message = sprintf( apply_filters( 'wpmu_signup_user_notification_email', __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ) ), site_url( "wp-activate.php?key=$key" ), $key );
    671675    // TODO: Don't hard code activation link.
    672     $subject = sprintf( __( apply_filters( 'wpmu_signup_user_notification_subject', '[%1s] Activate %2s' ) ), $from_name, $user);
     676    $subject = sprintf( __( apply_filters( 'wpmu_signup_user_notification_subject', '[%1$s] Activate %2$s' ) ), $from_name, $user);
    673677    wp_mail($user_email, $subject, $message, $message_headers);
    674678    return true;
     
    13201324function is_user_spammy( $username = 0 ) {
    13211325    if ( $username == 0 ) {
    1322         global $current_user;
    1323         $user_id = $current_user->ID;
     1326        $user_id = get_current_user_id();
    13241327    } else {
    13251328        $user_id = get_user_id_from_string( $username );
     
    13271330    $u = new WP_User( $user_id );
    13281331
    1329     if ( $u->spam == 1 )
    1330         return true;
    1331 
    1332     return false;
     1332    return ( isset( $u->spam ) && $u->spam == 1 );
    13331333}
    13341334
     
    13611361
    13621362function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
    1363     global $current_user, $wpdb;
    1364 
     1363    global $wpdb;
     1364
     1365    $current_user = wp_get_current_user();
    13651366    if ( $user_id == 0 )
    13661367        $user_id = $current_user->ID;
Note: See TracChangeset for help on using the changeset viewer.