Permalink
Browse files

Merge pull request #792 from Mte90/517

517: Add gp_translation_prepare_for_save filter
  • Loading branch information...
ocean90 committed Oct 10, 2017
2 parents 7d34a5c + 310c0e5 commit 3b39956dd0c51658b32f1f8766751601159426db
Showing with 12 additions and 0 deletions.
  1. +12 −0 gp-includes/things/translation.php
@@ -249,9 +249,21 @@ public function normalize_fields( $args ) {
public function prepare_fields_for_save( $args ) {
$args = parent::prepare_fields_for_save( $args );
/**
* Filters the translation fields before they are saved.
*
* @since 3.0.0
*
* @param array $args Translation arguments.
* @param GP_Translation $this Translation class.
*/
$args = apply_filters( 'gp_translation_prepare_for_save', $args, $this );
if ( is_array( gp_array_get( $args, 'warnings' ) ) ) {
$args['warnings'] = serialize( $args['warnings'] );
}
return $args;
}

0 comments on commit 3b39956

Please sign in to comment.