plugin udpates
This commit is contained in:
@@ -156,15 +156,20 @@ function igny8_create_wordpress_post_from_task($content_data, $allowed_post_type
|
||||
}
|
||||
|
||||
if (!empty($content_data['secondary_keywords'])) {
|
||||
// Store as JSON for editing in meta box
|
||||
// Store as comma-separated for easy editing
|
||||
$keywords = is_array($content_data['secondary_keywords'])
|
||||
? $content_data['secondary_keywords']
|
||||
: json_decode($content_data['secondary_keywords'], true);
|
||||
if (is_array($keywords)) {
|
||||
$post_data['meta_input']['_igny8_secondary_keywords'] = json_encode($keywords);
|
||||
$post_data['meta_input']['_igny8_secondary_keywords'] = implode(',', $keywords);
|
||||
}
|
||||
}
|
||||
|
||||
// Store cluster name for display in meta box
|
||||
if (!empty($content_data['cluster_name'])) {
|
||||
$post_data['meta_input']['_igny8_cluster_name'] = $content_data['cluster_name'];
|
||||
}
|
||||
|
||||
// Create post
|
||||
$post_id = wp_insert_post($post_data);
|
||||
|
||||
@@ -322,8 +327,12 @@ function igny8_create_wordpress_post_from_task($content_data, $allowed_post_type
|
||||
|
||||
// Handle gallery images
|
||||
if (!empty($content_data['gallery_images'])) {
|
||||
Igny8_Logger::info("{$log_prefix} STEP: Setting gallery with " . count($content_data['gallery_images']) . " images");
|
||||
igny8_set_image_gallery($post_id, $content_data['gallery_images']);
|
||||
$gallery_count = count($content_data['gallery_images']);
|
||||
Igny8_Logger::info("{$log_prefix} STEP: Setting gallery with {$gallery_count} images");
|
||||
$gallery_ids = igny8_set_image_gallery($post_id, $content_data['gallery_images']);
|
||||
if (!empty($gallery_ids)) {
|
||||
Igny8_Logger::info("{$log_prefix} ✅ Attached {$gallery_count} gallery images (IDs: " . implode(', ', $gallery_ids) . ")");
|
||||
}
|
||||
}
|
||||
|
||||
// Get the actual WordPress post status (after creation)
|
||||
@@ -1167,7 +1176,10 @@ function igny8_import_content_images($post_id, $content_html) {
|
||||
update_post_meta($post_id, '_igny8_imported_images', $imported_images);
|
||||
update_post_meta($post_id, '_igny8_images_imported_at', current_time('mysql'));
|
||||
|
||||
error_log("IGNY8: Imported " . count($imported_images) . " content images for post {$post_id}");
|
||||
$log_prefix = "[" . get_option('igny8_site_id', 'N/A') . "-" . parse_url(site_url(), PHP_URL_HOST) . "]";
|
||||
$image_count = count($imported_images);
|
||||
Igny8_Logger::info("{$log_prefix} STEP: Imported {$image_count} in-article images");
|
||||
Igny8_Logger::info("{$log_prefix} ✅ In-article image IDs: " . implode(', ', $imported_images));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user