API / Minn\Front / FeedController

FeedController final readonly class

Minn\Front\FeedController · public/minn/src/Minn/Front/FeedController.php · 60 lines

The feeds, wherever a request asks for one: the feed var of the rule its address matched (the site's at /feed/, the comments' at /comments/feed/, a post's or an archive's after its address, a plugin's own) or ?feed= on any page. Each is WordPress's feed lifecycle: the main query with the feed asked for, then do_feed, whose handler prints the feed and its content type. A feed of something the address names but the site does not have is an empty feed, as the reference serves it.

Constants and properties

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

Public

new__construct(Minn\Content\Site $site)#
staticasked(Minn\Http\Request $request, Minn\Front\Resolution $resolution): bool#

Whether a request asks for a feed of what it resolved to (the query form only of something that exists).

methodserve(Minn\Http\Request $request, Minn\Front\Resolution $resolution): Minn\Http\Response#

The feed a request asks for, of what its address resolved to.

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateserved(Minn\Front\Resolution $resolution, array $vars): Minn\Http\Response#

A feed as the reference serves it: the main query with the feed asked for (send_headers, wp and template_redirect around it), then do_feed, whose handler prints the feed and its content type.

$varsarray<string, mixed>what the request asks of the feed: its type and its comments
privateperFeed(): int#

How many items a feed carries (posts_per_rss).