{"id":33392,"date":"2014-12-18T05:25:47","date_gmt":"2014-12-18T05:25:47","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/kwik-framework\/"},"modified":"2016-01-20T22:38:34","modified_gmt":"2016-01-20T22:38:34","slug":"kwik-framework","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/kwik-framework\/","author":1978455,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.5.7","stable_tag":"trunk","tested":"4.4.34","requires":"3.8","requires_php":"","requires_plugins":"","header_name":"Kwik Framework","header_author":"Kevin Chappell","header_description":"","assets_banners_color":"","last_updated":"2016-01-20 22:38:34","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/kevinchappell.github.io\/kwik-framework\/","header_author_uri":"http:\/\/kevin-chappell.com","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1280,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[9768,3002,2218,1253,241],"plugin_category":[43],"plugin_contributors":[129971],"plugin_business_model":[],"class_list":["post-33392","plugin","type-plugin","status-publish","hentry","plugin_tags-common","plugin_tags-framework","plugin_tags-options","plugin_tags-settings","plugin_tags-widgets","plugin_category-customization","plugin_contributors-kevinchappell","plugin_committers-kevinchappell"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/kwik-framework.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Kwik Framework is a framework for <strong>rapid<\/strong> development of WordPress themes and Plugins. It lets you quickly create option pages with dynamic error handling, programmatically generate markup where needed and provides custom inputs for your theme or plugin.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>Simply installing the plugin provides a robust API that lets you quickly create settings pages for you plugin or theme.<\/p>\n\n<h4>Generating Setting Page<\/h4>\n\n<pre><code>add_action( 'admin_menu', 'my_plugin_add_admin_menu' );\nadd_action( 'admin_init', 'my_plugin_settings_init' );\n\nfunction my_plugin_add_admin_menu() {\n \/\/ add_submenu_page( 'edit.php?post_type=kwik-framework', __('Kwik Framework Settings', 'kwik'), __('Settings', 'kwik'), 'manage_options', 'kwik_framework', 'my-plugin' );\n add_options_page('Kwik Framework Settings', 'Kwik Framework', 'manage_options', 'my-plugin', 'my-plugin'.'_settings');\n}\n\nfunction my_plugin_settings_init() {\n $kwik_settings = new KwikSettings();\n $defaultSettings = my_plugin_default_options();\n $kwik_settings-&gt;settings_init(MyPlugin, 'my-plugin', $defaultSettings);\n}\n\nfunction kwik_framework_settings() {\n $settings = my_plugin_get_options();\n echo '&lt;div class=\"wrap\"&gt;';\n   echo KwikInputs::markup('h2', __('Framework Settings', 'kwik'));\n   echo KwikInputs::markup('p', __('Set the API keys and other options for your website. Kwik Framework needs these settings to connect to Google fonts and other APIs.','kwik'));\n   echo '&lt;form action=\"options.php\" method=\"post\"&gt;';\n     settings_fields('my-plugin');\n     echo KwikSettings::settings_sections('my-plugin', $settings);\n   echo '&lt;\/form&gt;';\n echo '&lt;\/div&gt;';\n}\n\nfunction my_plugin_get_options() {\n return get_option('my-plugin', my_plugin_default_options());\n}\n\nfunction my_plugin_default_options() {\n $my_plugin_default_options = array(\n   'section_1' =&gt; array(\n     'section_title' =&gt; __('Section One', 'kwik'),\n     'section_desc' =&gt; __('This is the description for section one.', 'kwik'),\n     'settings' =&gt; array(\n       'sec_1_first_option' =&gt; array(\n         'type' =&gt; 'text',\n         'title' =&gt; __('First Option', 'kwik'),\n         'value' =&gt; ''\n       ),\n       'sec_2_second_option' =&gt; array(\n         'type' =&gt; 'text',\n         'title' =&gt; __('Second Option', 'kwik'),\n         'value' =&gt; ''\n       )\n     )\n   ),\n   'section_2' =&gt; array(\n     'section_title' =&gt; __('Section Two', 'kwik'),\n     'section_desc' =&gt; __('This is the description for section two.', 'kwik'),\n     'settings' =&gt; array(\n       'sec_2_first_option' =&gt; array(\n         'type' =&gt; 'text',\n         'title' =&gt; __('Option One Title', 'kwik'),\n         'value' =&gt; ''\n       ),\n       'sec_2_second_option' =&gt; array(\n         'type' =&gt; 'text',\n         'title' =&gt; __('Option Two Title', 'kwik'),\n         'value' =&gt; ''\n       )\n     )\n   )\n );\n\n return apply_filters('my_plugin_default_options', $kf_default_options);\n}\n<\/code><\/pre>\n\n<p>That's it. The above code block will add a new options page to your theme or plugin with automatic field validation. In this example, options are added to the <code>my_plugin_default_options<\/code> multi-dimensional array. Type is defined as the input type to be used such as <code>text<\/code> and <code>select<\/code> but Kwik Framework also provides the following custom types <code>img<\/code>, <code>font<\/code>, <code>toggle<\/code>, <code>color<\/code>, <code>link<\/code>, <code>spinner<\/code> and <code>nonce<\/code>. The custom inputs can be easily extended using the <code>input<\/code> or <code>multi<\/code> types and supplying your own attributes.<\/p>\n\n<h4>Generating markup<\/h4>\n\n<pre><code>$inputs = new KwikInputs();\n\n$link = $inputs-&gt;markup('a', \"This is a link\", array(\"class\" =&gt; \"test_link\", href=\"http:\/\/test-site.com\", \"title\" =&gt; \"Test Title\"));\n\necho $link;\n<\/code><\/pre>\n\n<h3>Widgets<\/h3>\n\n<h4>Latest Posts<\/h4>\n\n<p>Displays a list of posts. Features:<\/p>\n\n<ul>\n<li>Filter by category and tag<\/li>\n<li>date and read more formatting<\/li>\n<li>numerous options<\/li>\n<\/ul>","raw_excerpt":"Kwik Framework is a framework for rapid development of WordPress themes and Plugins. It lets you quickly create option pages with dynamic error handli &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/33392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=33392"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kevinchappell"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=33392"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=33392"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=33392"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=33392"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=33392"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=33392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}