Skip to content

Commit

Permalink
Restore unification of multi-page post content in Reader mode (#4547)
Browse files Browse the repository at this point in the history
* Restore unification of multi-page post content in Reader mode

* Combine comments

Co-Authored-By: Alain Schlesser <alain.schlesser@gmail.com>

* Fix Squiz.WhiteSpace.SuperfluousWhitespace.EndLine

Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
  • Loading branch information
westonruter and schlessera committed Apr 9, 2020
1 parent 5856b82 commit 73db741
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions includes/templates/class-amp-post-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,17 @@ private function build_post_comments_data() {
* Build post content.
*/
private function build_post_content() {
/** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', get_the_content( null, false, $this->post ) );
if ( post_password_required( $this->post ) ) {
$content = get_the_password_form( $this->post );
} else {
/**
* This filter is documented in wp-includes/post-template.php.
*
* Note: This is intentionally not using get_the_content() because the legacy behavior of posts in
* Reader mode is to display multi-page posts as a single page without any pagination links.
*/
$content = apply_filters( 'the_content', $this->post->post_content );
}

$this->add_data_by_key( 'post_amp_content', $content );
}
Expand Down

0 comments on commit 73db741

Please sign in to comment.