Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.