{"id":5066,"date":"2026-08-30T05:00:32","date_gmt":"2026-08-29T20:00:32","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/wp-admin-autosave-mind-map-plugin-2\/"},"modified":"2026-08-30T05:00:33","modified_gmt":"2026-08-29T20:00:33","slug":"wp-admin-autosave-mind-map-plugin","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/wordpress-blog-seo\/wp-admin-autosave-mind-map-plugin\/","title":{"rendered":"Mind Elixir \u00d7 Custom WordPress Plugin: Adding a 5-Minute Auto-Save Feature"},"content":{"rendered":"<p class=\"\">This article explains the steps to add an auto-save feature to the &#8220;Mind Elixir Admin&#8221; plugin, which integrates mind maps into the WordPress dashboard. We will introduce how to set up an &#8220;Enable Auto-Save&#8221; checkbox on the PHP side, and have JavaScript automatically click the existing save button (<code>#save-map-button<\/code>) every 5 minutes.<\/p>\n<hr class=\"\" \/>\n<h2 class=\"\">Introduction<\/h2>\n<ul>\n<li class=\"\">\n<p class=\"\"><strong>Background &#038; Objectives<\/strong><\/p>\n<ul>\n<li class=\"\">\n<p class=\"\">To improve the usability of the previously created mind map plugin for the WordPress dashboard, we want to implement an auto-save feature.<br \/>\n<a href=\"https:\/\/donguri3.net\/server-tech\/wp-admin-mind-map-plugin\/\">I tried making a plugin to jot down article ideas using mind maps in the WordPress dashboard (Japanese)<\/a><br \/>\n<a href=\"https:\/\/donguri3.net\/server-tech\/wp-admin-multi-mind-map-plugin\/\">I tried expanding the plugin to save, switch, and delete multiple mind maps in the WordPress dashboard (Japanese)<\/a><\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">By automatically calling the same processing as manual saves, we reduce user effort and prevent data loss.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr class=\"\" \/>\n<h2 class=\"\">Implementation Overview<\/h2>\n<ol>\n<li class=\"\">\n<p class=\"\"><strong>PHP Side<\/strong><\/p>\n<ul>\n<li class=\"\">\n<p class=\"\">Output a checkbox and set it to ON by default using <code>checked()<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li class=\"\">\n<p class=\"\"><strong>JavaScript Side<\/strong><\/p>\n<ul>\n<li class=\"\">Execute <code>$('#save-map-button').trigger('click')<\/code> every 5 minutes using <code>setInterval()<\/code>.<\/li>\n<li class=\"\">\n<p class=\"\">Directly invoke the button&#8217;s normal click handler to perform an Ajax save.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr class=\"\" \/>\n<h2 class=\"\">Code Explanation Highlights<\/h2>\n<ul>\n<li class=\"\">\n<p class=\"\"><strong>Simple Reuse<\/strong><br \/>By reusing the same save button click event for both manual and automatic saves, maintainability is improved.<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\"><strong>Reflecting User Settings<\/strong><br \/>Control the flag via a checkbox, allowing easy ON\/OFF toggling on the JS side.<\/p>\n<\/li>\n<\/ul>\n<hr class=\"\" \/>\n<h2>Code<\/h2>\n<p>The code is publicly available on GitHub.<br \/>\n<a href=\"https:\/\/github.com\/bomura\/wp-mind-elixir-admin\/commit\/638433fe70356ca1d741584d7535d7fe50ea84b7\">Add auto-save feature every 5 minutes \u00b7 bomura\/wp-mind-elixir-admin@638433f<\/a><\/p>\n<h2 class=\"\">Summary &#038; Future Expansion Ideas<\/h2>\n<ul>\n<li class=\"\">\n<p class=\"\">With this method, mind maps can now be saved automatically every 5 minutes.<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\"><strong>Expansion Ideas<\/strong><\/p>\n<ul>\n<li class=\"\">\n<p class=\"\">Allow the save interval to be configurable from the dashboard<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">Change save completion notifications to toast alerts<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">Combine with local storage backup<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"\">Feel free to use this implementation as a base to build a more comfortable mind map editing environment!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article explains the steps to add an auto-save feature to the &#8220;Mind Elixir Admin&#8221; plugin, whi [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1534,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=1531","footnotes":""},"categories":[1166],"tags":[51,534,61,576,251,179,153,533,278,585],"class_list":["post-5066","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-blog-seo","tag-git","tag-mind-elixir","tag-wordpress","tag-wordpress-","tag-251","tag-179","tag-153","tag-533","tag-278","tag-585","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5066"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5066\/revisions"}],"predecessor-version":[{"id":5069,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5066\/revisions\/5069"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/1534"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}