get_category_parents()获取父级分类的所有信息

目录

描述

Returns a list of the parents of a category, including the category, in hierarchical order.

get_category_parents() 描述

用法

 <?php get_category_parents$id$link$separator$nicename$visited ); ?> 

get_category_parents() 用法

参数

$id

(integer) (必填) Category ID.

默认值: None

$link

(boolean) (可选) Whether to create a link to each category displayed.

默认值: false

$separator

(string) (可选) What to separate each category by.

默认值: '/'

$nicename

(boolean) (可选) Whether to use nice name for display.

默认值: false

$visited

(boolean) (可选) Already linked-to categories. This parameter is used internally by the function, which makes recursive calls to itself, to prevent duplicates in the returned list.

默认值: array()

get_category_parents() 参数

返回值

(string|WP_Error) 

The categories, separated by $separator. WP_Error on failure.

get_category_parents() 返回值

历史

get_category_parents() 历史

源文件

get_category_parents() 函数的代码位于 wp-includes/category-template.php

get_category_parents() 源文件

相关