{"id":51,"date":"2016-01-07T19:59:57","date_gmt":"2016-01-07T19:59:57","guid":{"rendered":"https:\/\/easydigitaldownloads.com\/development\/?p=51"},"modified":"2021-12-15T15:32:27","modified_gmt":"2021-12-15T21:32:27","slug":"updating-extension-settings-for-subsections-in-2-5","status":"publish","type":"post","link":"https:\/\/easydigitaldownloads.com\/development\/2016\/01\/07\/updating-extension-settings-for-subsections-in-2-5\/","title":{"rendered":"Updating extension settings for subsections in 2.5"},"content":{"rendered":"<p>In <a href=\"https:\/\/easydigitaldownloads.com\/?p=697814\">Easy Digital Downloads 2.5<\/a>, we introduced a new organizational structure for our settings screen. Previously, settings were handled with a tabbed system in which each tab contained all related core settings. There was also an Extensions tab that contained all settings for any activated extensions on a single page.<\/p>\n<h3>Subsections in 2.5<\/h3>\n<p>Now in 2.5, you&#8217;ll notice that we&#8217;ve separated out our core settings into more manageable subsections, allowing users to find what they&#8217;re looking for more quickly and easily.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-52\" src=\"https:\/\/easydigitaldownloads.com\/development\/files\/2016\/01\/Screen-Shot-2016-01-07-at-8.57.36-AM.png\" alt=\"Screen Shot 2016-01-07 at 8.57.36 AM\" width=\"832\" height=\"105\" srcset=\"https:\/\/easydigitaldownloads.com\/development\/files\/2016\/01\/Screen-Shot-2016-01-07-at-8.57.36-AM.png 832w, https:\/\/easydigitaldownloads.com\/development\/files\/2016\/01\/Screen-Shot-2016-01-07-at-8.57.36-AM-300x38.png 300w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/p>\n<p>Not only has this made it easier for us to organize our settings, it also enables extension developers to register their own through a few filters.<\/p>\n<p>So now that you&#8217;ve seen how much easier this is to use for our users, here&#8217;s how you can integrate your extensions with it.<\/p>\n<h3>Integrating with the EDD 2.5 Subsections<\/h3>\n<p>In order to register your subsection and your settings, you&#8217;ll need to write two functions. The first to register your subsection with a tab, and the second to register all your settings fields.<\/p>\n<h4>Registering your Subsection and Settings<\/h4>\n<p>Each tab has a filter to register subsections with. They are:<\/p>\n<ul>\n<li>edd_settings_sections_general<\/li>\n<li>edd_settings_sections_gateways<\/li>\n<li>edd_settings_sections_emails<\/li>\n<li>edd_settings_sections_styles<\/li>\n<li>edd_settings_sections_taxes<\/li>\n<li><strong>edd_settings_sections_extensions<\/strong><\/li>\n<li>edd_settings_sections_misc<\/li>\n<\/ul>\n<p>As an example we&#8217;ll use the <em>Extensions<\/em> tab and register our own subsection with the highlighted filter above:<br \/>\nhttps:\/\/gist.github.com\/cklosowski\/0f0d605942e5372d4a41<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-53\" src=\"https:\/\/easydigitaldownloads.com\/development\/files\/2016\/01\/Screen-Shot-2016-01-07-at-9.33.05-AM.png\" alt=\"Screen Shot 2016-01-07 at 9.33.05 AM\" width=\"742\" height=\"298\" srcset=\"https:\/\/easydigitaldownloads.com\/development\/files\/2016\/01\/Screen-Shot-2016-01-07-at-9.33.05-AM.png 742w, https:\/\/easydigitaldownloads.com\/development\/files\/2016\/01\/Screen-Shot-2016-01-07-at-9.33.05-AM-300x120.png 300w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<h3>Updating your Extensions<\/h3>\n<p>In order to provide a consistent user experience we encourage developers to update their extensions to use this new feature, and we will be following suit by working to get our extensions updated as soon as possible. With the provided example, the subsection system is backwards compatible with EDD Versions prior to 2.5.<\/p>\n<p>If you have any questions on integrating with subsections, please feel free to reach out to us in the comments below.<\/p>\n<p class=\"edd-alert edd-alert-info\">The development team would like to thank <a href=\"https:\/\/twitter.com\/benjaminprojas\">Benjamin Rojas<\/a> for the initial work on the subsections feature<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Easy Digital Downloads 2.5, we introduced a new organizational structure for our settings screen. Previously, settings were handled with a tabbed system in which each tab contained all related core settings. There was also&#8230;<\/p>\n<p class=\"continue-reading\"><a class=\"more-link\" href=\"https:\/\/easydigitaldownloads.com\/development\/2016\/01\/07\/updating-extension-settings-for-subsections-in-2-5\/\">Continue reading &rarr;<\/a><\/p>\n","protected":false},"author":650,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,3],"tags":[6],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-core","category-extensions","tag-2-5"],"_links":{"self":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/users\/650"}],"replies":[{"embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":1,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":1125,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/51\/revisions\/1125"}],"wp:attachment":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}