@@ -58,7 +58,7 @@ public static function upload_images_to_wp_media_library( $image_urls, $post_id
58
58
59
59
$ uploaded_image_urls = array ();
60
60
$ total_images = count ( $ image_urls );
61
- $ successful_uploads = 0 ;
61
+ $ successful_uploads = 0 ;
62
62
63
63
try {
64
64
foreach ( $ image_urls as $ image_url ) {
@@ -168,8 +168,8 @@ public static function update_post_content_with_new_image_urls( $post_id, $url_m
168
168
return false ;
169
169
}
170
170
171
- $ content = $ post ->post_content ;
172
- $ updated = false ;
171
+ $ content = $ post ->post_content ;
172
+ $ updated = false ;
173
173
$ replaced_count = 0 ;
174
174
175
175
// Replace each original URL with the new WordPress URL
@@ -187,10 +187,12 @@ public static function update_post_content_with_new_image_urls( $post_id, $url_m
187
187
188
188
// Update the post if content changed
189
189
if ( $ updated ) {
190
- $ update_result = wp_update_post ( array (
191
- 'ID ' => $ post_id ,
192
- 'post_content ' => $ content ,
193
- ) );
190
+ $ update_result = wp_update_post (
191
+ array (
192
+ 'ID ' => $ post_id ,
193
+ 'post_content ' => $ content ,
194
+ )
195
+ );
194
196
195
197
if ( is_wp_error ( $ update_result ) ) {
196
198
return false ;
@@ -211,7 +213,7 @@ public static function update_post_content_with_new_image_urls( $post_id, $url_m
211
213
public static function get_image_processing_status ( $ post_id ) {
212
214
$ queue = \NewfoldLabs \WP \Module \Onboarding \TaskManagers \ImageSideloadTaskManager::get_queue ();
213
215
$ stats = \NewfoldLabs \WP \Module \Onboarding \TaskManagers \ImageSideloadTaskManager::get_stats ();
214
-
216
+
215
217
$ post_tasks = array ();
216
218
foreach ( $ queue as $ task ) {
217
219
if ( $ task ['post_id ' ] === $ post_id ) {
@@ -220,10 +222,10 @@ public static function get_image_processing_status( $post_id ) {
220
222
}
221
223
222
224
return array (
223
- 'post_id ' => $ post_id ,
224
- 'queue_status ' => \NewfoldLabs \WP \Module \Onboarding \TaskManagers \ImageSideloadTaskManager::get_status (),
225
- 'queue_stats ' => $ stats ,
226
- 'post_tasks ' => $ post_tasks ,
225
+ 'post_id ' => $ post_id ,
226
+ 'queue_status ' => \NewfoldLabs \WP \Module \Onboarding \TaskManagers \ImageSideloadTaskManager::get_status (),
227
+ 'queue_stats ' => $ stats ,
228
+ 'post_tasks ' => $ post_tasks ,
227
229
'post_task_count ' => count ( $ post_tasks ),
228
230
);
229
231
}
0 commit comments