API / Minn\Runtime / PostTags

PostTags final class

Minn\Runtime\PostTags · public/minn/src/Minn/Runtime/PostTags.php · 216 lines

What the post template tags tell about a post (the one being read when none is named): its id and title, whether a password stands before it, whether comments and pings are open, how many comments it has, and its featured image; each through the filter plugins hook there.

Public

statictime(mixed $format = 'U', mixed $gmt = false, mixed $post = NULL, mixed $translate = false): mixed#

When a post was published (get_post_time): a timestamp for "U" or "G", else the date in the format, local or UTC (a GMT date not set yet worked out from the local one), names translated when asked; false for no post.

staticmodifiedTime(mixed $format = 'U', mixed $gmt = false, mixed $post = NULL, mixed $translate = false): mixed#

When a post last changed (get_post_modified_time), as get_post_time tells when it was published.

staticauthorMeta(mixed $field = '', mixed $userId = false): mixed#

One of the author's fields (get_the_author_meta): the post's author being read unless a user is named; ID as an integer, the user_ columns by their short names, empty for none; as get_the_author_{field} leaves it.

staticauthorPostsUrl(mixed $authorId, mixed $nicename = ''): mixed#

An author's archive address (get_author_posts_url): /author/{nicename}/ with pretty permalinks, else ?author=; as author_link leaves it.

statictitleAttribute(mixed $args = ''): mixed#

A post's title made safe for an attribute (the_title_attribute), its tags gone with those of before and after; printed unless echo is false, null for no title.

staticdate(mixed $format = '', mixed $post = NULL): mixed#

When a post was published, in the format given or the site's date format (get_the_date), as get_the_date leaves it; false for no post.

staticpasswordForm(mixed $post = 0): mixed#

The password form (get_the_password_form), as the content shows it before its paragraphs are made; a reader the post's own page sent back with a password cookie set reads why above the field; as the_password_form leaves it.

staticid(): mixed#

The id of the post being read (get_the_ID), or false.

statictitle(mixed $post = 0): mixed#

A post's title (get_the_title): outside the admin a protected or private one says so (protected_title_format, private_title_format); then the_title. Empty for no post.

staticpasswordRequired(mixed $post = NULL): mixed#

Whether a password stands before the post's content for this reader (post_password_required).

staticcommentsOpen(mixed $post = NULL): bool#

Whether comments are open on a post (comments_open).

staticpingsOpen(mixed $post = NULL): bool#

Whether pings are open on a post (pings_open).

staticthumbnailId(mixed $post = NULL): mixed#

The id of a post's featured image (get_post_thumbnail_id), 0 for none, false for no post.

statichasThumbnail(mixed $post = NULL): bool#

Whether a post has a featured image (has_post_thumbnail).

staticcommentsNumber(mixed $post = 0): mixed#

How many comments a post has (get_comments_number), 0 for none.

Internals 1

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

privatemoment(string $source, mixed $format, mixed $gmt, mixed $translate): mixed#

A stored date as a timestamp for "U" or "G", else in the format (translated when asked); null for one that is not a date.