Skip to content

Commit 25195f6

Browse files
committed
Fix failing phpunit test
1 parent 9c97be9 commit 25195f6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

classes/update/class-update-190.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ private function migrate_recommendations_slugs() {
6060
'name' => \progress_planner()->get_suggested_tasks()->get_task_id_from_slug( $prpl_task_id ),
6161
]
6262
);
63-
if ( ! empty( $existing_posts ) ) {
64-
// Delete the existing post.
63+
if ( ! empty( $existing_posts ) && $existing_posts[0]->ID !== $recommendation->ID ) {
64+
// Delete the existing post (but not if it's the current one).
6565
\wp_delete_post( $existing_posts[0]->ID, true );
6666
}
6767

0 commit comments

Comments
 (0)