Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reblog title #300

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading