template/wordpress/code/main.php in edge_framework-2.0.0.a vs template/wordpress/code/main.php in edge_framework-2.0.0

- old
+ new

@@ -17,11 +17,11 @@ function add_to_context($context) { $context["menu"] = new TimberMenu(); $context["site"] = $this; - $context["home"] = home_url()."/"; + $context["home"] = home_url(); $context["root"] = get_template_directory_uri(); $context["img"] = $context["root"]."/assets/img"; $context["css"] = $context["root"]."/assets/css"; $context["js"] = $context["root"]."/assets/js"; $context["files"] = $context["root"]."/assets/files"; @@ -35,6 +35,27 @@ } new TimberEdge(); /* REMOVE MENU ITEMS */ -add_action("admin_menu", "remove_menu_items"); +function h_remove_menu() { + $items = get_removed_list(); + global $menu; + end($menu); + while(prev($menu) ) { + $item = explode(" ", $menu[key($menu)][0]); + $item_first = $item[0] != NULL ? $item[0] : ""; + if(in_array($item_first, $items) ) { + unset($menu[key($menu)]); + } + } +} +add_action("admin_menu", "h_remove_menu"); + +/* REMOVE IMAGE RESIZER */ +function h_remove_resizer($sizes) { + unset( $sizes["medium"]); + unset( $sizes["large"]); + + return $sizes; +} +add_filter("intermediate_image_sizes_advanced", "h_remove_resizer"); \ No newline at end of file