Taxonomies (Categories, Tags) (category)

get_ancestors()

Get an array of ancestor IDs for a given object.

get_term_parents_list()

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

wp_get_split_terms()

Get data about terms that previously shared a single term_id, but have since been split.

WP_Tax_Query{}

Core class used to implement taxonomy queries for the Taxonomy API.

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 metadata to a term.

delete_term_meta()

Removes metadata matching criteria from a term.

get_term_meta()

Retrieves metadata for a term.

has_term_meta()

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

register_term_meta()

Registers a meta key for terms.

update_term_meta()

Updates term metadata.

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()

Retrieve category description.

category_exists()

Checks whether a category exists.

get_cat_ID()

Retrieve the ID of a category from its 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()

Retrieves category data given a category ID or category object.

get_category_by_slug()

Retrieve category object by category slug.

get_category_link()

Retrieve category link URL.

get_category_parents()

Retrieve category parents with separator.

get_the_category_by_ID()

Retrieve category name based on category ID.

in_category()

Check if the current post is within any of the given categories.

single_cat_title()

Display or retrieve page title for category archive.

wp_create_category()

Add a new category to the database if it does not already exist.

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()

Displays or retrieves the edit link for a tag with formatting.

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()

Display or retrieve page title for tag post archive.

tag_description()

Retrieve tag description.

tag_exists()

Checks whether a post tag with a given name exists.

wp_generate_tag_cloud()

Generates a tag cloud (heatmap) from provided data.

wp_tag_cloud()

Display tag cloud. The text size is set by the 'smallest' and 'largest' arguments, which will use the 'unit' argument value for the CSS text size unit. The 'format' argument can be 'flat' (default), 'list', or 'array'. The flat value for the 'format' argument will separate tags with spaces. The list value for the 'format' argument will format the tags in a UL HTML list. The array value for the 'format' argument will return in PHP array type format.

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()

Retrieves the URL for editing a given 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()

Get all Term data from database by Term ID.

get_term_by()

Get all Term data from database by Term field and data.

get_term_children()

Merge all term children into a single array of their IDs.

get_term_field()

Get sanitized 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()

Whether the taxonomy object is hierarchical.

register_taxonomy()

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

register_taxonomy_for_object_type()

Add an already registered taxonomy to an object 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 that the taxonomy name exists.

term_description()

Retrieve term description.

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()

Check if a term is an ancestor of another term.

the_terms()

Display the terms in a list.

unregister_taxonomy()

Unregisters a taxonomy.

unregister_taxonomy_for_object_type()

Remove an already registered taxonomy from an object type.

wp_count_terms()

Count how many terms are in Taxonomy.

wp_delete_term()

Removes a term from the database.

wp_get_term_taxonomy_parent_id()

Returns the term's parent's term_ID.

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 the amount of terms in taxonomy.

For posts

get_object_taxonomies()

Return the names or objects of the taxonomies which are registered for the requested object or object type, such as a post object or post type name.

get_objects_in_term()

Retrieve object_ids of valid taxonomy and term.

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()

Retrieve the tags for a post formatted as a string.

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()

Check if the current post has any of given terms.

is_object_in_taxonomy()

Determine if the given object type is associated with the given taxonomy.

is_object_in_term()

Determine if the given object is associated with any of the given terms.

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()

Will unlink the object from the taxonomy or taxonomies.

wp_get_object_terms()

Retrieves the terms associated with the given object(s), in the supplied taxonomies.

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()

Remove term(s) associated with a given object.

wp_set_object_terms()

Create Term and Taxonomy Relationships.

wp_set_post_categories()

Set categories for a post.

wp_set_post_tags()

Set the tags for a post.

wp_set_post_terms()

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