Skip to content

Commit 54fe545

Browse files
committed
fix: website card not working in Bluesky
1 parent e48befa commit 54fe545

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

assets/js/build/dashboard.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/admin/helpers/class-rop-bluesky-api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ public function create_post( $did, $post, $post_type, $hashtags, $access_token =
296296
'createdAt' => $now,
297297
);
298298

299-
if ( $post_type === 'link' ) {
299+
if ( $post_type === 'link' && isset( $post['post_url'] ) && ! empty( $post['post_url'] ) ) {
300300
$record['embed'] = array(
301301
'$type' => 'app.bsky.embed.external',
302302
'external' => array(
303-
'uri' => isset( $post['url'] ) ? $post['url'] : '',
303+
'uri' => $post['post_url'],
304304
'title' => isset( $post['title'] ) ? $post['title'] : '',
305-
'description' => isset( $post['description'] ) ? $post['description'] : '',
305+
'description' => isset( $post['content'] ) ? $post['content'] : '',
306306
),
307307
);
308308

@@ -319,7 +319,7 @@ public function create_post( $did, $post, $post_type, $hashtags, $access_token =
319319
}
320320
}
321321

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

325325
if ( false !== $image_blob ) {

0 commit comments

Comments
 (0)