Add server side pagination for the main query (#26557) #26831
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In this change I have added some logic to enable the
core/query-pagination
block to apply to output displayed bycore/query-loop
when run against the main query.paginate_links
function to do the hard work.core/query
) has been put into a separate function, but remains untouched.How has this been tested?
$query
#25377( PR query-loop block: Run the main query when queryId is not set (#25377) #26825 )
index.html
to be:Edit
style.css
to add some basic styling of the list generated bypaginate_links()
.Screenshots
Types of changes
Part fix for #26557
As with the PR for running the main query in
core/query-loop
, this will require documentation explaining how to use the block.In order to implement the styling options specified in the requirements there will have to be a mapping between the attributes set in the block editor and the parameters to
paginate_links
.It seems likely that the pagination for queries defined using
core/query
will need to be changed to use thepaginate_links()
function as well.Checklist: