Taxonomies (Categories, Tags) (category)

_update_post_term_count()

Updates the number of posts attached to a term (taxonomy element). The types of posts to consider are taken from the taxonomy settings.

get_ancestors()

Gets the IDs of the parent elements of the specified object (page, taxonomy, category).

get_term_parents_list()

Gets the list of parents of the specified term (taxonomy element).

wp_get_split_terms()

Gets data about taxonomy terms that had the same ID and were split since WP version 4.2.

WP_Tax_Query{}

The class creates the JOIN and WHERE parts of the SQL query, which, in addition to the main query, will filter the result by the specified terms (taxonomy elements).

wp_terms_checklist()

Displays/retrieve the UL list of checkbox input elements input type="checkbox" labelled with term names.

Metadata (termmeta)

add_term_meta()

Adds a meta-field (additional field) for the specified taxonomy term (categories, tags ...).

delete_term_meta()

Deletes the specified meta-field of the specified taxonomy term.

get_term_meta()

Gets the value of the specified meta-field of a taxonomy term (categories, tags, etc.). You can get all values as an array.

has_term_meta()

Gets all metadata of the specified taxonomy element (term).

register_term_meta()

Registers a meta-field for the specified taxonomy.

update_term_meta()

Updates the metadata of a taxonomy term (categories, tags ...).

Categories

cat_is_ancestor_of()

Checks if the specified category is a child of another specified category (all nesting levels are checked). Conditional tag.

category_description()

Gets the description of the category, which is specified on the category editing page in the admin panel (posts > categories).

category_exists()

Checks if the specified category exists. If it does, it returns the ID of that category.

get_cat_ID()

Gets the category ID by the given name.

get_cat_name()

Gets the name of the category by the passed ID.

get_categories()

Gets categories as an array of objects.

get_category()

Gets data of the specified category.

get_category_by_slug()

Gets category data by its alternative name (slug).

get_category_link()

Gets the correct link to the category page by the given category ID.

get_category_parents()

Gets a list of parent categories of the current category. The list is displayed in hierarchical order.

get_the_category_by_ID()

Gets the category name by the given ID.

in_category()

Checks whether the current (or specified) post belongs to the specified category (multiple categories can be specified). Conditional tag.

single_cat_title()

Displays the title of the category or tag. Used outside the loop. Intended for archive pages.

wp_create_category()

Simplified function for adding a category, which requires the name of the new category and, if needed, the ID of the parent category.

wp_dropdown_categories()

Display or retrieve the HTML dropdown list of categories. Instead of categories you can specify the name of an custom taxonomy.

wp_insert_category()

Inserts a new category into the database. Or updates an existing category by specifying a category ID.

wp_list_categories()

Displays a list of categories as HTML links. If you click on the link, all posts from the category will be shown.

Tags

edit_tag_link()

Outputs a link to edit the current meta-field if the user is allowed to modify tags.

get_tag_link()

Retrieves the link to the tag by given tag ID.

get_tags()

Retrieve an array of tags objects. Tags can be retrieved by different criteria (see $args parameter).

single_tag_title()

Outputs the title of the current meta-field if the tag archive page is being viewed.

tag_description()

Gets the description of the tag, which is set when creating/editing the tag in the admin panel.

tag_exists()

Checks if the specified tag exists. If it exists, it returns the ID or an array of data for that tag.

wp_generate_tag_cloud()

Processes the provided term (tag) data and returns the HTML code for the tag cloud.

wp_tag_cloud()

Outputs or retrieves a tag cloud (a list of tags in the form of a cloud). You can specify any taxonomy.

Taxonomies: categories, tags, ...

edit_term_link()

Displays/retrieves edit term link (html tag A), link to edit the specified taxonomy element.

get_edit_term_link()

Gets the URL for editing the specified taxonomy term.

get_taxonomies()

Gets the list of registered taxonomies. You can restrict the list to the desired parameters.

get_taxonomy()

Gets an object containing settings (data) of the specified taxonomy.

get_term()

Gets data about a taxonomy element (term) by the provided ID.

get_term_by()

Gets the specified term (taxonomy element) by: name, slug, or term ID.

get_term_children()

Gets all child elements of the specified taxonomy element (categories) as an array.

get_term_field()

Gets the term field. The field is sanitized by the function sanitize_term_field().

get_term_link()

Gets the URL for the archive page of a term (taxonomy item). The same as the link to the category page.

