File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -715,7 +715,7 @@ function wprss_items_insert_post( $items, $feed_ID ) {
715
715
}
716
716
717
717
// Create and insert post object into the DB
718
- $ inserted_ID = wp_insert_post ( $ feed_item );
718
+ $ inserted_ID = wp_insert_post ( $ feed_item, true );
719
719
720
720
if ( !is_wp_error ( $ inserted_ID ) ) {
721
721
@@ -749,9 +749,13 @@ function wprss_items_insert_post( $items, $feed_ID ) {
749
749
]);
750
750
}
751
751
else {
752
- update_post_meta ( $ feed_ID , 'wprss_error_last_import ' , 'An error occurred while inserting a feed item into the database. ' );
752
+ $ message = sprintf (
753
+ __ ('Failed to save a feed item: %s ' , 'wprss ' ),
754
+ $ inserted_ID ->get_error_message ()
755
+ );
753
756
754
- $ logger ->error ('Failed to save item "{0}" into the database ' , [$ item ->get_title ()]);
757
+ update_post_meta ($ feed_ID , 'wprss_error_last_import ' , $ message );
758
+ $ logger ->error ($ message );
755
759
}
756
760
}
757
761
// If the item is TRUE, then a hook function in the filter inserted the item.
You can’t perform that action at this time.
0 commit comments