Clanbite Social Kit

get_feed_context_snapshot( string $feed_context, int $subject, int $per_page = 10 ): array{ok: true, posts: array<int, array<string, mixed>>, total: int, pages: int, page: int}|array{ok: false, reason: string}

First page of posts for any registered feed context (server render of the Social feed block).

Failure reasons are stable strings the block maps to messages: invalid_feed_context, login_required, {slug}_unresolved (no subject) and {slug}_forbidden (viewer may not read it).

public

Class: Kernowdev\ClanbiteSocialKit\Rest\Rest_Controller

Parameters

$feed_context (string) Required

Feed context slug.

$subject (int) Required

Subject ID (0 for subject-less contexts).

$per_page (int) Optional

Page size (max 50).

Default: 10

Returns

array{ok: true, posts: array<int, array<string, mixed>>, total: int, pages: int, page: int}|array{ok: false, reason: string}

Defined in inc/Rest/Rest_Controller.php