Skip to content

Included post link when sharing as image#1078

Open
girishpanchal30 wants to merge 2 commits intodevelopmentfrom
bugfix/pro/633
Open

Included post link when sharing as image#1078
girishpanchal30 wants to merge 2 commits intodevelopmentfrom
bugfix/pro/633

Conversation

@girishpanchal30
Copy link
Copy Markdown
Contributor

Summary

Include the post link when Include Link and Share As Image Post options are enabled while sharing the post on Bluesky.

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/tweet-old-post-pro/issues/633

@girishpanchal30 girishpanchal30 requested a review from Copilot April 8, 2026 06:52
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Apr 8, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Apr 8, 2026
@pirate-bot
Copy link
Copy Markdown
Contributor

pirate-bot commented Apr 8, 2026

Plugin build for 094707f is ready 🛎️!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Bluesky sharing payload so that when a post is shared “as image” and a post link is available, the share includes a link-style embed using the uploaded image as the card thumbnail.

Changes:

  • For post_type === 'image', switches to an app.bsky.embed.external embed (with thumb) when post_url is present, otherwise keeps app.bsky.embed.images.
  • Removes thumbnail-blob upload/attachment for post_type === 'link' external embeds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 306 to 315
if ( $post_type === 'link' && isset( $post['post_url'] ) && ! empty( $post['post_url'] ) ) {
$record['embed'] = array(
'$type' => 'app.bsky.embed.external',
'external' => array(
'uri' => $post['post_url'],
'title' => isset( $post['title'] ) ? $post['title'] : '',
'description' => isset( $post['content'] ) ? $post['content'] : '',
),
);

if (
isset( $post['post_image'], $post['mimetype'] ) &&
! empty( $post['post_image'] ) &&
! empty( $post['mimetype'] )
) {
$image_blob = $this->upload_blob( $access_token, $post['post_image'], $post['mimetype']['type'] );

if ( false !== $image_blob ) {
$record['embed']['external']['thumb'] = $image_blob;
}
}
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link-post embed no longer attaches an uploaded thumbnail when post_image/mimetype are present. Previously this code uploaded the image blob and set embed.external.thumb; after this change, link posts will always send an app.bsky.embed.external without thumb. If that thumbnail support is still desired, restore it (or fetch/upload a thumb via a shared helper) so link shares keep their preview image.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants