Changeset 12205 for sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.php
- Timestamp:
- 11/04/2022 11:01:38 AM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
includes/class-gp-translation-helpers.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers
- Property svn:ignore
-
old new 10 10 phpunit.xml.dist 11 11 tests 12 bin
-
- Property svn:ignore
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/includes/class-gp-translation-helpers.php
r12063 r12205 81 81 'gp_tmpl_load_locations', 82 82 function( $locations, $template, $args, $template_path ) { 83 if ( 'translation-row-editor-meta-status' === $template || 'locale-projects' === $template) {83 if ( 'translation-row-editor-meta-status' === $template ) { 84 84 array_unshift( $locations, dirname( dirname( __FILE__ ) ) . '/templates/gp-templates-overrides/' ); 85 85 } else { … … 413 413 $helper_discussion = new Helper_Translation_Discussion(); 414 414 $locale_slug = $helper_discussion->sanitize_comment_locale( sanitize_text_field( $_POST['data']['locale_slug'] ) ); 415 $translation_status = $helper_discussion->sanitize_translation_status( sanitize_text_field( $_POST['data']['translation_status'] ) ); 415 416 $translation_id_array = ! empty( $_POST['data']['translation_id'] ) ? array_map( array( $helper_discussion, 'sanitize_translation_id' ), $_POST['data']['translation_id'] ) : null; 416 417 $original_id_array = ! empty( $_POST['data']['original_id'] ) ? array_map( array( $helper_discussion, 'sanitize_original_id' ), $_POST['data']['original_id'] ) : null; … … 443 444 444 445 // Post comment on discussion page for the first string 445 $first_comment_id = $this->insert_comment( $comment, $first_original_id, $comment_reason, $first_translation_id, $locale_slug, $_SERVER );446 $first_comment_id = $this->insert_comment( $comment, $first_original_id, $comment_reason, $first_translation_id, $locale_slug, $_SERVER, $translation_status ); 446 447 447 448 if ( ! empty( $original_id_array ) && ! empty( $translation_id_array ) ) { … … 449 450 $comment = get_comment_link( $first_comment_id ); 450 451 foreach ( $original_id_array as $index => $single_original_id ) { 451 $comment_id = $this->insert_comment( $comment, $single_original_id, $comment_reason, $translation_id_array[ $index ], $locale_slug, $_SERVER );452 $comment_id = $this->insert_comment( $comment, $single_original_id, $comment_reason, $translation_id_array[ $index ], $locale_slug, $_SERVER, $translation_status ); 452 453 $comment = get_comment( $comment_id ); 453 454 GP_Notifications::add_related_comment( $comment ); … … 507 508 * @since 0.0.2 508 509 */ 509 private function insert_comment( $comment, $original_id, $reason, $translation_id, $locale_slug, $server ) {510 private function insert_comment( $comment, $original_id, $reason, $translation_id, $locale_slug, $server, $translation_status ) { 510 511 $post_id = Helper_Translation_Discussion::get_or_create_shadow_post_id( $original_id ); 511 512 $user = wp_get_current_user(); … … 521 522 'user_id' => $user->ID, 522 523 'comment_meta' => array( 523 'reject_reason' => $reason, 524 'translation_id' => $translation_id, 525 'locale' => $locale_slug, 524 'reject_reason' => $reason, 525 'translation_id' => $translation_id, 526 'locale' => $locale_slug, 527 'translation_status' => $translation_status, 526 528 ), 527 529 )
Note: See TracChangeset
for help on using the changeset viewer.