Skip to content

Commit

Permalink
feat: actually fix broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimds committed Dec 14, 2023
1 parent 780f438 commit 1410caf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/app/themes/awasqa/src/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -1277,12 +1277,17 @@ function fix_links()
$new_path .= "?lang=$lang";
}
}
echo "Replacing $url with $new_path\n";
echo "Replacing in {$post->ID}: $url with $new_path\n";
$found = @file_get_contents($new_path);
if (!$found) {
echo "MISSING PAGE $url $new_path\n";
//exit(1);
}
$content = str_replace($url, $new_path, $content);
wp_update_post([
"ID" => $post->ID,
"post_content" => $content
]);
}
}
}
Expand Down

0 comments on commit 1410caf

Please sign in to comment.