首页 WordPress函数大全 get_term_parents_list()

get_term_parents_list()

2020-05-01 / 5420阅 / 悠然

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

get_term_parents_list( int $term_id, string $taxonomy, string|array $args = array() )

Retrieve term parents with separator.

描述

参数

$term_id

(int)
(Required)
Term ID.

$taxonomy

(string)
(Required)
Taxonomy name.

$args

(string|array)
(Optional)
Array of optional arguments.

  • 'format'
    (string) Use term names or slugs for display. Accepts 'name' or 'slug'. Default 'name'.
  • 'separator'
    (string) Separator for between the terms. Default '/'.
  • 'link'
    (bool) Whether to format as a link. Default true.
  • 'inclusive'
    (bool) Include the term to get the parents for. Default true.

Default value: array()

返回

(string|WP_Error) A list of term parents>WP_Error or empty string on failure.

大家谈论
    我的见解