{"id":698,"date":"2017-04-20T15:21:56","date_gmt":"2017-04-20T19:21:56","guid":{"rendered":"https:\/\/2017.kent.wordcamp.org\/?post_type=wcb_session&#038;p=698"},"modified":"2017-04-20T15:21:56","modified_gmt":"2017-04-20T19:21:56","slug":"one-plugin-to-rule-all-your-custom-code","status":"publish","type":"wcb_session","link":"https:\/\/kent.wordcamp.org\/2017\/session\/one-plugin-to-rule-all-your-custom-code\/","title":{"rendered":"One plugin to rule all your custom code"},"content":{"rendered":"<p>During the redesign\/development of a site and migration to WordPress, we ended up creating a custom plugin, after custom plugin to handle various post types and other custom functionality.  After a period of a few months it became evident that we had too many plugins, updating code was beginning to become a logistical nightmare, not to mention some things didn&#8217;t really constitute a full plugin.  While tweaking some JetPack settings one day, I thought to myself how can I emulate the JetPack feature manage page, with our own plugins.  I remembered a session from a previous WordCamp about the Custom Fields API and set out to create my own merged plugin.<\/p>\n<p>In this session I&#8217;ll describe some of the custom code challenges we had, and how I used the Settings and Options APIs to create a control panel to enable and disable specific plugin features.  The control panel allows the site to turn on or off specific sections of the plugin.  I also added in a default features section for features that should always be on.<\/p>\n<p>I&#8217;ll walk through the code, show the basics of how to create a version of your own, and answer any questions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During the redesign\/development of a site and migration to WordPress, we ended up creating a custom plugin, after custom plugin to handle various post types and other custom functionality. After a period of a few months it became evident that we had too many plugins, updating code was beginning to become a logistical nightmare, not &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/kent.wordcamp.org\/2017\/session\/one-plugin-to-rule-all-your-custom-code\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;One plugin to rule all your custom code&#8221;<\/span><\/a><\/p>\n","protected":false},"author":13731663,"featured_media":0,"template":"","meta":{"jetpack_post_was_ever_published":false,"_wcpt_session_time":1498332600,"_wcpt_session_duration":3000,"_wcpt_session_type":"session","_wcpt_session_slides":"","_wcpt_session_video":"","_wcpt_speaker_id":[697],"footnotes":""},"session_track":[790372],"session_category":[],"class_list":["post-698","wcb_session","type-wcb_session","status-publish","hentry","wcb_track-kent-ballroom"],"jetpack_sharing_enabled":false,"jetpack_shortlink":"https:\/\/wp.me\/p7HvXt-bg","session_date_time":{"date":"June 24, 2017","time":"3:30 pm"},"session_speakers":[{"id":"697","slug":"joe-querin","name":"Joe Querin","link":"https:\/\/kent.wordcamp.org\/2017\/speaker\/joe-querin\/"}],"session_cats_rendered":null,"_links":{"self":[{"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions"}],"about":[{"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/types\/wcb_session"}],"version-history":[{"count":1,"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions\/698\/revisions"}],"predecessor-version":[{"id":985,"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/sessions\/698\/revisions\/985"}],"speakers":[{"embeddable":true,"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/speakers\/697"}],"author":[{"embeddable":true,"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wporg\/v1\/users\/joecue"}],"wp:attachment":[{"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"wcb_track","embeddable":true,"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/session_track?post=698"},{"taxonomy":"wcb_session_category","embeddable":true,"href":"https:\/\/kent.wordcamp.org\/2017\/wp-json\/wp\/v2\/session_category?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}