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

Restore unification of multi-page post content in Reader mode #4547

Merged
merged 3 commits into from
Apr 9, 2020
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
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 ) );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this did not need the post_password_required() check before because get_the_content() has that logic inside of it.

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