Skip to content

Commit

Permalink
Merge pull request #45 from jeremyfelt/fix/44-oembed-content
Browse files Browse the repository at this point in the history
Do not attempt to modify content if no global post is available
  • Loading branch information
jeremyfelt committed Nov 1, 2023
2 parents 926adee + fdae043 commit ab1e2ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion includes/post-type-note.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,14 @@ function prepend_reply_to_markup( string $content ): string {
return $content;
}

$current_post = get_post();
$current_post = get_post();

// We can only adjust content with context, which WordPress does not
// guarantee when filtering `the_content`.
if ( ! $current_post ) {
return $content;
}

$reply_to_markup = get_reply_to_markup( $current_post );

$content = $reply_to_markup . $content;
Expand Down

0 comments on commit ab1e2ca

Please sign in to comment.