get_terms()

Retrieve the terms (items) of a given taxonomy or list of taxonomies by the given parameters.

is_taxonomy_hierarchical()

Checks if the specified taxonomy is hierarchical. Conditional tag.

register_taxonomy()

Creates a new custom WordPress taxonomy. Allows you to change an existing taxonomy.

register_taxonomy_for_object_type()

Binds (adds) the specified taxonomy to the specified post type.

sanitize_term()

Sanitize all fields of the taxonomy element (term) using the sanitize_term_field() function.

sanitize_term_field()

Prepares (cleanse) term field value for use it in a text or elsewhere (depends on cleaning context).

single_term_title()

Display or retrieve title for the current taxonomy (category, tag, etc.). Uses on term archive pages.

taxonomy_exists()

Checks if the specified taxonomy exists.

term_description()

Gets the description of the term (taxonomy element: tags, categories, etc.) that is specified on the term creation/editing page.

term_exists()

Check if a given taxonomy element exists. Returns either term ID or a term data if the element (term) exists.

term_is_ancestor_of()

Checks if the second term is a child of the first (all levels of nesting are checked). Conditional tag.

the_terms()

Outputs a list of links to terms (taxonomy elements) related to the specified post.

unregister_taxonomy()

Cancels the registration of the specified taxonomy (removes the taxonomy).

unregister_taxonomy_for_object_type()

Unlinks the taxonomy from the specified post type (or other object).

wp_count_terms()

Counts how many elements (terms) are in the taxonomy, with or without posts.

wp_delete_term()

Deletes a term (category, tag) from the Database.

wp_get_term_taxonomy_parent_id()

Gets the ID of the parent element of the taxonomy (term) for the specified one.

wp_insert_term()

Adds a new taxonomy element (term, category) into a database.

wp_update_term()

Updates the term (taxonomy element) using the specified data.

wp_update_term_count()

Updates/recalculates the number of posts in a taxonomy element (term).

For posts

get_object_taxonomies()

Gets the taxonomies related to the specified post type or the passed object.

get_objects_in_term()

Gets the IDs of objects (usually posts) that relate to the specified element of the specified taxonomy.

get_the_category()

Gets an array of categories data related to current post.

get_the_category_list()

Retrieve links to the categories to which the post belongs in either HTML list or custom format.

get_the_tag_list()

Gets the HTML string of tags for the current post. The name of each tag will be a link to the archive of posts with that tag. Used in a loop.

get_the_tags()

Retrieve an array of post tags. Each array element is a WP_Term object. Can be used within The Loop.

get_the_taxonomies()

Retrieve all taxonomies associated with a post. Gets an array of HTML links.

get_the_term_list()

Displays a list of links to taxonomy elements (e.g. tags) related to a specified post.

get_the_terms()

Gets the taxonomy elements (terms) that are attached to the specified post.

has_category()

Checks whether the current or specified post has at least one of the specified categories.

has_tag()

Checks if the current post has any of the given tags. A conditional tag.

has_term()

Checks if the specified post is associated with the specified taxonomy terms.

is_object_in_taxonomy()

Checks if the specified post type is associated with the specified taxonomy.

is_object_in_term()

Defines whether the specified object is associated with any of the specified taxonomy elements (term). Specific term(s) can be provided to check the association.

the_category()

Displays links to the categories to which the post belongs in either HTML list or custom format.

the_tags()

Retrieve the tags links for a post.

the_taxonomies()

Display links to taxonomy terms of the current post. Used inside WordPress loop

wp_delete_object_term_relationships()

Destroys all relationships of the object (post, page) with the specified taxonomy(ies).

wp_get_object_terms()

Gets the terms (taxonomy elements) related to the given object(s) (posts) in the specified taxonomy.

wp_get_post_categories()

Gets the list of post categories as an array.

wp_get_post_tags()

Gets a list of tags for a specified post as an array.

wp_get_post_terms()

Gets the elements of the specified taxonomy (tag, category) to which specified post is associated.

wp_remove_object_terms()

Breaks the connection between the specified object and the specified term, i.e., removes the post from the taxonomy element (category).

wp_set_object_terms()

Attaches a post to a term (taxonomy element). For example, places a post in the specified category.

wp_set_post_categories()

Sets categories for a post.

wp_set_post_tags()

Sets tags for a post.

wp_set_post_terms()

Sets the terms for specified post (sets categories for post).