Skip to content

Included post link when sharing as image#1078

Merged
vytisbulkevicius merged 3 commits into
developmentfrom
bugfix/pro/633
May 21, 2026
Merged

Included post link when sharing as image#1078
vytisbulkevicius merged 3 commits into
developmentfrom
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

pirate-bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Plugin build for d1627cb is ready 🛎️!

Copilot AI left a comment

Copy link
Copy Markdown

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;
}
}
}

Copilot AI Apr 8, 2026

Copy link

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.
Comment thread includes/admin/helpers/class-rop-bluesky-api.php Outdated
@vytisbulkevicius
vytisbulkevicius merged commit cb949ba into development May 21, 2026
8 checks passed
@pirate-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 9.3.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label May 21, 2026
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. released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants