Skip to content

Commit

Permalink
refactor: use post permalink from postobject
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbrink authored Jan 15, 2025
1 parent 66cde21 commit 80d4b92
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion source/php/Module/Posts/Helper/GetPosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ private function getPostsFromSelectedSites(array $fields, int $page):array {

array_walk($postsFromSite, function($post) use ($site) {
// Add the original permalink to the post object for reference in network sources.
$post->originalPermalink = $this->wpService->getPermalink($post->ID);
$post->originalSite = $site['label'];
$post->originalBlogId = (int)$site['value'];
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function prepare(array $postData)
if ($post->getPostType() === 'attachment') {
$link = wp_get_attachment_url($post->getId());
} else {
$link = $post->originalPermalink ?? $post->getPermalink();
$link = $post->getPermalink();
}

$listItem = [
Expand Down

0 comments on commit 80d4b92

Please sign in to comment.