Uses
| Uses | Description |
|---|---|
| wp-includes/category-template.php: get_term_parents_list() | Retrieves term parents with separator. |
| wp-includes/functions.php: _deprecated_argument() | Mark a function argument as deprecated and inform when it has been used. |
Retrieves category parents with separator.
(int) (Required) Category ID.
(bool) (Optional) Whether to format with link.
Default value: false
(string) (Optional) How to separate categories.
Default value: '/'
(bool) (Optional) Whether to use nice name for display.
Default value: false
(array) (Optional) Not used.
Default value: array()
(string|WP_Error) A list of category parents on success, WP_Error on failure.
File: wp-includes/category-template.php
function get_category_parents( $category_id, $link = false, $separator = '/', $nicename = false, $deprecated = array() ) {
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '4.8.0' );
}
$format = $nicename ? 'slug' : 'name';
$args = array(
'separator' => $separator,
'link' => $link,
'format' => $format,
);
return get_term_parents_list( $category_id, 'category', $args );
} | Version | Description |
|---|---|
| 4.8.0 | The $visited parameter was deprecated and renamed to $deprecated. |
| 1.2.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_category_parents