Un motore di ricerca WordPress per sviluppatori e autori di temi



get_category_parents ›

Da1.2.0
Deprecaton/a
get_category_parents ( $id, $link = false, $separator = '/', $nicename = false, $deprecated = array() )
Parametri: (5)
  • (int) $id Category ID.
    Richiesto:
  • (bool) $link Optional, default is false. Whether to format with link.
    Richiesto: No
    Default: false
  • (string) $separator Optional, default is '/'. How to separate categories.
    Richiesto: No
    Default: '/'
  • (bool) $nicename Optional, default is false. Whether to use nice name for display.
    Richiesto: No
    Default: false
  • (array) $deprecated Not used.
    Richiesto: No
    Default: array()
Ritorna:
  • (string|WP_Error) A list of category parents on success, WP_Error on failure.
Definito a:
Codex:
ChangeLog:
  • 4.8.0

Retrieve category parents with separator.



Sorgenti

function get_category_parents( $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( $id, 'category', $args );
}