-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Check for nextpage to display page links for paginated posts #37672
Check for nextpage to display page links for paginated posts #37672
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @alberto-marin! 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. |
Thanks for contributing, @alberto-marin. I'm wondering if this should be a separate block. @carolinan, @kjellr, what do you think? |
@Mamaduka I did not understand; the page break is already a block. From the issue:
|
Don't we need to add this in a new .php file for nextpage? |
@carolinan, sorry for the confusion. I meant "Page Links" as a separate/new block. The block will give theme authors more flexibility in displaying these links + styling options. |
I think eventually, we should just follow the lead of what we do for standard query pagination. In that case, there are three separate blocks:
|
@kjellr, this is slightly different from Query pagination blocks. You have separate methods ( |
That sounds like a technical reason, not a UX reason though — I think there's value in making pagination consistent wherever it's available so users don't have to re-learn it every time. For the near term though, I don't have a strong preference about whether that's a separate block or not. That seems like a decent idea, but as long as this is showing up again for block themes I think we're good for now. |
Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Thanks, @alberto-marin.
Congratulations on your first merged pull request, @alberto-marin! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
@noisysocks, I'm adding a backport label for this PR. It's a small change and adds missing behavior. |
* Check for nextpage to display page links for paginated posts * fix php styles * Update packages/block-library/src/post-content/index.php Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> * Update packages/block-library/src/post-content/index.php Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com>
Hi,
The "core/nextpage" it's a child of "core/post-content" but within the post-content there's no reference to it.
After getting the value for
$post_id
we could see that the blockcore/nextpage
exists by using something like this:What is missing here is the ability to detect this "child" block. After applying the filter to
the_content
we could check and call the function that displays page links:I have tested it with the official wordpress themes from twentytwentynine to twentytwentytwo, and it works well.
This fix is related to this issue: #29484
Note that
get_the_content()
doesn't need thenull
andfalse
attributes because those are the function defaults.Checklist:
*.native.js
files for terms that need renaming or removal).