-
Couldn't load subscription status.
- Fork 108
fix: rest-api-pagination #269
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
Conversation
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.
Pull Request Overview
This PR fixes pagination functionality in the Code Snippets REST API by implementing proper pagination parameters and headers. The changes enable clients to paginate through snippet collections using standard WordPress REST API conventions.
Key changes:
- Added support for standard REST API collection parameters (
page,per_page) on the snippets endpoint - Implemented pagination logic with proper slicing of results and response headers (
X-WP-Total,X-WP-TotalPages) - Updated CSS to use logical properties for better internationalization support
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/php/rest-api/class-snippets-rest-controller.php | Added pagination support with collection parameters, page slicing logic, and standard WordPress pagination headers |
| src/css/settings.scss | Converted directional CSS properties to logical properties for RTL language support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ref: https://wordpress.org/support/topic/pagination-issue-in-code-snippets-rest-api/