Changeset 2818386
- Timestamp:
- 11/15/2022 03:34:28 PM (3 years ago)
- Location:
- easytranslate/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (1 diff)
-
admin/class-easy-translate-translation-list.php (modified) (4 diffs)
-
admin/class-easy-translate-translation.php (modified) (2 diffs)
-
easy-translate.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easytranslate/trunk/README.txt
r2801060 r2818386 4 4 Tags: translation, wpml, easytranslate, multilingual, translate 5 5 Requires at least: 4.7 6 Tested up to: 6. 07 Stable tag: 4.1 06 Tested up to: 6.1 7 Stable tag: 4.11 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
easytranslate/trunk/admin/class-easy-translate-translation-list.php
r2801060 r2818386 310 310 * @param array $langs 311 311 * @param int $status 312 * @throws Exception 312 313 */ 313 314 public static function update_duplicate_status(array $ids, array $langs, int $status) … … 340 341 protected static function duplicate_post($post_id, $lang) 341 342 { 343 /** @var SitePress $sitepress */ 342 344 global $sitepress; 343 345 … … 461 463 array $yoast_seo = [] 462 464 ) { 463 $update = '';465 $update = []; 464 466 if ($post_title) { 465 $update .= ', post_title="' . esc_sql($post_title) . '"'; 467 $update[] = 'post_title="' . esc_sql($post_title) . '"'; 468 } 469 if ($post_content) { 470 $update[] = 'post_content="' . esc_sql($post_content) . '"'; 466 471 } 467 472 if ($post_excerpt) { 468 $update .= ',post_excerpt="' . esc_sql($post_excerpt) . '"';469 } 470 471 global $wpdb; 472 $post_content = esc_sql($post_content);473 $query = "UPDATE {$wpdb->prefix}posts SET post_content = '{$post_content}'{$update} WHERE id = {$post_id}";473 $update[] = 'post_excerpt="' . esc_sql($post_excerpt) . '"'; 474 } 475 $update = implode(', ', $update); 476 477 global $wpdb; 478 $query = "UPDATE {$wpdb->prefix}posts SET {$update} WHERE id = {$post_id}"; 474 479 $wpdb->query($query); 475 480 … … 650 655 $a_string_id[] = $string['id']; 651 656 } 652 if ($post->post_title) { 653 $content['post_strings'][$post_id]['title'] = $post->post_title; 654 } 655 } elseif ($post) { 656 if ($post->post_content) { 657 } 658 if ($post) { 659 if ($post->post_content && !$package_id) { 657 660 $content['post_full'][$post_id]['content'] = $post->post_content; 658 661 } -
easytranslate/trunk/admin/class-easy-translate-translation.php
r2795813 r2818386 28 28 29 29 foreach ($content as $item) { 30 $handler = key($item) . '_handler'; 31 $this->$handler(current($item), $target_language); 30 foreach ($item as $handlerName => $translations) { 31 $handler = "{$handlerName}_handler"; 32 $this->$handler($translations, $target_language); 33 } 32 34 } 33 35 } … … 45 47 protected function post_strings_handler($content, $target_language) 46 48 { 47 if (isset(current($content)['title']) && current($content)['title']) {48 if ($source_translations = Easy_Translate_Post_Translation_List::get_translations_by_element_id(key($content))) {49 $translations = Easy_Translate_Post_Translation_List::get_translations_by_source(50 $source_translations,51 $target_language52 );53 if ($translations) {54 Easy_Translate_Post_Translation_List::update_post_title(55 $translations['element_id'],56 current($content)['title']57 );58 }59 }60 }61 62 49 $this->strings_handler(current($content)['content'], $target_language); 63 50 } -
easytranslate/trunk/easy-translate.php
r2801060 r2818386 15 15 * Plugin URI: https://www.easytranslate.com/en/integrations/cms/wordpress-plugin/ 16 16 * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. 17 * Version: 1.9. 117 * Version: 1.9.2 18 18 * Author: EasyTranslate 19 19 * Author URI: https://easytranslate.com … … 34 34 * Rename this for your plugin and update it as you release new versions. 35 35 */ 36 define('EASY_TRANSLATE_VERSION', '1.9. 1');36 define('EASY_TRANSLATE_VERSION', '1.9.2'); 37 37 38 38 /**
Note: See TracChangeset
for help on using the changeset viewer.