{"id":2939,"date":"2011-03-20T16:55:25","date_gmt":"2011-03-20T23:55:25","guid":{"rendered":"http:\/\/6.2071"},"modified":"2022-12-17T14:43:30","modified_gmt":"2022-12-17T22:43:30","slug":"fixed-admin-menus-the-plugin-expanded","status":"publish","type":"post","link":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/","title":{"rendered":"Fixed Admin Menus \u2014 The Plugin Expanded"},"content":{"rendered":"<p class=\"descender\">Short time between initial plugin release and the first update but it had to be done... and quick. Downloads of the first <span class=\"ital\">Admin Menus Fixed<\/span> version were chugging along nicely for a number of days, with no reports of bugs, etc. Then, while researching why <span class=\"ital\">Popular Posts<\/span> was suddenly returning no results by deactivating recently updated plugins, one-by-one, to try to sort out if there were a conflict, I found one myself. Always better that way than a user in trouble.<\/p>\r\nI got down the list to <span class=\"ital\">Ozh' Admin Drop Down Menu<\/span> and almost skipped over it, thinking that it surely wouldn't interact with Popular Posts, but decided to be thorough. Bam! As soon as his plugin deactivated it left mine running and locked me out of the Plugins page. I was testing for the existence of one of his functions in the running code and if it was not found, my plugin would not start; outputting an error message stating that Ozh's plugin had to be activated.\r\n\r\nThat works great for the activation part but the deactivation part was disastrous, well, not <span class=\"bold ital\">all<\/span> that disastrous but disconcerting, nonetheless. If they are deactivated in the correct order, dependent then parent, everything goes smoothly. Reverse the order and you are met with a nice blank screen with my error message and that's it. Refreshing the page returns the same blank screen. Rats! Renamed the directory it lives in, so that WordPress would auto-deactivate because it couldn't find the plugin, and I was quickly back in business looking for ways to prevent this happening.\r\n\r\nStarted to approach the problem from a dependency angle to auto-deactivate if it doesn't find the correct environment but soon came up empty, at least as far as getting an update quickly pushed to the WordPress.org Plugin Directory. Along the way, I looked at it from a different angle, took a different approach and proved that there are silver linings and lemonade. Instead of limiting the plugin to only work within a tight set of constraints, I explored expanding its range to embrace the entire WordPress 3.1 Admin Menu structure; no matter what combinations of menus and bars a user may prefer. This then eliminated the test for an existing function to be able to start and, thus, eliminated the deactivation sequence problem altogether. It's not Rocket Surgery. Four nested IF's and I'm outtathere.\r\n<p class=\"descender\">As the WordPress tagline goes: <span class=\"p17\">Code is Poetry<\/span> and I say: <span class=\"p17\">Lean Code is Poetry in Motion<\/span>. I believe I still hold the record at RIT for the fewest statements required to run a test problem in Fortran.<\/p>\r\nNow, the plugin does this:\r\n\r\n<img decoding=\"async\" class=\"size-full wp-image-2063\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 10px 0 0 15px;\" title=\"All Three Menus Stacked, Compressed and Fixed - Left\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-1.jpg\" alt=\"All Three Menus Stacked, Compressed and Fixed\" \/>\r\n<img decoding=\"async\" class=\"size-full wp-image-2069\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"All Three Menus Stacked, Compressed and Fixed - Right\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-2.jpg\" alt=\"All Three Menus Stacked, Compressed and Fixed\" \/>\r\n<blockquote style=\"margin-top: 0;\">Admin Bar On\r\nOzh' Admin Drop Down Menu On<\/blockquote>\r\n<div style=\"height: 10px;\"><\/div>\r\n<img decoding=\"async\" class=\"size-full wp-image-2068\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"Admin Bar Off, Menus Stacked, Compressed and Fixed - Left\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-3.jpg\" alt=\"Admin Bar Off, Menus Stacked, Compressed and Fixed\" \/>\r\n<img decoding=\"async\" class=\"size-full wp-image-2067\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"Admin Bar Off, Menus Stacked, Compressed and Fixed - Right\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-4.jpg\" alt=\"Admin Bar Off, Menus Stacked, Compressed and Fixed\" \/>\r\n<blockquote style=\"margin-top: 0;\">Admin Bar Off\r\nOzh' Admin Drop Down Menu On<\/blockquote>\r\n<div style=\"height: 10px;\"><\/div>\r\n<img decoding=\"async\" class=\"size-full wp-image-2066\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"Admin Bar On, Admin Menu Stacked, Compressed and Fixed - Left\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-5.jpg\" alt=\"Admin Bar On, Admin Menu Stacked, Compressed and Fixed\" \/>\r\n<img decoding=\"async\" class=\"size-full wp-image-2065\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"Admin Bar On, Admin Menu Stacked, Compressed and Fixed - Right\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-6.jpg\" alt=\"Admin Bar On, Admin Menu Stacked, Compressed and Fixed\" \/>\r\n<blockquote style=\"margin-top: 0;\">Admin Bar On\r\nOzh' Admin Drop Down Menu Off\r\nMain Navigation On<\/blockquote>\r\n<div style=\"height: 10px;\"><\/div>\r\n<img decoding=\"async\" class=\"size-full wp-image-2064\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"Admin Menu Compressed and Fixed - Left\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-7.jpg\" alt=\"Admin Menu Compressed and Fixed\" \/>\r\n<img decoding=\"async\" class=\"size-full wp-image-2070\" style=\"width: 525px; height: 111px; padding: 1px; border: 3px double #999; margin: 0 0 0 15px;\" title=\"Admin Menu Compressed and Fixed - Right\" src=\"\/\/blog.imperialearth.com\/wp-content\/uploads\/sites\/6\/2011\/03\/screenshot-8.jpg\" alt=\"Admin Menu Compressed and Fixed\" \/>\r\n<blockquote style=\"margin-top: 0;\">Admin Bar Off\r\nOzh' Admin Drop Down Menu Off\r\nMain Navigation On<\/blockquote>\r\n<div style=\"height: 10px;\"><\/div>\r\nI love it when a plan comes together. Solved a natty problem <span class=\"bold ital\">and<\/span> made it more functional. Sequence or combination matters no longer. It's actually fun to watch it work. Well, it is for me, anyway. Check it out. Let me know how it works for you and if there's anything I could improve upon.\r\n<p class=\"p18 bold\"><a href=\"\/\/wordpress.org\/extend\/plugins\/admin-menus-fixed\/\" rel=\"nofollow\">Download the latest version at The WordPress.org Plugin Directory.<\/a><\/p>\r\nI hope you enjoy it. And, as always, Thanks to <a href=\"\/\/planetozh.com\/\" rel=\"nofollow\">Ozh<\/a> for encouraging me to jump in and write this. I've got a lot to learn to even approach where he is in PHP but, ya gotta start somewhere. May as well be something fun <span class=\"p13\">(and small)<\/span>.\r\n\r\nIf you have feedback, a support request or just wish to ask a question about this plugin, please enter a comment. And, if you'd like to help a real starving artist, <a class=\"bold\" href=\"\/\/sphericalmagic.com\/plugins\/\">please buy us some cat food<\/a> for our <a class=\"bold\" href=\"\/\/bengalmania.org\/\">Bengal and Maine Coon rescues<\/a>. Thank You.\r\n<div class=\"bold\" style=\"text-align: right; margin-bottom: 10px;\"><a href=\"\/wordpress\/fixed-admin-menus-the-plugin-enhanced\/\">Read About The New Version for WordPress 3.2+<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p class=\"descender\">Short time between initial plugin release and the first update but it had to be done... and quick. Downloads of the first <span class=\"ital\">Admin Menus Fixed<\/span> version were chugging along nicely for a number of days, with no reports of bugs, etc. Then, while researching why <span class=\"ital\">Popular Posts<\/span> was suddenly returning no results by deactivating recently updated plugins, one-by-one, to try to sort out if there were a<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4521,4516],"tags":[4522,202,4523,6920,4517],"series":[],"class_list":["post-2939","post","type-post","status-publish","format-standard","hentry","category-plugin","category-wordpress","tag-code","tag-computer","tag-css","tag-plugin","tag-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fixed Admin Menus \u2014 The Plugin Expanded \u00bb Spherical.org Blogs<\/title>\n<meta name=\"description\" content=\"Sometimes, a Good Thing can be improved upon.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"BJ Johnson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/\"},\"author\":{\"name\":\"BJ Johnson\",\"@id\":\"https:\/\/spherical.org\/#\/schema\/person\/ed2c916c9502626ad8c68342c5141ce0\"},\"headline\":\"Fixed Admin Menus \u2014 The Plugin Expanded\",\"datePublished\":\"2011-03-20T23:55:25+00:00\",\"dateModified\":\"2022-12-17T22:43:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/\"},\"wordCount\":664,\"publisher\":{\"@id\":\"https:\/\/spherical.org\/#organization\"},\"keywords\":[\"code\",\"computer\",\"css\",\"plugin\",\"programming\"],\"articleSection\":[\"plugin\",\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/\",\"url\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/\",\"name\":\"Fixed Admin Menus \u2014 The Plugin Expanded \u00bb Spherical.org Blogs\",\"isPartOf\":{\"@id\":\"https:\/\/spherical.org\/#website\"},\"datePublished\":\"2011-03-20T23:55:25+00:00\",\"dateModified\":\"2022-12-17T22:43:30+00:00\",\"description\":\"Sometimes, a Good Thing can be improved upon.\",\"breadcrumb\":{\"@id\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/spherical.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixed Admin Menus \u2014 The Plugin Expanded\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/spherical.org\/#website\",\"url\":\"https:\/\/spherical.org\/\",\"name\":\"Spherical.org\",\"description\":\"Home of Beautiful Artist Weblogs\",\"publisher\":{\"@id\":\"https:\/\/spherical.org\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/spherical.org\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/spherical.org\/#organization\",\"name\":\"Spherical.org\",\"url\":\"https:\/\/spherical.org\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/spherical.org\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/spherical.org\/wp-content\/uploads\/2025\/04\/sphericalogo173.webp\",\"contentUrl\":\"https:\/\/spherical.org\/wp-content\/uploads\/2025\/04\/sphericalogo173.webp\",\"width\":173,\"height\":143,\"caption\":\"Spherical.org\"},\"image\":{\"@id\":\"https:\/\/spherical.org\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/spherical.org\/#\/schema\/person\/ed2c916c9502626ad8c68342c5141ce0\",\"name\":\"BJ Johnson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/spherical.org\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b0f61fddef379dd5317c8e367a4d9b3d7cd58ff7a4058d359588eccc70266a88?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b0f61fddef379dd5317c8e367a4d9b3d7cd58ff7a4058d359588eccc70266a88?s=96&d=mm&r=g\",\"caption\":\"BJ Johnson\"},\"description\":\"An Artist-Engineer working in multiple disciplines: Glass Sculpture, 3D Modeling, Rendering &amp; Animation, Product Design, Technical Illustration &amp; ArchViz, Design &amp; Construction of Kinetic Structures employing exotic materials \u2014 predominantly for the Aerospace sector. Not a day goes by that I don't learn something new.\",\"sameAs\":[\"https:\/\/sphericalmagic.com\/\",\"https:\/\/x.com\/BJ_Johnson\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fixed Admin Menus \u2014 The Plugin Expanded \u00bb Spherical.org Blogs","description":"Sometimes, a Good Thing can be improved upon.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/","twitter_misc":{"Written by":"BJ Johnson","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/#article","isPartOf":{"@id":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/"},"author":{"name":"BJ Johnson","@id":"https:\/\/spherical.org\/#\/schema\/person\/ed2c916c9502626ad8c68342c5141ce0"},"headline":"Fixed Admin Menus \u2014 The Plugin Expanded","datePublished":"2011-03-20T23:55:25+00:00","dateModified":"2022-12-17T22:43:30+00:00","mainEntityOfPage":{"@id":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/"},"wordCount":664,"publisher":{"@id":"https:\/\/spherical.org\/#organization"},"keywords":["code","computer","css","plugin","programming"],"articleSection":["plugin","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/","url":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/","name":"Fixed Admin Menus \u2014 The Plugin Expanded \u00bb Spherical.org Blogs","isPartOf":{"@id":"https:\/\/spherical.org\/#website"},"datePublished":"2011-03-20T23:55:25+00:00","dateModified":"2022-12-17T22:43:30+00:00","description":"Sometimes, a Good Thing can be improved upon.","breadcrumb":{"@id":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/spherical.org\/wordpress\/fixed-admin-menus-the-plugin-expanded\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/spherical.org\/"},{"@type":"ListItem","position":2,"name":"Fixed Admin Menus \u2014 The Plugin Expanded"}]},{"@type":"WebSite","@id":"https:\/\/spherical.org\/#website","url":"https:\/\/spherical.org\/","name":"Spherical.org","description":"Home of Beautiful Artist Weblogs","publisher":{"@id":"https:\/\/spherical.org\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/spherical.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/spherical.org\/#organization","name":"Spherical.org","url":"https:\/\/spherical.org\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/spherical.org\/#\/schema\/logo\/image\/","url":"https:\/\/spherical.org\/wp-content\/uploads\/2025\/04\/sphericalogo173.webp","contentUrl":"https:\/\/spherical.org\/wp-content\/uploads\/2025\/04\/sphericalogo173.webp","width":173,"height":143,"caption":"Spherical.org"},"image":{"@id":"https:\/\/spherical.org\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/spherical.org\/#\/schema\/person\/ed2c916c9502626ad8c68342c5141ce0","name":"BJ Johnson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/spherical.org\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b0f61fddef379dd5317c8e367a4d9b3d7cd58ff7a4058d359588eccc70266a88?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0f61fddef379dd5317c8e367a4d9b3d7cd58ff7a4058d359588eccc70266a88?s=96&d=mm&r=g","caption":"BJ Johnson"},"description":"An Artist-Engineer working in multiple disciplines: Glass Sculpture, 3D Modeling, Rendering &amp; Animation, Product Design, Technical Illustration &amp; ArchViz, Design &amp; Construction of Kinetic Structures employing exotic materials \u2014 predominantly for the Aerospace sector. Not a day goes by that I don't learn something new.","sameAs":["https:\/\/sphericalmagic.com\/","https:\/\/x.com\/BJ_Johnson"]}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/posts\/2939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/comments?post=2939"}],"version-history":[{"count":5,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/posts\/2939\/revisions"}],"predecessor-version":[{"id":4624,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/posts\/2939\/revisions\/4624"}],"wp:attachment":[{"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/media?parent=2939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/categories?post=2939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/tags?post=2939"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/spherical.org\/wp-json\/wp\/v2\/series?post=2939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}