TermTags final class
Minn\Runtime\TermTags · public/minn/src/Minn/Runtime/TermTags.php · 364 lines
What WordPress's template tags tell about a post's terms: its terms of a taxonomy (as a list primed them, else read), its categories with their old field names, its tags, its format, and a category's address and the chain of its parents.
Constants and properties
| private | CATEGORY_FIELDS = array ( 'cat_ID' => 'term_id', 'category_count' => 'count', 'category_description' => 'description', 'cat_name' => 'name', 'category_nicename' => 'slug', 'category_parent' => 'parent', ) | A category's old field names, each with the term field it mirrors, in the order they are added. |
Public
| static | cached(mixed $id, mixed $taxonomy): mixed# | The terms of a post that a list primed or the object cache holds (get_object_term_cache), each through get_term; false when nothing holds them. |
| static | formatStrings(): array# | The post formats' names (get_post_format_strings), in the site's language, by slug. @return array<string, string> |
| static | ofPost(mixed $post, mixed $taxonomy): mixed# | A post's terms of a taxonomy (get_the_terms), as get_the_terms leaves them; false for none or no post. |
| static | categories(mixed $postId = false): mixed# | A post's categories (get_the_category), each with its old field names, as get_the_categories leaves them. |
| static | tags(mixed $post = 0): mixed# | A post's tags (get_the_tags), as get_the_tags leaves them. |
| static | format(mixed $post = NULL): mixed# | A post's format (get_post_format): its post_format term's slug without the prefix; false for none or a type without formats. |
| static | categoryFields(mixed $category): void# | A category's old field names beside its term fields (_make_cat_compat), on a term object or a term array alike. |
| static | categoryLink(mixed $category): mixed# | A category's address (get_category_link), empty for none. |
| static | categoryParents(mixed $categoryId, mixed $link = false, mixed $separator = '/', mixed $nicename = false, mixed $deprecated = array ( )): mixed# | A category's parents and itself, outermost first (get_category_parents), as names or slugs, linked or not, with the separator after each; the error for an unknown category. |
| static | cacheObjects(mixed $objectIds, mixed $objectType): void# | Each taxonomy's term ids of the objects not cached yet, kept in {taxonomy}_relationships (update_object_term_cache); an object cached there keeps its entry, and one without terms gets an empty list. |
| static | cleanObjects(mixed $objectIds, mixed $objectType): void# | The objects' term caches let go (clean_object_term_cache): each of the type's taxonomies' relationships, the terms' last_changed moved, then plugins told; nothing at all while cache invalidation is suspended. |
| static | attachmentTaxonomies(mixed $attachment, mixed $output = 'names'): array# | The taxonomies an attachment carries (get_attachment_taxonomies): those registered for attachments, for its file's extension, its MIME type, and each half of it (attachment:image, attachment:image/png...). |
| static | taxonomies(mixed $post = 0, mixed $args = array ( )): array# | A post's taxonomies as sentences of term links (get_the_taxonomies): a taxonomy's own template and term_template win over the ones given; the terms list through wp_sprintf's %l; an attachment's file types count; a taxonomy without terms is left out. @return array<string, string> |
| static | objectInTerm(mixed $objectId, mixed $taxonomy, mixed $terms = NULL): mixed# | Whether an object has one of the terms (is_object_in_term): an integer is an id, a digit string an id, a name or a slug, any other string a name or a slug; no terms asked means any term of the taxonomy. An error for no object (0) or an unknown taxonomy. |
| static | cloudCountText(int $count, mixed $tag, array $args): string# | The tag cloud's count in words for a tag's label: topic_count_text (a nooped plural) first, then the text callback (default_topic_count_text counts as none), then the old single_text and multiple_text, else "%s item" / "%s items" (probe taxonomy-blocks-user-doubts). |
| static | allLink(string $taxonomy): string# | The category list's "all" link for a taxonomy: the archive of its first type when none of its types is a post, else the posts page or the home page (probe taxonomy-blocks-user-doubts). |
| static | bindingValue(array $sourceArgs, mixed $block): mixed# | A term's field for the core/term-data binding (_block_bindings_term_data_get_value): a navigation link or submenu by its own id and type ("tag" is post_tag), any other block by the termId and taxonomy in its context; id, count and parent as text, the name, slug, description or link. Null for no term, or a term of a hidden taxonomy to someone who may not edit it (probe taxonomy-blocks-user-doubts). |
Nothing matches.