Fuxt API - Posts Include Param#117
Open
dChiamp wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Two changes, deployed together:
1.
includeparam onGET /wp-json/fuxt/v1/postsFetch specific posts by ID in a single request:
Pearl's favorites feature stores favorited post IDs client-side and needs to rehydrate a mixed list of posts (event, music, shop, dine-and-drink, post) in one request.
includeaccepts a comma-separated list of post IDs (sanitized viawp_parse_id_list, capped at 100 to match theper_pagemaximum).includeis set and nopost_typeis given, the query spans all fuxt-exposed post types (Utils::get_post_types()) instead of defaulting topost— deliberately notpost_type => 'any', which would silently exclude CPTs registered withexclude_from_search.orderby => post__in) unless the caller explicitly setsorderby.posts_per_pageis set to the ID count so schema defaults (per_page=10) don't truncate;post_status => publishandignore_sticky_postsare forced.post_typestill narrows results; unknown IDs are simply omitted.2. Project Images endpoint (commits previously-unversioned production code)
/fuxt/v1/project-images(upload + list, API-key auth, rate limiting) has been running on Pearl's production WP but was never committed to the repo. Deploying this branch's first commit alone removedclass-rest-project-images-controller.phpfrom the server while the deployedclass-plugin.phpstill instantiated it, causing a site-wide fatal (Class "FuxtApi\REST_Project_Images_Controller" not found). The outage was fixed by restoring the file on the server; this commit makes the repo the source of truth so deploys frommaincan't re-break it.Worth a quick sanity review of the project-images auth/rate-limit logic since it was authored outside this PR.
Version bumped to 0.1.5. Needs to be deployed to Pearl's WP install (both commits together) before the frontend favorites page ships.