Category hierarchy fixes. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
facc7245fa
commit
7c39499aa0
|
@ -104,7 +104,7 @@ function get_nested_categories( $default = 0, $parent = 0 ) {
|
||||||
if ( is_array( $cats ) ) {
|
if ( is_array( $cats ) ) {
|
||||||
foreach ( $cats as $cat) {
|
foreach ( $cats as $cat) {
|
||||||
// TODO fix hierarchy
|
// TODO fix hierarchy
|
||||||
//$result[$cat]['children'] = get_nested_categories( $default, $cat);
|
$result[$cat]['children'] = get_nested_categories( $default, $cat);
|
||||||
$result[$cat]['cat_ID'] = $cat;
|
$result[$cat]['cat_ID'] = $cat;
|
||||||
$result[$cat]['checked'] = in_array( $cat, $checked_categories );
|
$result[$cat]['checked'] = in_array( $cat, $checked_categories );
|
||||||
$result[$cat]['cat_name'] = get_the_category_by_ID( $cat);
|
$result[$cat]['cat_name'] = get_the_category_by_ID( $cat);
|
||||||
|
|
|
@ -700,10 +700,10 @@ function _get_term_hierarchy($taxonomy) {
|
||||||
return $children;
|
return $children;
|
||||||
|
|
||||||
$children = array();
|
$children = array();
|
||||||
$terms = get_terms($taxonomy, 'hide_empty=0&hierarchical=0');
|
$terms = get_terms($taxonomy, 'get=all');
|
||||||
foreach ( $terms as $term ) {
|
foreach ( $terms as $term ) {
|
||||||
if ( $term->parent > 0 )
|
if ( $term->parent > 0 )
|
||||||
$children[$cterm->parent][] = $term->term_id;
|
$children[$term->parent][] = $term->term_id;
|
||||||
}
|
}
|
||||||
update_option("{$taxonomy}_children", $children);
|
update_option("{$taxonomy}_children", $children);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue