Skip to content

Instantly share code, notes, and snippets.

@thefrosty
Created February 23, 2021 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefrosty/15a86daf1bfcffc7d319fcde10ab5581 to your computer and use it in GitHub Desktop.
Save thefrosty/15a86daf1bfcffc7d319fcde10ab5581 to your computer and use it in GitHub Desktop.
Conditional Logic for BOD Page Structure
<?php
array (
0 =>
array (
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure',
'title' => 'Page Structure Template',
'post_types' =>
array (
0 => 'page_structure',
),
'context' => 'normal',
'priority' => 'high',
'fields' =>
array (
0 =>
array (
'id' => 'apiVersion',
'type' => 'select',
'name' => 'API Version',
'desc' => 'Selecting API Version one is for 1:1, while two is for 1:plus (new designs).',
'std' => 1,
'options' =>
array (
1 => 'One',
2 => 'Two',
),
'required' => true,
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'integer',
'description' => 'API Version (absolute numeric value).',
'required' => true,
'default' => 1,
'enum' =>
array (
0 => 1,
1 => 2,
),
),
),
1 =>
array (
'id' => 'template',
'type' => 'select',
'name' => 'Template',
'placeholder' => 'Select a Template',
'desc' => 'Options are hard-coded.',
'options' =>
array (
'nutrition' => 'Nutrition (v1)',
'program' => 'Programs (v1 & v2)',
'search' => 'Search (v2)',
'searchResults' => 'Search Results (v2)',
'trainer' => 'Trainers (v1)',
),
'required' => true,
'schema' =>
array (
'type' => 'string',
'description' => 'Template to be used for version two page structure.',
'required' => true,
'enum' =>
array (
0 => 'nutrition',
1 => 'program',
2 => 'search',
3 => 'searchResults',
4 => 'trainer',
),
),
),
2 =>
array (
'id' => 'title',
'type' => 'text',
'name' => 'Page Structure Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 2,
),
),
'relation' => 'and',
),
),
),
),
1 =>
array (
'title' => 'Nutrition',
'fields' =>
array (
0 =>
array (
'group_title' => 'Nutrition Programs',
'save_state' => false,
'default_state' => 'collapsed',
'collapsible' => true,
'id' => 'nutritionPrograms',
'type' => 'group',
'name' => 'Nutrition Programs',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => 'Program Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'programs',
'type' => 'post',
'name' => 'Program(s)',
'desc' => 'Options are pulled from the Program post type.',
'post_type' =>
array (
0 => 'program',
),
'field_type' => 'select_advanced',
'multiple' => false,
'clone' => true,
'sort_clone' => true,
'required' => true,
'schema' =>
array (
'type' => 'array',
'title' => 'program',
'description' => 'Array of Program post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
'query_args' =>
array (
'meta_query' =>
array (
0 =>
array (
'key' => 'programCategory',
'value' => 'nutrition',
'compare' => '=',
),
),
),
),
2 =>
array (
'id' => 'userStates',
'type' => 'select_advanced',
'name' => 'User States',
'placeholder' => 'Select User States',
'options' =>
array (
'logged_in' => 'Logged In',
'logged_out' => 'Logged Out',
),
'select_all_none' => true,
'multiple' => true,
'schema' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'object',
'description' => 'Page Structure V1 Nutrition Programs',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'programs' =>
array (
'type' => 'array',
'title' => 'program',
'description' => 'Array of Program post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
'userStates' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
),
1 =>
array (
'group_title' => 'Nutrition Channels',
'save_state' => false,
'default_state' => 'collapsed',
'collapsible' => true,
'id' => 'nutritionChannels',
'type' => 'group',
'name' => 'Nutrition Channels',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => 'Channel Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'programs',
'type' => 'post',
'name' => 'Program(s)',
'desc' => 'Options are pulled from the Program post type.',
'post_type' =>
array (
0 => 'program',
),
'field_type' => 'select_advanced',
'multiple' => false,
'clone' => true,
'sort_clone' => true,
'required' => true,
'schema' =>
array (
'type' => 'array',
'title' => 'program',
'description' => 'Array of Program post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
'query_args' =>
array (
'meta_query' =>
array (
0 =>
array (
'key' => 'programCategory',
'value' => 'nutrition',
'compare' => '=',
),
),
),
),
2 =>
array (
'id' => 'userStates',
'type' => 'select_advanced',
'name' => 'User States',
'placeholder' => 'Select User States',
'options' =>
array (
'logged_in' => 'Logged In',
'logged_out' => 'Logged Out',
),
'select_all_none' => true,
'multiple' => true,
'schema' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'object',
'description' => 'Page Structure V1 Nutrition Channels',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'programs' =>
array (
'type' => 'array',
'title' => 'program',
'description' => 'Array of Program post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
'userStates' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 1,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'nutrition',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-nutrition',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
2 =>
array (
'title' => 'Program',
'fields' =>
array (
0 =>
array (
'group_title' => 'Recent Activity',
'save_state' => false,
'default_state' => 'collapsed',
'collapsible' => true,
'id' => 'recentActivity',
'type' => 'group',
'name' => 'Recent Activity',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'userStates',
'type' => 'select_advanced',
'name' => 'User States',
'placeholder' => 'Select User States',
'options' =>
array (
'logged_in' => 'Logged In',
'logged_out' => 'Logged Out',
),
'select_all_none' => true,
'multiple' => true,
'schema' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'object',
'description' => 'Page Structure V1 Program Recent Activity',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'userStates' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
),
1 =>
array (
'group_title' => 'Program List',
'save_state' => false,
'default_state' => 'collapsed',
'collapsible' => true,
'id' => 'programList',
'type' => 'group',
'name' => 'Program List',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'programs',
'type' => 'post',
'name' => 'Program(s)',
'desc' => 'Options are pulled from the Program post type.',
'post_type' =>
array (
0 => 'program',
),
'field_type' => 'select_advanced',
'multiple' => false,
'clone' => true,
'sort_clone' => true,
'required' => true,
'schema' =>
array (
'type' => 'array',
'title' => 'program',
'description' => 'Array of Program post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
),
2 =>
array (
'id' => 'userStates',
'type' => 'select_advanced',
'name' => 'User States',
'placeholder' => 'Select User States',
'options' =>
array (
'logged_in' => 'Logged In',
'logged_out' => 'Logged Out',
),
'select_all_none' => true,
'multiple' => true,
'schema' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'object',
'description' => 'Page Structure V1 Program List',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'programs' =>
array (
'type' => 'array',
'title' => 'program',
'description' => 'Array of Program post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
'userStates' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 1,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'program',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-program',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
3 =>
array (
'title' => 'Program V2',
'fields' =>
array (
0 =>
array (
'id' => 'sortMenu',
'type' => 'group',
'collapsible' => true,
'default_state' => 'expanded',
'group_title' => 'Sort Menu',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'std' => 'Sort By:',
),
1 =>
array (
'id' => 'items',
'name' => 'Items',
'type' => 'text',
'std' =>
array (
0 => 'Categories',
1 => 'Featured',
2 => 'Newest',
3 => 'A - Z',
),
'clone' => true,
'sort_clone' => true,
'required' => true,
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'array',
'description' => 'Page Structure V2 Program Sort Menu.',
'items' =>
array (
'type' => 'object',
'properties' =>
array (
'id' =>
array (
'type' => 'string',
),
'label' =>
array (
'type' => 'string',
),
),
),
),
),
1 =>
array (
'id' => 'divider_1',
'type' => 'divider',
'name' => '',
),
2 =>
array (
'id' => 'rails',
'name' => 'Rails',
'type' => 'group',
'clone' => true,
'sort_clone' => true,
'default_state' => 'expanded',
'collapsible' => true,
'group_title' =>
array (
'field' => 'title',
),
'required' => true,
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'collection',
'type' => 'post',
'name' => 'Collection',
'desc' => 'Options are pulled from the Collection post type.',
'post_type' =>
array (
0 => 'collection',
),
'field_type' => 'select_advanced',
'multiple' => false,
'attributes' =>
array (
'data-unique' => 'true',
),
'required' => true,
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'array',
'description' => 'Page Structure V2 Program Rails.',
'items' =>
array (
'type' => 'object',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
),
'collection' =>
array (
'type' => 'integer',
),
),
),
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 2,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'program',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-v2-program',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
4 =>
array (
'title' => 'Search',
'fields' =>
array (
0 =>
array (
'id' => 'backLinkText',
'type' => 'text',
'name' => 'Back to',
'desc' => 'Back to categories (referrer) text.',
'required' => true,
'size' => 45,
'schema' =>
array (
'type' => 'string',
'description' => 'Back to categories (referrer) text.',
'required' => true,
),
),
1 =>
array (
'id' => 'inputSearchPlaceholder',
'type' => 'text',
'name' => 'Placeholder',
'desc' => 'Input search field placeholder text.',
'required' => true,
'size' => 45,
'schema' =>
array (
'type' => 'string',
'description' => 'Input search placeholder text.',
'required' => true,
),
),
2 =>
array (
'id' => 'divider_1',
'type' => 'divider',
'name' => '',
),
3 =>
array (
'id' => 'description',
'type' => 'wysiwyg',
'name' => 'Sub-heading description',
'required' => true,
'options' =>
array (
'media_buttons' => false,
'textarea_rows' => 3,
'teeny' => true,
),
'sanitize_callback' =>
array (
0 => 'BeachbodyOnDemand\\RestApi\\MetaBox\\PostMetaSanitize',
1 => 'sanitizeWysiwygCallback',
),
'prepare_rest_response_callback' =>
array (
0 => 'BeachbodyOnDemand\\RestApi\\MetaBox\\PostMetaSanitize',
1 => 'sanitizeWysiwygRestResponse',
),
'schema' =>
array (
'type' => 'string',
'description' => 'Search sub-title description.',
),
),
4 =>
array (
'id' => 'sortMenu',
'type' => 'group',
'collapsible' => true,
'default_state' => 'expanded',
'group_title' => 'Sort Menu',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'std' => 'Sort By:',
),
1 =>
array (
'id' => 'items',
'name' => 'Items',
'type' => 'text',
'std' =>
array (
0 => 'Popularity',
1 => 'Newest',
2 => 'A - Z',
),
'clone' => true,
'sort_clone' => true,
'required' => true,
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'array',
'description' => 'Page Structure V2 Program Sort Menu.',
'items' =>
array (
'type' => 'object',
'properties' =>
array (
'id' =>
array (
'type' => 'string',
),
'label' =>
array (
'type' => 'string',
),
),
),
),
),
5 =>
array (
'id' => 'divider_2',
'type' => 'divider',
'name' => '',
),
6 =>
array (
'id' => 'noResultsImages',
'type' => 'group',
'name' => 'No Results Images',
'clone' => true,
'sort_clone' => true,
'collapsible' => true,
'default_state' => 'collapsed',
'max_clone' => 10,
'group_title' => 'Image {#}',
'fields' =>
array (
0 =>
array (
'id' => 'image',
'name' => 'Image',
'type' => 'single_image',
'width' => 1656,
'height' => 1656,
'schema' =>
array (
'type' => 'object',
'description' => 'Single image object.',
'properties' =>
array (
'ID' =>
array (
'type' => 'integer',
),
'alt_text' =>
array (
'type' => 'string',
),
'caption' =>
array (
'type' => 'string',
),
'description' =>
array (
'type' => 'string',
),
'media_type' =>
array (
'type' => 'string',
),
'mime_type' =>
array (
'type' => 'string',
),
'width' =>
array (
'type' => 'integer',
),
'height' =>
array (
'type' => 'integer',
),
'file' =>
array (
'type' => 'string',
),
'sizes' =>
array (
'type' => 'object',
),
'filesize' =>
array (
'type' => 'integer',
),
'source_url' =>
array (
'type' => 'string',
),
),
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'object',
'description' => 'Icon Upload Group',
'properties' =>
array (
'image' =>
array (
'type' => 'object',
'description' => 'Single image object.',
'properties' =>
array (
'ID' =>
array (
'type' => 'integer',
),
'alt_text' =>
array (
'type' => 'string',
),
'caption' =>
array (
'type' => 'string',
),
'description' =>
array (
'type' => 'string',
),
'media_type' =>
array (
'type' => 'string',
),
'mime_type' =>
array (
'type' => 'string',
),
'width' =>
array (
'type' => 'integer',
),
'height' =>
array (
'type' => 'integer',
),
'file' =>
array (
'type' => 'string',
),
'sizes' =>
array (
'type' => 'object',
),
'filesize' =>
array (
'type' => 'integer',
),
'source_url' =>
array (
'type' => 'string',
),
),
),
),
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 2,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'search',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-v2-search',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
5 =>
array (
'title' => 'Filters',
'fields' =>
array (
0 =>
array (
'id' => 'filtersTitle',
'type' => 'text',
'name' => 'Title',
'label_description' => 'Search sidebar title',
'required' => true,
'size' => 45,
'schema' =>
array (
'type' => 'string',
'description' => 'Filter(s) sidebar title.',
'required' => true,
),
),
1 =>
array (
'id' => 'facets',
'type' => 'group',
'name' => 'Facets',
'label_description' => 'Builder',
'required' => true,
'collapsible' => true,
'default_state' => 'collapsed',
'clone' => true,
'sort_clone' => true,
'group_title' =>
array (
'field' => 'title',
),
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => 'Facet Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'objectType',
'name' => 'Object Type',
'type' => 'radio',
'options' =>
array (
'post' => 'Post',
'static' => 'Static',
),
'inline' => true,
'schema' =>
array (
'type' =>
array (
0 => 'null',
1 => 'string',
),
'description' => 'Facet object type.',
'enum' =>
array (
0 => 'post',
1 => 'static',
),
),
),
2 =>
array (
'id' => 'divider_1',
'type' => 'divider',
'name' => '',
),
3 =>
array (
'id' => 'postType',
'type' => 'select',
'name' => 'Post Type',
'placeholder' => 'Select a PostType',
'options' =>
array (
'meta' => 'Meta',
'program' => 'Program',
),
'schema' =>
array (
'type' => 'string',
'description' => 'PostType used to filter other field(s)',
'enum' =>
array (
0 =>
array (
0 => 'meta',
1 => 'program',
),
),
),
'desc' => 'Note: This filters the 'post' selector field(s) below.',
'attributes' =>
array (
'data-filter-group-field' => 'facets_posts',
'data-query_args' =>
array (
'post_type' =>
array (
0 => '%s',
),
'tax_query' => NULL,
),
),
'label_description' => 'Filter by post type',
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'objectType',
1 => '=',
2 => 'post',
),
),
'relation' => 'and',
),
),
4 =>
array (
'id' => 'taxonomyTerm',
'name' => 'Term',
'label_description' => 'Filter by term',
'desc' => 'Note: This filters the 'post' selector field(s) below.',
'type' => 'select_advanced',
'placeholder' => 'Select a Term',
'options' =>
array (
'body-part' => 'Body Part',
'recipe-meal' => 'Recipe Meal',
'recipe-dish' => 'Recipe Dish',
'recipe-icon' => 'Recipe Icon',
),
'attributes' =>
array (
'data-filter-group-field' => 'facets_posts',
'data-query_args' =>
array (
'post_type' =>
array (
0 => 'meta',
),
'tax_query' =>
array (
0 =>
array (
'field' => 'slug',
'taxonomy' => 'meta_type',
'terms' => '%s',
'operator' => 'IN',
),
),
),
),
'schema' =>
array (
'type' =>
array (
0 => 'null',
1 => 'string',
),
'description' => 'PostType used to filter other field(s)',
'enum' =>
array (
0 =>
array (
0 => 'body-part',
1 => 'recipe-meal',
2 => 'recipe-dish',
3 => 'recipe-icon',
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'objectType',
1 => '=',
2 => 'post',
),
1 =>
array (
0 => 'postType',
1 => '=',
2 => 'meta',
),
),
'relation' => 'and',
),
),
5 =>
array (
'id' => 'posts',
'type' => 'post',
'name' => 'Posts',
'placeholder' => 'Select Post(s)',
'post_type' =>
array (
0 => 'meta',
1 => 'program',
),
'field_type' => 'select_advanced',
'multiple' => false,
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'options' =>
array (
),
'clone' => true,
'sort_clone' => true,
'required' => true,
'attributes' =>
array (
'data-unique' => 'true',
'data-facets_posts' => 'true',
),
'schema' =>
array (
'type' =>
array (
0 => 'null',
1 => 'array',
),
'items' =>
array (
'type' => 'integer',
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'objectType',
1 => '=',
2 => 'post',
),
1 =>
array (
0 => 'postType',
1 => '!=',
2 => '',
),
),
'relation' => 'and',
),
),
6 =>
array (
'id' => 'containerColors',
'type' => 'select_advanced',
'name' => 'Container Color',
'placeholder' => 'Chose a Color',
'options' =>
array (
'#00A651' => 'Green',
'#7D659C' => 'Purple',
'#D2232A' => 'Red',
'#FFCF01' => 'Yellow',
'#0060A7' => 'Blue',
'#F68B1F' => 'Orange',
'#BDBDBD' => 'Gray',
),
'schema' =>
array (
'type' => 'string',
'description' => 'Color of container',
'enum' =>
array (
0 => '#00A651',
1 => '#7D659C',
2 => '#D2232A',
3 => '#FFCF01',
4 => '#0060A7',
5 => '#F68B1F',
6 => '#BDBDBD',
),
),
'clone' => true,
'sort_clone' => true,
'required' => true,
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'objectType',
1 => '=',
2 => 'static',
),
),
'relation' => 'and',
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' =>
array (
0 => 'null',
1 => 'array',
),
'items' =>
array (
'type' => 'object',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'objectType' =>
array (
'type' =>
array (
0 => 'null',
1 => 'string',
),
'description' => 'Facet object type.',
'enum' =>
array (
0 => 'post',
1 => 'static',
),
),
'postType' =>
array (
'type' => 'string',
'description' => 'PostType used to filter other field(s)',
'enum' =>
array (
0 =>
array (
0 => 'meta',
1 => 'program',
),
),
),
'taxonomyTerm' =>
array (
'type' =>
array (
0 => 'null',
1 => 'string',
),
'description' => 'PostType used to filter other field(s)',
'enum' =>
array (
0 =>
array (
0 => 'body-part',
1 => 'recipe-meal',
2 => 'recipe-dish',
3 => 'recipe-icon',
),
),
),
'posts' =>
array (
'type' =>
array (
0 => 'null',
1 => 'array',
),
'items' =>
array (
'type' => 'integer',
),
),
),
),
'description' => 'Filter(s) sidebar title.',
'required' => true,
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 2,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'search',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-v2-searchfilters',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
6 =>
array (
'title' => 'Search Results',
'fields' =>
array (
0 =>
array (
'id' => 'searchResultsMenu',
'type' => 'group',
'collapsible' => true,
'default_state' => 'expanded',
'group_title' => 'Search Results Menu',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'std' => 'Search results for',
),
1 =>
array (
'id' => 'items',
'name' => 'Items',
'type' => 'text',
'std' =>
array (
0 => 'All',
1 => 'Programs',
2 => 'Workouts',
3 => 'Lessons',
4 => 'Recipes',
5 => 'Program Materials',
6 => 'Other',
),
'clone' => true,
'sort_clone' => true,
'required' => true,
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'array',
'description' => 'Page Structure V2 Search Results Menu.',
'items' =>
array (
'type' => 'object',
'properties' =>
array (
'id' =>
array (
'type' => 'string',
),
'label' =>
array (
'type' => 'string',
),
),
),
),
),
1 =>
array (
'id' => 'divider_1',
'type' => 'divider',
'name' => '',
),
2 =>
array (
'id' => 'allResultsButtonText',
'name' => 'All Results Button Text',
'type' => 'text',
'std' => 'See All',
'schema' =>
array (
'type' => 'string',
'description' => 'Text for button to see all results.',
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 2,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'searchResults',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-v2-searchresults',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
7 =>
array (
'title' => 'Trainer',
'fields' =>
array (
0 =>
array (
'group_title' => 'Trainer List',
'save_state' => false,
'default_state' => 'collapsed',
'collapsible' => true,
'id' => 'trainerList',
'type' => 'group',
'name' => 'Trainer List',
'fields' =>
array (
0 =>
array (
'id' => 'title',
'type' => 'text',
'name' => ' Title',
'required' => true,
'size' => 60,
'schema' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
),
1 =>
array (
'id' => 'trainers',
'type' => 'post',
'name' => 'Trainer(s)',
'desc' => 'Options are pulled from the Trainer post type.',
'post_type' =>
array (
0 => 'trainer',
),
'field_type' => 'select_advanced',
'multiple' => false,
'clone' => true,
'sort_clone' => true,
'required' => true,
'schema' =>
array (
'type' => 'array',
'title' => 'trainer',
'description' => 'Array of Trainer post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
),
2 =>
array (
'id' => 'userStates',
'type' => 'select_advanced',
'name' => 'User States',
'placeholder' => 'Select User States',
'options' =>
array (
'logged_in' => 'Logged In',
'logged_out' => 'Logged Out',
),
'select_all_none' => true,
'multiple' => true,
'schema' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
'sanitize_callback' =>
Closure::__set_state(array(
)),
'prepare_rest_response_callback' =>
Closure::__set_state(array(
)),
'schema' =>
array (
'type' => 'object',
'description' => 'Page Structure V1 Trainer List',
'properties' =>
array (
'title' =>
array (
'type' => 'string',
'description' => 'Front facing title for this post object, should be used over post_title.',
'required' => true,
),
'programs' =>
array (
'type' => 'array',
'title' => 'trainer',
'description' => 'Array of Trainer post IDs.',
'required' => true,
'items' =>
array (
'type' => 'integer',
),
),
'userStates' =>
array (
'type' => 'string',
'description' => 'User states',
'enum' =>
array (
0 => 'logged_in',
1 => 'logged_out',
),
),
),
),
),
),
'visible' =>
array (
'when' =>
array (
0 =>
array (
0 => 'apiVersion',
1 => '=',
2 => 1,
),
1 =>
array (
0 => 'template',
1 => '=',
2 => 'trainer',
),
),
'relation' => 'and',
),
'context' => 'normal',
'id' => 'posttypes-customfields-pagestructure_posttypes-customfields-pagestructure-trainer',
'post_types' =>
array (
0 => 'page_structure',
),
'priority' => 'high',
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment