diff --git a/readme.txt b/readme.txt index c573bd7..537dd84 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: translation, api, I18N Donate link: https://eurotext-ecommerce.com Requires at least: 4.6 Tested up to: 5.5.3 -Stable tag: 1.3.2 +Stable tag: 1.3.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -118,6 +118,14 @@ Just send an email to info@eurotext.de with a request. 3. project view == Changelog == += 1.3.4 = +* Fix bugs with ACF fields + += 1.3.3 = +* Fix “Bulk Translate” action for custom post types +* Fix WP VIP warning about content filtering +* Fix bugs with ACF fields + = 1.3.2 = * Fix missing libraries from vendor folder diff --git a/src/Module/ACF/Processor/OutgoingMetaProcessor.php b/src/Module/ACF/Processor/OutgoingMetaProcessor.php index e53ff1f..aae337c 100644 --- a/src/Module/ACF/Processor/OutgoingMetaProcessor.php +++ b/src/Module/ACF/Processor/OutgoingMetaProcessor.php @@ -54,7 +54,8 @@ public function processOutgoing(Translation $translation) $fields = get_field_objects($sourcePostId); $acfFields = $this->addACFFieldKeys($fields, [], $sourcePostId); - $toNotTranslate = $acfFields['to-not-translate']; + + $toNotTranslate = $acfFields['to-not-translate'] ?? []; unset($acfFields['to-not-translate']); if (!empty($acfFields)) { $translation->set_value(Integrator::ACF_FIELDS, $acfFields, self::_NAMESPACE); @@ -96,19 +97,19 @@ protected function addACFFieldKeys(array $fields, array $keys, $postID) $foundKeys = $this->recursivelyFindLayoutFieldKeys($field['value'], $field['name'], $postID); foreach ($foundKeys as $key => $value) { $fieldType = $this->getFieldTypeByKey($key, $postID); - //var_dump($fieldType, $key); if ($fieldType === self::FIELD_TYPE_REPEATER && !empty($value)) { $keys['to-not-translate'][$key] = count($value); continue; } - if ($fieldType === self::FIELD_TYPE_GROUP) { + if ($fieldType === self::FIELD_TYPE_GROUP || $fieldType === self::FIELD_TYPE_FLEXIBLE) { continue; } $keys[$key] = $value; } if ($field['type'] === self::FIELD_TYPE_FLEXIBLE) { + $layoutArr = []; foreach ($field['value'] as $value) { if (isset($value['acf_fc_layout'])) { $layoutArr[] = $value['acf_fc_layout']; diff --git a/translationmanager.php b/translationmanager.php index d3ee216..fc207af 100644 --- a/translationmanager.php +++ b/translationmanager.php @@ -3,7 +3,7 @@ * Plugin Name: translationMANAGER * Plugin URI: https://eurotext.de/en * Description: Translate your content from a WordPress Multisite and MultilingualPress. - * Version: 1.3.2 + * Version: 1.3.4 * Author: Inpsyde * Author URI: https://inpsyde.com/ * Text Domain: translationmanager