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

Second attempt at fixing #29484 #42059

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

carlomanf
Copy link

What?

Fixes #29484

Why?

The previous patch, #37672, does not work 100% of the time. See details.

How?

The wp_link_pages uses the $multipage global variable to determine whether to output pagination, so checking the same variable in this context should ensure that the pagination is output whenever there is anything to output and omitted when it would be empty.

I was tempted to check isset( $GLOBALS['multipage'] ), but seeing that wp_link_pages does not include such a check, I left it out.

Testing Instructions

  1. Create a post using the classic editor and add the <!--nextpage--> tag
  2. Verify that the pagination is output for this post
  3. Through a plugin, use the content_pagination filter to add pagination to a post that does not contain the <!--nextpage--> tag
  4. Verify that the pagination is output for this post
  5. Create a post using the block editor and add the core/nextpage block
  6. Verify that the pagination is output for this post
  7. Create a post that does not have pagination
  8. Verify that the pagination is omitted for this post

Screenshots or screencast

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jun 30, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @carlomanf! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Block] Page Break Affects the Page Break Block labels Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Page Break Affects the Page Break Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
2 participants