Skip to content

Commit

Permalink
Add filter to modify Liveblog output location
Browse files Browse the repository at this point in the history
Fixes: #525

Some users would prefer having Liveblog output at the top of their posts rather than the bottom. This filter introduces the simple functionality to choose whether the Liveblog output should be above the content or below it (default).
  • Loading branch information
alexiskulash committed Sep 26, 2018
1 parent 0120789 commit 970dd3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions liveblog.php
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,10 @@ public static function add_liveblog_to_content( $content ) {
$liveblog_output = '<div id="wpcom-liveblog-container" class="' . self::$post_id . '"></div>';

$liveblog_output = apply_filters( 'liveblog_add_to_content', $liveblog_output, $content, self::$post_id );

if ( false === apply_filters( 'liveblog_output_at_bottom', true ) ) {
return wp_kses_post( $liveblog_output ) . $content;
}

return $content . wp_kses_post( $liveblog_output );
}
Expand Down

0 comments on commit 970dd3f

Please sign in to comment.