{"id":30817,"date":"2014-07-24T23:03:42","date_gmt":"2014-07-24T23:03:42","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/cfs-options-screens\/"},"modified":"2022-02-10T17:11:45","modified_gmt":"2022-02-10T17:11:45","slug":"cfs-options-screens","status":"publish","type":"plugin","link":"https:\/\/hat.wordpress.org\/plugins\/cfs-options-screens\/","author":1869526,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.7","stable_tag":"1.2.7","tested":"5.9.0","requires":"3.9","requires_php":"","requires_plugins":"","header_name":"CFS Options Screens","header_author":"Jonathan Christopher","header_description":"","assets_banners_color":"","last_updated":"2022-02-10 17:11:45","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/mondaybynoon.com\/donate\/","header_plugin_uri":"http:\/\/wordpress.org\/plugins\/cfs-options-screens\/","header_author_uri":"http:\/\/mondaybynoon.com\/","rating":5,"author_block_rating":0,"active_installs":400,"downloads":6890,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"jchristopher","date":"2014-07-24 23:08:02"},"1.0.1":{"tag":"1.0.1","author":"jchristopher","date":"2015-04-20 20:27:03"},"1.0.2":{"tag":"1.0.2","author":"jchristopher","date":"2015-05-05 20:37:42"},"1.0.3":{"tag":"1.0.3","author":"jchristopher","date":"2015-10-27 18:25:50"},"1.1":{"tag":"1.1","author":"jchristopher","date":"2015-10-27 20:14:44"},"1.1.1":{"tag":"1.1.1","author":"jchristopher","date":"2015-12-09 20:41:56"},"1.1.2":{"tag":"1.1.2","author":"jchristopher","date":"2015-12-10 14:18:13"},"1.2":{"tag":"1.2","author":"jchristopher","date":"2015-12-23 16:32:04"},"1.2.1":{"tag":"1.2.1","author":"jchristopher","date":"2015-12-30 15:19:22"},"1.2.2":{"tag":"1.2.2","author":"jchristopher","date":"2016-01-04 16:08:39"},"1.2.3":{"tag":"1.2.3","author":"jchristopher","date":"2016-01-04 17:23:40"},"1.2.4":{"tag":"1.2.4","author":"jchristopher","date":"2016-02-05 19:22:30"},"1.2.5":{"tag":"1.2.5","author":"jchristopher","date":"2016-02-11 20:45:39"},"1.2.6":{"tag":"1.2.6","author":"jchristopher","date":"2016-10-05 03:12:37"},"1.2.7":{"tag":"1.2.7","author":"jchristopher","date":"2022-02-10 17:11:45"}},"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.0.1","1.0.2","1.0.3","1.1","1.1.1","1.1.2","1.2","1.2.1","1.2.2","1.2.3","1.2.4","1.2.5","1.2.6","1.2.7"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[16902,15474,2218,3200,1253],"plugin_category":[],"plugin_contributors":[78453],"plugin_business_model":[],"class_list":["post-30817","plugin","type-plugin","status-publish","hentry","plugin_tags-cfs","plugin_tags-custom-field-suite","plugin_tags-options","plugin_tags-screen","plugin_tags-settings","plugin_contributors-jchristopher","plugin_committers-jchristopher"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/cfs-options-screens.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Build any number of options screens based on <a href=\"http:\/\/wordpress.org\/plugins\/custom-field-suite\/\">Custom Field Suite<\/a>.<\/p>\n\n<h4>For Example<\/h4>\n\n<p>Begin by creating Field Group(s) you want to include on your options screen. <strong>Be sure to set NO Placement Rules.<\/strong> Once it's created, note the post ID it uses. You can then register any number of options screens like so:<\/p>\n\n<pre><code>function my_cfs_options_screens( $screens ) {\n    $screens[] = array(\n        'name'            =&gt; 'options',\n        'menu_title'      =&gt; __( 'Site Options' ),\n        'page_title'      =&gt; __( 'Customize Site Options' ),\n        'menu_position'   =&gt; 100,\n        'icon'            =&gt; 'dashicons-admin-generic', \/\/ optional, dashicons-admin-generic is the default\n        'field_groups'    =&gt; array( 'My Field Group' ), \/\/ Field Group name(s) of CFS Field Group to use on this page (can also be post IDs)\n    );\n\n    return $screens;\n}\n\nadd_filter( 'cfs_options_screens', 'my_cfs_options_screens' );\n<\/code><\/pre>\n\n<h4>Retrieve your options like so:<\/h4>\n\n<pre><code>$value = cfs_get_option( 'options_screen_name', 'cfs_field_name_from_field_group' );\n<\/code><\/pre>\n\n<p>You can set up multiple top level and\/or children options pages by adding a <code>parent<\/code> argument when registering your screen:<\/p>\n\n<pre><code>function my_cfs_options_screens( $screens ) {\n\n    \/\/ Parent\n    $screens[] = array(\n        'name'         =&gt; 'options',\n        'field_groups' =&gt; array( 'My Parent Field Group Name' ),\n    );\n\n    \/\/ Child\n    $screens[] = array(\n        'name'         =&gt; 'options-nav',\n        'parent'       =&gt; 'options', \/\/ name of the parent\n        'field_groups' =&gt; array( 'My Child Field Group Name' ),\n    );\n\n    return $screens;\n }\n\n add_filter( 'cfs_options_screens', 'my_cfs_options_screens' );\n<\/code><\/pre>\n\n<p>You can also use CFS Options Screens to set up Field Group 'defaults', allowing a Field Group to appear both on a CFS Options Screen and a post edit screen. The CFS Options Screen will act as the default\/fallback and the post edit screen will override those defaults.<\/p>\n\n<pre><code>function my_cfs_options_screens( $screens ) {\n    $screens[] = array(\n        'name'            =&gt; 'options',\n        'menu_title'      =&gt; __( 'Site Options' ),\n        'page_title'      =&gt; __( 'Customize Site Options' ),\n        'menu_position'   =&gt; 100,\n        'icon'            =&gt; 'dashicons-admin-generic', \/\/ optional, dashicons-admin-generic is the default\n        'field_groups'    =&gt; array(\n            array(\n                'title'         =&gt; 'My CFS Field Group Name',\n                'has_overrides' =&gt; true,\n            ),\n        ),\n    );\n\n    return $screens;\n}\n\nadd_filter( 'cfs_options_screens', 'my_cfs_options_screens' );\n<\/code><\/pre>\n\n<p>Check out the <code>cfs_options_screens_override_note_default<\/code> and <code>cfs_options_screens_override_note_override<\/code> filters to customize the messaging for CFS Options Screens overrides.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>cfs-options-screens<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Register your options screen(s) using the code snippets from this readme<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='how%20do%20i%20add%20a%20field%20group%20to%20my%20options%20screen%3F'><h3>How do I add a Field Group to my options screen?<\/h3><\/dt>\n<dd><p>You must specify the Field Group Title(s) in the <code>field_groups<\/code> parameter when using the <code>cfs_options_screens<\/code> hook<\/p><\/dd>\n<dt id='how%20do%20i%20retrieve%20saved%20options%3F'><h3>How do I retrieve saved options?<\/h3><\/dt>\n<dd><p>$value = cfs_get_option( 'options_screen_name', 'field_name_from_field_group' );<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.2.7<\/h4>\n\n<ul>\n<li>Add support for using CFS Field Group title instead of ID<\/li>\n<\/ul>\n\n<h4>1.2.5<\/h4>\n\n<ul>\n<li>Better handling of overrides when not viewing a single post<\/li>\n<\/ul>\n\n<h4>1.2.4<\/h4>\n\n<ul>\n<li>PHP Warning cleanup<\/li>\n<\/ul>\n\n<h4>1.2.3<\/h4>\n\n<ul>\n<li>Fixed an issue that would output override note if any Field Group on an Options Screen had one<\/li>\n<li>Fixed an issue where multiple override notes would be output when there were multiple override Field Groups<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>PHP Warning cleanup for <code>cfs_get_option<\/code><\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Added support for Field Group defaults\/overrides where a Field Group can appear both on a CFS Options Screen and a post edit screen, and 'fall back' to the CFS Options Screen where applicable<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Refined the arguments for the underlying CPT to hide it from the Admin menu, filterable with <code>cfs_options_screens_post_type_args<\/code><\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Fixed an issue resulting in a change in WordPress 4.4 that prevented editing options screens<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Added new <code>cfs_get_options()<\/code> function to retrieve all CFS data for an options screen<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Fixed an issue in WordPress 4.3 where customized edit screen titles were not shown<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Only show 'Saved' update notice when editing an options screen<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Proper page title is now output when editing a screen<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Create options screens that utilize Custom Field Suite","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/30817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=30817"}],"author":[{"embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jchristopher"}],"wp:attachment":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=30817"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=30817"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=30817"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=30817"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=30817"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=30817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}