A WordPress-centric search engine for devs and theme authors



walk_category_tree ›

Since2.1.0
Deprecatedn/a
walk_category_tree ( $args )
Parameters:
  • (mixed) $args ...$args Elements array, maximum hierarchical depth and optional additional arguments.
    Required: Yes
Uses:
  • Walker_Category
See:
  • Walker::walk()
Returns:
  • (string)
Defined at:
Codex:
Change Log:
  • 5.3.0

Retrieve HTML list content for category list.



Source

function walk_category_tree( ...$args ) {
	// The user's options are the third parameter.
	if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
		$walker = new Walker_Category;
	} else {
		$walker = $args[2]['walker'];
	}
	return $walker->walk( ...$args );
}