Ticket #44416: 44416-simple.diff
| File 44416-simple.diff, 7.1 KB (added by , 8 years ago) |
|---|
-
src/wp-includes/class-wp-comment-query.php
635 635 $number = absint( $this->query_vars['number'] ); 636 636 $offset = absint( $this->query_vars['offset'] ); 637 637 $paged = absint( $this->query_vars['paged'] ); 638 $limits = ''; 638 639 639 640 if ( ! empty( $number ) ) { 640 641 if ( $offset ) { … … 819 820 $this->sql_clauses['where']['post_author__not_in'] = 'post_author NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post_author__not_in'] ) ) . ' )'; 820 821 } 821 822 822 $join = ''; 823 $join = ''; 824 $groupby = ''; 823 825 824 826 if ( $join_posts_table ) { 825 827 $join .= "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID"; -
src/wp-includes/class-wp-xmlrpc-server.php
3700 3700 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 3701 3701 do_action( 'xmlrpc_call', 'wp.editComment' ); 3702 3702 3703 $comment = array( 3704 'comment_ID' => $comment_ID, 3705 ); 3706 3703 3707 if ( isset( $content_struct['status'] ) ) { 3704 3708 $statuses = get_comment_statuses(); 3705 3709 $statuses = array_keys( $statuses ); … … 3707 3711 if ( ! in_array( $content_struct['status'], $statuses ) ) { 3708 3712 return new IXR_Error( 401, __( 'Invalid comment status.' ) ); 3709 3713 } 3710 $comment _approved= $content_struct['status'];3714 $comment['comment_approved'] = $content_struct['status']; 3711 3715 } 3712 3716 3713 3717 // Do some timestamp voodoo 3714 3718 if ( ! empty( $content_struct['date_created_gmt'] ) ) { 3715 3719 // We know this is supposed to be GMT, so we're going to slap that Z on there by force 3716 $dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z';3717 $comment _date= get_date_from_gmt( iso8601_to_datetime( $dateCreated ) );3718 $comment _date_gmt= iso8601_to_datetime( $dateCreated, 'GMT' );3720 $dateCreated = rtrim( $content_struct['date_created_gmt']->getIso(), 'Z' ) . 'Z'; 3721 $comment['comment_date'] = get_date_from_gmt( iso8601_to_datetime( $dateCreated ) ); 3722 $comment['comment_date_gmt'] = iso8601_to_datetime( $dateCreated, 'GMT' ); 3719 3723 } 3720 3724 3721 3725 if ( isset( $content_struct['content'] ) ) { 3722 $comment _content= $content_struct['content'];3726 $comment['comment_content'] = $content_struct['content']; 3723 3727 } 3724 3728 3725 3729 if ( isset( $content_struct['author'] ) ) { 3726 $comment _author= $content_struct['author'];3730 $comment['comment_author'] = $content_struct['author']; 3727 3731 } 3728 3732 3729 3733 if ( isset( $content_struct['author_url'] ) ) { 3730 $comment _author_url= $content_struct['author_url'];3734 $comment['comment_author_url'] = $content_struct['author_url']; 3731 3735 } 3732 3736 3733 3737 if ( isset( $content_struct['author_email'] ) ) { 3734 $comment _author_email= $content_struct['author_email'];3738 $comment['comment_author_email'] = $content_struct['author_email']; 3735 3739 } 3736 3740 3737 // We've got all the data -- post it:3738 $comment = compact( 'comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url' );3739 3740 3741 $result = wp_update_comment( $comment ); 3741 3742 if ( is_wp_error( $result ) ) { 3742 3743 return new IXR_Error( 500, $result->get_error_message() ); … … 5261 5262 // Only use a password if one was given. 5262 5263 if ( isset( $content_struct['wp_password'] ) ) { 5263 5264 $post_password = $content_struct['wp_password']; 5265 } else { 5266 $post_password = ''; 5264 5267 } 5265 5268 5266 5269 // Only set a post parent if one was provided. 5267 5270 if ( isset( $content_struct['wp_page_parent_id'] ) ) { 5268 5271 $post_parent = $content_struct['wp_page_parent_id']; 5272 } else { 5273 $post_parent = 0; 5269 5274 } 5270 5275 5271 5276 // Only set the menu_order if it was provided. 5272 5277 if ( isset( $content_struct['wp_page_order'] ) ) { 5273 5278 $menu_order = $content_struct['wp_page_order']; 5279 } else { 5280 $menu_order = 0; 5274 5281 } 5275 5282 5276 5283 $post_author = $user->ID; … … 5599 5606 5600 5607 $this->escape( $postdata ); 5601 5608 5602 $ID = $postdata['ID']; 5603 $post_content = $postdata['post_content']; 5604 $post_title = $postdata['post_title']; 5605 $post_excerpt = $postdata['post_excerpt']; 5606 $post_password = $postdata['post_password']; 5607 $post_parent = $postdata['post_parent']; 5608 $post_type = $postdata['post_type']; 5609 $menu_order = $postdata['menu_order']; 5609 $ID = $postdata['ID']; 5610 $post_content = $postdata['post_content']; 5611 $post_title = $postdata['post_title']; 5612 $post_excerpt = $postdata['post_excerpt']; 5613 $post_password = $postdata['post_password']; 5614 $post_parent = $postdata['post_parent']; 5615 $post_type = $postdata['post_type']; 5616 $menu_order = $postdata['menu_order']; 5617 $ping_status = $postdata['ping_status']; 5618 $comment_status = $postdata['comment_status']; 5610 5619 5611 5620 // Let WordPress manage slug if none was provided. 5612 5621 $post_name = $postdata['post_name']; -
src/wp-includes/comment.php
3094 3094 */ 3095 3095 function wp_handle_comment_submission( $comment_data ) { 3096 3096 3097 $comment_post_ID = $comment_parent = 0;3097 $comment_post_ID = $comment_parent = $user_ID = 0; 3098 3098 $comment_author = $comment_author_email = $comment_author_url = $comment_content = null; 3099 3099 3100 3100 if ( isset( $comment_data['comment_post_ID'] ) ) { -
src/wp-includes/post.php
3565 3565 $post_parent = 0; 3566 3566 } 3567 3567 3568 $new_postarr = array_merge( 3569 array( 3570 'ID' => $post_ID, 3571 ), 3572 compact( array_diff( array_keys( $defaults ), array( 'context', 'filter' ) ) ) 3573 ); 3574 3568 3575 /** 3569 3576 * Filters the post parent -- used to check for and prevent hierarchy loops. 3570 3577 * … … 3575 3582 * @param array $new_postarr Array of parsed post data. 3576 3583 * @param array $postarr Array of sanitized, but otherwise unmodified post data. 3577 3584 */ 3578 $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr );3585 $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr ); 3579 3586 3580 3587 /* 3581 3588 * If the post is being untrashed and it has a desired slug stored in post meta, -
tests/phpunit/tests/dependencies/scripts.php
866 866 * @covers ::wp_enqueue_code_editor() 867 867 */ 868 868 public function test_wp_enqueue_code_editor_when_generated_array_by_compact_will_be_passed() { 869 $file = ''; 869 870 $wp_enqueue_code_editor = wp_enqueue_code_editor( compact( 'file' ) ); 870 871 $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); 871 872