walk_category_dropdown_tree

函数


walk_category_dropdown_tree ( $args )
参数
  • (mixed)
    $args
    Elements array, maximum hierarchical depth and optional additional arguments.
    Required:
返回值
  • (string)
相关
  • Walker::walk()
定义位置
  • wp-includes/category-template.php
    , line 1136
引入
2.1.0
弃用

Retrieves HTML dropdown (select) content for category list.

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