Minor Changes
-
#3394
38d200dThanks @ttmx! - Adds thebyline:afterSaveandbyline:afterDeleteplugin hooks, so plugins can keep external copies of author data, such as a search index, current when byline profiles change.Both hooks require the
bylines:readcapability and receive the same public byline profile thatctx.bylines.get()returns.byline:afterSaveruns after a byline or one of its translations is created or updated, withisNewset on creation.byline:afterDeletereceives the byline as it was before deletion. They run after changes made through the admin API or MCP tools, not seeds or imports, and hook errors are logged without undoing the change.Credit changes on an entry are still reported through
content:afterSave. Relinking a byline to another user can change the credits inferred for that user's entries without a per-entry event. -
#3394
38d200dThanks @ttmx! - Adds thebylines:readplugin capability, which lets plugins read public byline profiles and the bylines credited on content entries throughctx.bylines.ctx.bylinesprovidesget()and cursor-paginatedlist()for profiles, plusgetEntriesBylines()for credits.getEntriesBylines()resolves up to 100 entries of one collection in a single call, so a search indexer or feed plugin can attach author names to a page ofctx.content.list()results:const page = await ctx.content.list("posts", { limit: 100 }); const credits = await ctx.bylines.getEntriesBylines( "posts", page.items.map((entry) => entry.id), );
Credits match what the site renders: the credits assigned in the editor, or the author's linked byline, marked
source: "inferred", when an entry has none. They resolve at the entry's own locale. Profiles omit the linked user account, guest flag, and byline custom field values.The capability is independent of
content:readandusers:read. It is available to native plugins and to sandboxed plugins on Cloudflare Worker Loader and Node.js workerd. Installation and update consent list it as a new permission.