mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed the visibility of sub-items of hidden menu items.
This commit is contained in:
@@ -72,9 +72,9 @@ if ( ! is_admin() ) {
|
||||
$visible = true;
|
||||
|
||||
// Hide any item that is the child of a hidden item.
|
||||
if ( isset( $item->menu_item_parent ) && in_array( $item->menu_item_parent, $hide_children_of, true ) ) {
|
||||
if ( isset( $item->menu_item_parent ) && in_array( absint( $item->menu_item_parent ), $hide_children_of, true ) ) {
|
||||
$visible = false;
|
||||
$hide_children_of[] = $item->ID; // for nested menus
|
||||
$hide_children_of[] = absint( $item->ID ); // for nested menus
|
||||
}
|
||||
|
||||
if ( isset( $mode ) && $visible ) {
|
||||
@@ -118,7 +118,7 @@ if ( ! is_admin() ) {
|
||||
|
||||
// unset non-visible item
|
||||
if ( ! $visible ) {
|
||||
$hide_children_of[] = $item->ID; // store ID of item
|
||||
$hide_children_of[] = absint( $item->ID ); // store ID of item
|
||||
} else {
|
||||
$filtered_items[] = $item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user