API / Minn\Runtime / PostData

PostData final class

Minn\Runtime\PostData · public/minn/src/Minn/Runtime/PostData.php · 98 lines

The loop's view of a post, as the reference's generate_postdata and get_the_content give it (probes the-content, excerpt): the content split into pages at <!--nextpage--> (the line breaks beside the marker go with it) and handed to content_pagination, the page the query asks for, and "more" when the main query shows a single post, a page or a feed; then the content of that page, cut at the more tag with a more link (or run on past it when "more" is set), the teaser dropped when asked or marked <!--noteaser-->.

Public

staticsetup(mixed $post): mixed#

A post made the one being read (setup_postdata): through the query being answered when there is one (which tells the_post), else its globals set here; false for no post.

staticglobals(Minn\Objects\Post $post): void#

The loop's globals for a post: its id, author, dates, pages and whether more shows.

staticgenerate(Minn\Objects\Post $post, ?Minn\Objects\Query $query = NULL): array#

id, authordata, currentday, currentmonth, page, pages, multipage, more, numpages. The page comes from the query given (the main query otherwise); more is set on a single, a page or a feed, or past the first page of a post split into pages (probe query-compat).

@return array<string, mixed>
staticcontent(?string $moreLinkText, Minn\Objects\Post $post, array $elements): string#

The content get_the_content gives: the asked page, cut at the more tag unless "more" is set.

$elementsarray<string, mixed>as generate() gives them, with strip_teaser when the teaser should go