Make WordPress Core

Changeset 12300


Ignore:
Timestamp:
12/01/2009 02:06:02 AM (17 years ago)
Author:
ryan
Message:

Accept either user_id or user_ID. Remove user_id global. see #11271 #11222

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r12284 r12300  
    7676$comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
    7777
    78 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_id');
     78$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
    7979
    8080$comment_id = wp_new_comment( $commentdata );
  • trunk/wp-includes/comment.php

    r12292 r12300  
    11271127 */
    11281128function wp_filter_comment($commentdata) {
    1129         // user_id is preferred. user_ID is accepted for back-compat.
    11301129        if ( isset($commentdata['user_ID']) )
    1131                 $commentdata['user_id'] = $commentdata['user_ID'] = apply_filters('pre_user_id', $commentdata['user_ID']);
    1132         else
    1133                 $commentdata['user_id'] = $commentdata['user_ID'] = apply_filters('pre_user_id', $commentdata['user_id']);
     1130                $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']);
     1131        elseif ( isset($commentdata['user_id']) )
     1132                $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_id']);
    11341133        $commentdata['comment_agent']        = apply_filters('pre_comment_user_agent', $commentdata['comment_agent']);
    11351134        $commentdata['comment_author']       = apply_filters('pre_comment_author_name', $commentdata['comment_author']);
    … …  
    11821181
    11831182        $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
    1184         // user_id is preferred. user_ID is accepted for back-compat.
    11851183        if ( isset($commentdata['user_ID']) )
    11861184                $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
    1187         else
    1188                 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_id'];
     1185        elseif ( isset($commentdata['user_id']) )
     1186                $commentdata['user_id'] = (int) $commentdata['user_id'];
    11891187
    11901188        $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
  • trunk/wp-includes/user.php

    r12288 r12300  
    452452 */
    453453function setup_userdata($for_user_id = '') {
    454         global $user_login, $userdata, $user_level, $user_id, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity;
     454        global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity;
    455455
    456456        if ( '' == $for_user_id )
    … …  
    465465        $user_login     = $user->user_login;
    466466        $user_level     = (int) isset($user->user_level) ? $user->user_level : 0;
    467         $user_id = $user_ID = (int) $user->ID;
     467        $user_ID = (int) $user->ID;
    468468        $user_email     = $user->user_email;
    469469        $user_url       = $user->user_url;
Note: See TracChangeset for help on using the changeset viewer.