Skip to content

Instantly share code, notes, and snippets.

@gedex
Created September 20, 2016 17:24
Show Gist options
  • Save gedex/e9b01fe5450827568ae0ff679b8d9a52 to your computer and use it in GitHub Desktop.
Save gedex/e9b01fe5450827568ae0ff679b8d9a52 to your computer and use it in GitHub Desktop.
diff --git a/gp-includes/things/translation.php b/gp-includes/things/translation.php
index 5beed6a..e90a9b6 100644
--- a/gp-includes/things/translation.php
+++ b/gp-includes/things/translation.php
@@ -491,8 +491,14 @@ class GP_Translation extends GP_Thing {
} else {
$updated = $this->save( array( 'user_id_last_modified' => get_current_user_id(), 'status' => $status ) );
}
+ $old_status = $this->status;
+
+ if ( 'current' === $status ) {
+ $updated = $this->set_as_current();
+ }
if ( $updated ) {
+ do_action( 'gp_translation_status_updated', $this, $old_status );
gp_clean_translation_set_cache( $this->translation_set_id );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment