template/wordpress/code/main.php in edge_framework-2.1.0 vs template/wordpress/code/main.php in edge_framework-2.1.1
- 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,27 +35,29 @@
}
new TimberEdge();
/* REMOVE MENU ITEMS */
-function h_remove_menu() {
+add_action("admin_menu", function() {
$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)]);
+
+ // var_dump($menu);
+ foreach($menu as $key => $m) {
+ if($m[0]) {
+ $i = explode(" <", $m[0]);
+
+ if(in_array($i[0], $items) ) {
+ unset($menu[$key]);
+ }
}
}
-}
-add_action("admin_menu", "h_remove_menu");
+});
/* REMOVE IMAGE RESIZER */
-function h_remove_resizer($sizes) {
+add_filter("intermediate_image_sizes_advanced", function($sizes) {
unset( $sizes["medium"]);
unset( $sizes["large"]);
return $sizes;
-}
-add_filter("intermediate_image_sizes_advanced", "h_remove_resizer");
+});
\ No newline at end of file