首先我确实从网络创建了儿童博客,并且在弹出窗口中成功显示的菜单上,您可以查看此链接" http://prntscr.com/anvweq"但在弹出窗口我得到父页面菜单而不是儿童博客菜单
function count_menu() {
$target_blog_id = $this->cloner->target_id;
//exit;
switch_to_blog($target_blog_id);
global $menu;
$menu_num = 0;
$parItems = $menu;
$count_menu = array();
foreach ($parItems as $k => $menuItem) {
$menu_num++;
if(!empty($menuItem[0])) {
$menu_slug = $menuItem[2];
$get_menu_name = explode("<span", $menuItem[0]);
$menu_name = (empty($get_menu_name[0])) ? $menu_slug : $get_menu_name[0];
$wps_clean_name = $this->wps_clean_name($get_menu_name[0]);
$count_menu[] = '<input type="hidden" name="parentmenu_item['.$menu_num.']" value="'.$wps_clean_name.'^' . $menu_slug . '^' . $menu_num . '" /><input type="checkbox" class="widefat edit-menu-item-title" name="menu_item_hide['.$menu_num.']" id="menu_item_hide['.$menu_num.']" value="hide" /><label for="menu_item_hide['.$menu_num.']"><strong>'.$menu_name.'</strong></label>';
}
}
restore_current_blog();
return $count_menu;
}