{"id":33327,"date":"2014-12-10T11:30:07","date_gmt":"2014-12-10T11:30:07","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/register-settings-api\/"},"modified":"2014-12-31T20:30:07","modified_gmt":"2014-12-31T20:30:07","slug":"register-settings-api","status":"publish","type":"plugin","link":"https:\/\/gl.wordpress.org\/plugins\/register-settings-api\/","author":219229,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.4","stable_tag":"1.4","tested":"4.1.42","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"Register Settings API","header_author":"Jens T\u00f6rnell","header_description":"","assets_banners_color":"","last_updated":"2014-12-31 20:30:07","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/www.wp-load.com","header_author_uri":"http:\/\/www.jenst.se","rating":5,"author_block_rating":0,"active_installs":10,"downloads":1973,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"2"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3","1.4"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1049388","resolution":"1","location":"assets"}},"screenshots":{"1":"Full example. This is what it creates. Much more types than this available."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[83,2218,39371,2797],"plugin_category":[],"plugin_contributors":[81763],"plugin_business_model":[],"class_list":["post-33327","plugin","type-plugin","status-publish","hentry","plugin_tags-admin","plugin_tags-options","plugin_tags-settings-api","plugin_tags-wp-admin","plugin_contributors-jenst","plugin_committers-jenst"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/register-settings-api.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/register-settings-api\/assets\/screenshot-1.png?rev=1049388","caption":"Full example. This is what it creates. Much more types than this available."}],"raw_content":"<!--section=description-->\n<p>Add settings to your own theme or plugin. As simple as writing an array.<\/p>\n\n<p>Full documentation at: http:\/\/www.wp-load.com\/register-settings-api\/<\/p>\n\n<h4>Benefits of the plugin<\/h4>\n\n<ul>\n<li>Work fine as a plugin OR as included to your theme or plugin.<\/li>\n<li>Everything you need is in one single file.<\/li>\n<li>No more fighting the settings API. Just add your settings and you are done.<\/li>\n<li>Tinymce, textarea, checkboxes, radio buttons, url, color, email supported.<\/li>\n<li>It will from the array create a menu and a settings page with tabs and fields.<\/li>\n<\/ul>\n\n<h4>Full example, placed in functions.php OR your plugin<\/h4>\n\n<pre><code>add_filter('register_settings_api', 'settings_array');\n\nfunction settings_array( $options_page ) {\n    $options_page['my-menu-slug'] = array(\n        'menu_title' =&gt; 'My menu',\n        'page_title' =&gt; 'My page',\n        'option_name' =&gt; 'my_options_slug',\n        'tabs' =&gt; array(\n            'first' =&gt; array(\n                'tab_title' =&gt; 'My first tab',\n                'fields' =&gt; array(\n                    'my_editor' =&gt; array(\n                        'type' =&gt; 'tinymce',\n                        'title' =&gt; 'My editor'\n                    ),\n                    'my_color' =&gt; array(\n                        'type' =&gt; 'color',\n                        'title' =&gt; 'My color'\n                    )\n                ),\n            ),\n            'second' =&gt; array(\n                'tab_title' =&gt; 'My second tab',\n                'fields' =&gt; array(\n                    'my_textarea' =&gt; array(\n                        'type' =&gt; 'textarea',\n                        'title' =&gt; 'My textarea'\n                    )\n                )\n            )\n        )\n    );\n    return $options_page;\n}\n<\/code><\/pre>\n\n<!--section=installation-->\n<p>To use as a plugin:<\/p>\n\n<ol>\n<li>Upload <code>register-settings-api<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Place the array code (described in another tab) in your functions.php file OR in your plugin<\/li>\n<\/ol>\n\n<p>To use as a class:<\/p>\n\n<ol>\n<li>Upload <code>register-settings-api.php<\/code> into your theme or plugin and include it<\/li>\n<li>Remove the comment on the top and only keep the class. Else it might belive it's a plugin<\/li>\n<li>It's recommended to rename the class, the instance and the class_exists class to prevent collision with other plugins<\/li>\n<li>Place the array code (described in another tab) in your functions.php file OR in your plugin<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Why use this plugin when there are a settings API that work fine?<\/dt>\n<dd><p>Speed. It should take just a few minues to set up a whole lot of settings for your plugin or theme.<\/p><\/dd>\n<dt>What makes this better than other plugins like this?<\/dt>\n<dd><p>Simplicity. It's one file to include (if not using the plugin directly). There is one array to write.<\/p><\/dd>\n<dt>I want an advanced settings page not looking like default WordPress style. Is this plugin for me?<\/dt>\n<dd><p>No, probably not. This plugin makes it simple to set up tabs with settings the \"default\" way, not that much more. It's made for speed not complexity.<\/p><\/dd>\n<dt>I don't see any tabs. Why not?<\/dt>\n<dd><p>If you only created ONE tab there are no meaning of adding tabs. Then it will not add the tabs. You need two or more tabs to get them visible.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4<\/h4>\n\n<ul>\n<li>Many bug fixes<\/li>\n<li>Array values \"tab_description\", \"before_tabs_text\" and \"after_tabs_text\" added<\/li>\n<li>\"button\" and \"custom\" field type added<\/li>\n<li>\"Get\" now supports args<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Minor bug fixes<\/li>\n<li>Change color field type to colorpicker to prevent collision with html5 color field.<\/li>\n<li>Change date field type to datepicker to prevent collision with html5 color field.<\/li>\n<li>Added color (html5) field type<\/li>\n<li>Added date (html5)field type<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Fixed bug with color field, JS error in some cases<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Warnings: More checks, less warnings<\/li>\n<li>Title: Before it was named \"description\". It's used in the column to the left<\/li>\n<li>Description: It's used below the field<\/li>\n<li>Empty: Add empty option to select boxes<\/li>\n<li>Default: Add default value when no value is saved<\/li>\n<li>Size: Added size to textarea, tinymce and multiselect<\/li>\n<li>Get: Select dynamic values like posts, users, plugins, themes, menus, terms, taxonomies, sidebars, post_types<\/li>\n<li>New types: image, file, date, multiselect<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Add settings to your own theme or plugin. As simple as writing an array.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/33327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=33327"}],"author":[{"embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jenst"}],"wp:attachment":[{"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=33327"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=33327"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=33327"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=33327"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=33327"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/gl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=33327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}