Skip to content

Commit

Permalink
Fix reblog title (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk authored Mar 21, 2024
1 parent 6f9df2c commit 1eb1864
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions includes/class-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,27 @@ public static function reblog( $ret, $post ) {
'<a href="' . esc_url( $post->guid ) . '">' . esc_html( $author ) . '</a>'
);

$reblog_title = sprintf(
// translators: %1$s is the author, %2$s is the post title.
__( 'Reblog of %1$s: %2$s', 'friends' ),
$author,
$post->post_title
);

$reblog .= PHP_EOL . '</p>' . PHP_EOL . '<!-- /wp:paragraph -->' . PHP_EOL;

// Wrap the post content in a quote block.
$reblog .= '<!-- wp:quote -->' . PHP_EOL . '<blockquote class="wp-block-quote">';
$reblog .= $post->post_content;
$reblog .= '</blockquote>' . PHP_EOL . '<!-- /wp:quote -->';

$new_post = array(
'post_title' => $post->title,
'post_title' => $reblog_title,
'post_author' => get_current_user_id(),
'post_status' => 'publish',
'post_type' => 'post',
'post_format' => get_post_format( $post ),
'post_content' => $reblog . $post->post_content,
'post_content' => $reblog,
);
/**
* Allows changing a reblog post before it gets posted.
Expand Down

0 comments on commit 1eb1864

Please sign in to comment.