mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-02 09:07:59 +02:00
Make sure it's an array first.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d62ae6b368
commit
e270daf352
@ -391,14 +391,16 @@ function get_nested_categories($default = 0, $parent = 0) {
|
|||||||
$cats = return_categories_list($parent);
|
$cats = return_categories_list($parent);
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
foreach($cats as $cat) {
|
if ( is_array( $cats ) ) {
|
||||||
$result[$cat]['children'] = get_nested_categories($default, $cat);
|
foreach($cats as $cat) {
|
||||||
$result[$cat]['cat_ID'] = $cat;
|
$result[$cat]['children'] = get_nested_categories($default, $cat);
|
||||||
$result[$cat]['checked'] = in_array($cat, $checked_categories);
|
$result[$cat]['cat_ID'] = $cat;
|
||||||
$result[$cat]['cat_name'] = get_the_category_by_ID($cat);
|
$result[$cat]['checked'] = in_array($cat, $checked_categories);
|
||||||
}
|
$result[$cat]['cat_name'] = get_the_category_by_ID($cat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function write_nested_categories($categories) {
|
function write_nested_categories($categories) {
|
||||||
|
Loading…
Reference in New Issue
Block a user