Skip to content

Add API to read cached post - #1561

Open
crazytonyli wants to merge 4 commits into
trunkfrom
post-cache-read-by-ids
Open

Add API to read cached post#1561
crazytonyli wants to merge 4 commits into
trunkfrom
post-cache-read-by-ids

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Description

I want to use this API to read cached post in the comments screens, to show what post the comment is posted on.

I'd like to use the function signature read_posts_by_ids_from_db -> AnyPostWithEditContext. The function name is already taken. So I changed the existing function to read_post_full_entities_by_ids_from_db -> FullEntity<AnyPostWithEditContext>.

Replaces the per-ID select loop with a single IN query plus one batched term-relationship query, so the shared cache connection is held for two queries per batch instead of two per post. Resolves the existing TODO in read_post_full_entities_by_ids_from_db.
@wpmobilebot

wpmobilebot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1561")

Built from 53b02ac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants