首页 WordPress函数大全 get_the_taxonomies()

get_the_taxonomies()

2020-05-02 / 3448阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

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

Retrieve all taxonomies associated with a post.

描述

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

参数

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

返回

(array) List of taxonomies.

大家谈论
    我的见解