get_the_taxonomies

SummerySummery

Retrieve all taxonomies associated with a post.

Syntax

get_the_taxonomies( int|WP_Post $post, array $args = array() )

DescriptionDescription

This function can be used within the loop. It will also return an array of the taxonomies with links to the taxonomy and name.

ParametersParameters

$post

(int|WP_Post) (Optional) Post ID or WP_Post object. Default is global $post.

$args

(array) (Optional) Arguments about how to format the list of taxonomies.

  • 'template'
    (string) Template for displaying a taxonomy label and list of terms. Default is "Label: Terms."
  • 'term_template'
    (string) Template for displaying a single term in the list. Default is the term name linked to its archive.

Default value: array()

ReturnReturn

(array) List of taxonomies.

SourceSource

File: wp-includes/taxonomy.php


			

ChangelogChangelog

Changelog
Version Description
2.5.0 Introduced.
Scroll to Top