Changeset 3321004
- Timestamp:
- 07/02/2025 07:51:30 AM (9 months ago)
- Location:
- easytranslate
- Files:
-
- 4 edited
- 19 copied
-
tags/v5.5/trunk (copied) (copied from easytranslate/trunk)
-
tags/v5.5/trunk/README.txt (copied) (copied from easytranslate/trunk/README.txt) (1 diff)
-
tags/v5.5/trunk/admin/class-easy-translate-admin.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-admin.php)
-
tags/v5.5/trunk/admin/class-easy-translate-api-integration.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-api-integration.php)
-
tags/v5.5/trunk/admin/class-easy-translate-api-laas.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-api-laas.php)
-
tags/v5.5/trunk/admin/class-easy-translate-api-service.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-api-service.php)
-
tags/v5.5/trunk/admin/class-easy-translate-post-translation-list.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-post-translation-list.php)
-
tags/v5.5/trunk/admin/class-easy-translate-projects.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-projects.php)
-
tags/v5.5/trunk/admin/class-easy-translate-string-translation-list.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-string-translation-list.php)
-
tags/v5.5/trunk/admin/class-easy-translate-translation-list.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-translation-list.php) (4 diffs)
-
tags/v5.5/trunk/admin/class-easy-translate-translation-updater.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-translation-updater.php)
-
tags/v5.5/trunk/admin/class-easy-translate-translation.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-translation.php) (3 diffs)
-
tags/v5.5/trunk/admin/functions.php (copied) (copied from easytranslate/trunk/admin/functions.php)
-
tags/v5.5/trunk/admin/js/easy-translate-admin.js (copied) (copied from easytranslate/trunk/admin/js/easy-translate-admin.js)
-
tags/v5.5/trunk/admin/partials/projects.php (copied) (copied from easytranslate/trunk/admin/partials/projects.php)
-
tags/v5.5/trunk/admin/partials/requirements.php (copied) (copied from easytranslate/trunk/admin/partials/requirements.php)
-
tags/v5.5/trunk/admin/partials/translation-options.php (copied) (copied from easytranslate/trunk/admin/partials/translation-options.php)
-
tags/v5.5/trunk/easy-translate.php (copied) (copied from easytranslate/trunk/easy-translate.php) (2 diffs)
-
tags/v5.5/trunk/includes/class-easy-translate.php (copied) (copied from easytranslate/trunk/includes/class-easy-translate.php)
-
trunk/README.txt (modified) (1 diff)
-
trunk/admin/class-easy-translate-translation-list.php (modified) (4 diffs)
-
trunk/admin/class-easy-translate-translation.php (modified) (3 diffs)
-
trunk/easy-translate.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easytranslate/tags/v5.5/trunk/README.txt
r3293830 r3321004 5 5 Requires at least: 4.7 6 6 Tested up to: 6.8 7 Stable tag: 5. 47 Stable tag: 5.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
easytranslate/tags/v5.5/trunk/admin/class-easy-translate-translation-list.php
r3281341 r3321004 321 321 if ($translations = self::get_translations_by_source($source_translations, $lang)) { 322 322 self::update_translations_status($translations['translation_id'], $status); 323 update_post_meta($translations['element_id'], '_icl_lang_duplicate_of', $post_id); 323 324 } else { 324 325 self::duplicate_post($post_id, $lang); … … 497 498 498 499 delete_post_meta($post_id, '_icl_lang_duplicate_of', $source_post_id); 500 self::delete_translation_job($post_id, $target_language); 499 501 } 500 502 … … 556 558 557 559 /** 558 * Updates post title.559 *560 * @param $post_id561 * @param $post_title562 * @return bool|int563 */564 public static function update_post_title($post_id, $post_title)565 {566 567 global $wpdb;568 $post_title = esc_sql($post_title);569 $post_id = intval($post_id);570 $query = "UPDATE {$wpdb->prefix}posts SET post_title = '{$post_title}' WHERE id = {$post_id}";571 572 return $wpdb->query($query);573 574 }575 576 /**577 560 * Update translations status. 578 561 * … … 589 572 ['%d'] 590 573 ); 574 } 575 576 public static function delete_translation_job($post_id, $target_language) 577 { 578 global $wpdb; 579 580 $job_id = $wpdb->get_row("select 581 translate_job.job_id 582 from wp_icl_translations translations 583 JOIN wp_icl_translation_status translation_status 584 ON translations.translation_id = translation_status.translation_id 585 JOIN wp_icl_translate_job translate_job 586 ON translate_job.rid = translation_status.rid AND translate_job.revision IS NULL 587 where translations.element_id = '$post_id' 588 AND translations.language_code = '$target_language'", ARRAY_A); 589 590 if (!empty($job_id)) { 591 $wpdb->delete("{$wpdb->prefix}icl_translate_job", $job_id); 592 } 591 593 } 592 594 -
easytranslate/tags/v5.5/trunk/admin/class-easy-translate-translation.php
r3247676 r3321004 9 9 class Easy_Translate_Translation 10 10 { 11 12 11 /** 13 12 * Translation status. … … 26 25 $target_language = get_wpml_target_language_code($task['attributes']['target_language']); 27 26 $content = $this->fetch_content($task); 27 28 28 foreach ($content as $item) { 29 29 foreach ($item as $handlerName => $translations) { … … 135 135 136 136 } 137 138 137 } -
easytranslate/tags/v5.5/trunk/easy-translate.php
r3310264 r3321004 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: 2. 0.417 * Version: 2.1.0 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', '2. 0.4');36 define('EASY_TRANSLATE_VERSION', '2.1.0'); 37 37 38 38 /** -
easytranslate/trunk/README.txt
r3293830 r3321004 5 5 Requires at least: 4.7 6 6 Tested up to: 6.8 7 Stable tag: 5. 47 Stable tag: 5.5 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
r3281341 r3321004 321 321 if ($translations = self::get_translations_by_source($source_translations, $lang)) { 322 322 self::update_translations_status($translations['translation_id'], $status); 323 update_post_meta($translations['element_id'], '_icl_lang_duplicate_of', $post_id); 323 324 } else { 324 325 self::duplicate_post($post_id, $lang); … … 497 498 498 499 delete_post_meta($post_id, '_icl_lang_duplicate_of', $source_post_id); 500 self::delete_translation_job($post_id, $target_language); 499 501 } 500 502 … … 556 558 557 559 /** 558 * Updates post title.559 *560 * @param $post_id561 * @param $post_title562 * @return bool|int563 */564 public static function update_post_title($post_id, $post_title)565 {566 567 global $wpdb;568 $post_title = esc_sql($post_title);569 $post_id = intval($post_id);570 $query = "UPDATE {$wpdb->prefix}posts SET post_title = '{$post_title}' WHERE id = {$post_id}";571 572 return $wpdb->query($query);573 574 }575 576 /**577 560 * Update translations status. 578 561 * … … 589 572 ['%d'] 590 573 ); 574 } 575 576 public static function delete_translation_job($post_id, $target_language) 577 { 578 global $wpdb; 579 580 $job_id = $wpdb->get_row("select 581 translate_job.job_id 582 from wp_icl_translations translations 583 JOIN wp_icl_translation_status translation_status 584 ON translations.translation_id = translation_status.translation_id 585 JOIN wp_icl_translate_job translate_job 586 ON translate_job.rid = translation_status.rid AND translate_job.revision IS NULL 587 where translations.element_id = '$post_id' 588 AND translations.language_code = '$target_language'", ARRAY_A); 589 590 if (!empty($job_id)) { 591 $wpdb->delete("{$wpdb->prefix}icl_translate_job", $job_id); 592 } 591 593 } 592 594 -
easytranslate/trunk/admin/class-easy-translate-translation.php
r3247676 r3321004 9 9 class Easy_Translate_Translation 10 10 { 11 12 11 /** 13 12 * Translation status. … … 26 25 $target_language = get_wpml_target_language_code($task['attributes']['target_language']); 27 26 $content = $this->fetch_content($task); 27 28 28 foreach ($content as $item) { 29 29 foreach ($item as $handlerName => $translations) { … … 135 135 136 136 } 137 138 137 } -
easytranslate/trunk/easy-translate.php
r3310264 r3321004 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: 2. 0.417 * Version: 2.1.0 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', '2. 0.4');36 define('EASY_TRANSLATE_VERSION', '2.1.0'); 37 37 38 38 /**
Note: See TracChangeset
for help on using the changeset viewer.