Changeset 3279533
- Timestamp:
- 04/23/2025 02:28:28 AM (11 months ago)
- Location:
- ai-translate-for-polylang
- Files:
-
- 8 added
- 2 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/ai-translate-polylang.php (added)
-
tags/1.1.0/inc (added)
-
tags/1.1.0/inc/open-ai (added)
-
tags/1.1.0/inc/open-ai/OpenAi.php (added)
-
tags/1.1.0/inc/open-ai/Url.php (added)
-
tags/1.1.0/inc/settingslib.php (added)
-
tags/1.1.0/readme.txt (added)
-
trunk/ai-translate-polylang.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ai-translate-for-polylang/trunk/ai-translate-polylang.php
r3150049 r3279533 4 4 Plugin URI: https://wordpress.org/plugins/ai-translate-polylang/ 5 5 Description: Add auto AI translation caperbility to Polylang 6 Version: 1. 0.96 Version: 1.1.0 7 7 Author: James Low 8 8 Author URI: http://jameslow.com … … 194 194 // Create a new post with the same content 195 195 $new_post_id = wp_insert_post([ 196 'post_title' => self::translate($post->post_title, $to, $from), 197 'post_content' => self::translate($post->post_content, $to, $from), 198 'post_excerpt' => self::translate($post->post_excerpt, $to, $from), 199 'post_status' => $status, 196 'post_status' => 'draft', 200 197 'post_type' => $post->post_type, 201 198 'post_author' => $post->post_author, //Wordpress overrides author to 0, hence hook … … 206 203 ]); 207 204 208 // Set the language for the new post 205 // Set the language for the new post first in case something goes wrong 209 206 pll_set_post_language($new_post_id, $to); 207 208 wp_update_post(array( 209 'ID' => $new_post_id, 210 'post_title' => self::translate($post->post_title, $to, $from), 211 'post_content' => self::translate($post->post_content, $to, $from), 212 'post_excerpt' => self::translate($post->post_excerpt, $to, $from), 213 'post_status' => $status 214 )); 210 215 211 216 // Duplicate post meta -
ai-translate-for-polylang/trunk/readme.txt
r3150049 r3279533 5 5 Requires at least: 3.0 6 6 Tested up to: 6.6.1 7 Stable tag: 1. 0.97 Stable tag: 1.1.0 8 8 License: MIT 9 9 License URI: https://opensource.org/licenses/MIT … … 33 33 34 34 == Changelog == 35 36 = 1.1.0 = 37 * Set post language on new post before trying to tranlsate 35 38 36 39 = 1.0.9 =
Note: See TracChangeset
for help on using the changeset viewer.