- Timestamp:
- 09/16/2022 10:15:08 AM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
helpers/helper-translation-discussion.php (modified) (2 diffs)
-
templates/discussions-dashboard.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
- Property svn:ignore
-
old new 8 8 .eslintrc.json 9 9 tmp 10 phpunit.xml.dist 11 tests
-
- Property svn:ignore
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/helpers/helper-translation-discussion.php
r12063 r12071 559 559 'translation_id' => isset( $this->data['translation_id'] ) ? $this->data['translation_id'] : null, 560 560 'locale_slug' => $this->data['locale_slug'], 561 'original_permalink' => $this->data['original_permalink'], 561 562 'original_id' => $this->data['original_id'], 562 563 'project' => $this->data['project'], … … 672 673 * @param string $link The link. 673 674 * @param array $args The arguments. 674 * @param string$comment The comment.675 * @param object $comment The comment. 675 676 * @param WP_Post $post The post. 676 677 * -
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/templates/discussions-dashboard.php
r12063 r12071 49 49 } 50 50 51 52 51 $comments_by_post_id[ $_comment->comment_post_ID ][] = $_comment; 53 52 … … 60 59 61 60 // If the referenced comment is not in the current batch of comments we need to re-add it. 62 foreach ( $bulk_comments as $original_id => $_post_id ) { 63 if ( ! isset( $comments_by_post_id[ $_comment->comment_post_ID ] ) ) { 64 $linked_comment = $_comment->comment_content; 65 $parts = wp_parse_url( $linked_comment ); 66 $comment_id = intval( str_replace( 'comment-', '', $parts['fragment'] ) ); 67 if ( $comment_id ) { 68 $comments_by_post_id[ $_comment->comment_post_ID ][] = get_comment( $comment_id ); 61 foreach ( $bulk_comments as $original_id => $_comments ) { 62 foreach ( $_comments as $_comment ) { 63 if ( ! isset( $comments_by_post_id[ $_comment->comment_post_ID ] ) ) { 64 $linked_comment = $_comment->comment_content; 65 $parts = wp_parse_url( $linked_comment ); 66 $comment_id = intval( str_replace( 'comment-', '', $parts['fragment'] ) ); 67 if ( $comment_id ) { 68 $comments_by_post_id[ $_comment->comment_post_ID ][] = get_comment( $comment_id ); 69 if ( ! isset( $latest_comment_date_by_post_id[ $_comment->comment_post_ID ] ) ) { 70 $latest_comment_date_by_post_id[ $_comment->comment_post_ID ] = $_comment->comment_date; 71 } 72 } 69 73 } 70 74 } 71 75 } 72 76 73 u asort(77 uksort( 74 78 $comments_by_post_id, 75 79 function( $a, $b ) use ( $latest_comment_date_by_post_id ) { 76 return $latest_comment_date_by_post_id[ $b ->comment_post_ID ] <=> $latest_comment_date_by_post_id[ $a->comment_post_ID];80 return $latest_comment_date_by_post_id[ $b ] <=> $latest_comment_date_by_post_id[ $a ]; 77 81 } 78 82 );
Note: See TracChangeset
for help on using the changeset viewer.