Changeset 3492289
- Timestamp:
- 03/27/2026 03:40:00 AM (6 days ago)
- Location:
- aiktp/trunk
- Files:
-
- 3 edited
-
aiktp.php (modified) (2 diffs)
-
includes/aiktp-sync.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
aiktp/trunk/aiktp.php
r3445251 r3492289 4 4 * Plugin URI: https://aiktp.com/wordpress 5 5 * Description: AIKTP - AI powered WordPress content automation. Create SEO optimized articles, bulk generate WooCommerce product descriptions, and sync posts directly from aiktp.com. 6 * Version: 5.0. 56 * Version: 5.0.6 7 7 * Author: John Luke - aiktp.com 8 8 * License: GPL v2 or later … … 22 22 23 23 // Define constants 24 define('AIKTPZ_VERSION', '5.0. 5');24 define('AIKTPZ_VERSION', '5.0.6'); 25 25 define('AIKTPZ_PLUGIN_DIR', plugin_dir_path(__FILE__)); 26 26 define('AIKTPZ_PLUGIN_URL', plugin_dir_url(__FILE__)); -
aiktp/trunk/includes/aiktp-sync.php
r3445248 r3492289 606 606 $cat_id = $request['catId'] ? $request['catId'] : '0'; 607 607 $post_status = $request['post_status'] ? $request['post_status'] : 'publish'; 608 $current_post_id = !empty($request['currentPostId']) ? absint($request['currentPostId']) : 0; 608 609 609 610 // Get author … … 664 665 $final_categories = $is_woo_product ? $product_categories : $regular_categories; 665 666 667 $post_date = current_time('mysql'); 668 $post_date_gmt = current_time('mysql', 1); 669 if (!empty($request['postTime'])) { 670 $post_time = strtotime($request['postTime']); 671 if ($post_time) { 672 $post_date = date('Y-m-d H:i:s', $post_time); 673 $post_date_gmt = gmdate('Y-m-d H:i:s', $post_time); 674 } 675 } 676 666 677 // Build post data 667 678 $new_post = array( … … 672 683 'post_author' => $aiktp_author, 673 684 'post_type' => $post_type, 674 'post_date' => current_time('mysql'),675 'post_date_gmt' => current_time('mysql', 1)685 'post_date' => $post_date, 686 'post_date_gmt' => $post_date_gmt 676 687 ); 677 688 … … 682 693 683 694 kses_remove_filters(); 684 $post_id = wp_insert_post($new_post); 695 if (empty($current_post_id)) { 696 $post_id = wp_insert_post($new_post); 697 } else { 698 $new_post['ID'] = $current_post_id; 699 700 try { 701 unset($new_post['post_date']); 702 unset($new_post['post_date_gmt']); 703 $new_post['post_modified'] = $post_date; 704 $new_post['post_modified_gmt'] = $post_date_gmt; 705 $post_id = wp_update_post($new_post); 706 707 if (empty($post_id)) { 708 unset($new_post['ID']); 709 $new_post['post_date'] = $post_date; 710 $new_post['post_date_gmt'] = $post_date_gmt; 711 $post_id = wp_insert_post($new_post); 712 } 713 } catch (Exception $e) { 714 unset($new_post['ID']); 715 $new_post['post_date'] = $post_date; 716 $new_post['post_date_gmt'] = $post_date_gmt; 717 $post_id = wp_insert_post($new_post); 718 } 719 } 685 720 kses_init_filters(); 686 721 -
aiktp/trunk/readme.txt
r3445251 r3492289 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.0 7 Stable tag: 5.0. 57 Stable tag: 5.0.6 8 8 License: GPL v2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.