Changeset 53729
- Timestamp:
- 07/20/2022 02:12:02 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r53723 r53729 1298 1298 1299 1299 if ( $user->exists() ) { 1300 $user_ ID= $user->ID;1300 $user_id = $user->ID; 1301 1301 $comment_author = wp_slash( $user->display_name ); 1302 1302 $comment_author_email = wp_slash( $user->user_email ); … … 1344 1344 'comment_type', 1345 1345 'comment_parent', 1346 'user_ ID'1346 'user_id' 1347 1347 ); 1348 1348 -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r53723 r53729 3951 3951 $comment['comment_author_email'] = $this->escape( $user_email ); 3952 3952 $comment['comment_author_url'] = $this->escape( $user_url ); 3953 $comment['user_ ID'] = $user->ID;3953 $comment['user_id'] = $user->ID; 3954 3954 } else { 3955 3955 $comment['comment_author'] = ''; … … 3968 3968 } 3969 3969 3970 $comment['user_ ID'] = 0;3970 $comment['user_id'] = 0; 3971 3971 3972 3972 if ( get_option( 'require_name_email' ) ) { -
trunk/src/wp-includes/comment.php
r53723 r53729 2090 2090 * Filters the comment author's user ID before it is set. 2091 2091 * 2092 * The first time this filter is evaluated, 'user_ID'is checked2093 * (for back-compat), followed by the standard 'user_id'value.2092 * The first time this filter is evaluated, `user_ID` is checked 2093 * (for back-compat), followed by the standard `user_id` value. 2094 2094 * 2095 2095 * @since 1.5.0 2096 2096 * 2097 * @param int $user_ IDThe comment author's user ID.2097 * @param int $user_id The comment author's user ID. 2098 2098 */ 2099 2099 $commentdata['user_id'] = apply_filters( 'pre_user_id', $commentdata['user_ID'] ); … … 2133 2133 /** This filter is documented in wp-includes/comment.php */ 2134 2134 $commentdata['comment_author_email'] = apply_filters( 'pre_comment_author_email', $commentdata['comment_author_email'] ); 2135 $commentdata['filtered'] = true; 2135 2136 $commentdata['filtered'] = true; 2137 2136 2138 return $commentdata; 2137 2139 } … … 2266 2268 2267 2269 $commentdata['comment_approved'] = wp_allow_comment( $commentdata, $wp_error ); 2270 2268 2271 if ( is_wp_error( $commentdata['comment_approved'] ) ) { 2269 2272 return $commentdata['comment_approved']; … … 2271 2274 2272 2275 $comment_ID = wp_insert_comment( $commentdata ); 2276 2273 2277 if ( ! $comment_ID ) { 2274 2278 $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); … … 2469 2473 // First, get all of the original fields. 2470 2474 $comment = get_comment( $commentarr['comment_ID'], ARRAY_A ); 2475 2471 2476 if ( empty( $comment ) ) { 2472 2477 if ( $wp_error ) { … … 3422 3427 */ 3423 3428 function wp_handle_comment_submission( $comment_data ) { 3424 3425 3429 $comment_post_id = 0; 3426 $comment_parent = 0;3427 $user_ID = 0;3428 3430 $comment_author = null; 3429 3431 $comment_author_email = null; 3430 3432 $comment_author_url = null; 3431 3433 $comment_content = null; 3434 $comment_parent = 0; 3435 $user_id = 0; 3432 3436 3433 3437 if ( isset( $comment_data['comment_post_ID'] ) ) { … … 3554 3558 $comment_author_email = $user->user_email; 3555 3559 $comment_author_url = $user->user_url; 3556 $user_ ID= $user->ID;3560 $user_id = $user->ID; 3557 3561 3558 3562 if ( current_user_can( 'unfiltered_html' ) ) { … … 3584 3588 $commentdata = array( 3585 3589 'comment_post_ID' => $comment_post_id, 3590 'user_ID' => $user_id, 3586 3591 ); 3587 3592 … … 3593 3598 'comment_type', 3594 3599 'comment_parent', 3595 'user_ID'3596 3600 ); 3597 3601 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r53139 r53729 1884 1884 array( 1885 1885 'comment_post_ID' => 0, 1886 'comment_parent' => 0,1887 'user_ID' => 0,1888 1886 'comment_author' => null, 1889 1887 'comment_author_email' => null, 1890 1888 'comment_author_url' => null, 1889 'comment_parent' => 0, 1890 'user_id' => 0, 1891 1891 ) 1892 1892 ); -
trunk/tests/phpunit/tests/comment-submission.php
r52010 r53729 812 812 813 813 $this->assertNotWPError( $comment ); 814 $this->assertSame (814 $this->assertSameSets( 815 815 array( 816 816 'comment_post_ID' => self::$post->ID,
Note: See TracChangeset
for help on using the changeset viewer.