Skip to content

Instantly share code, notes, and snippets.

@Orlandster
Created February 21, 2018 10:06
Show Gist options
  • Save Orlandster/9a537e847a1149f1e43f6a23f5065069 to your computer and use it in GitHub Desktop.
Save Orlandster/9a537e847a1149f1e43f6a23f5065069 to your computer and use it in GitHub Desktop.
/* text */
'my-field-1' => array(
'type' => 'text',
'label' => __( 'Text Field 1', 'fl-builder' ),
),
/* textarea */
'my_textarea_field' => array(
'type' => 'textarea',
'label' => __( 'Textarea Field', 'fl-builder' ),
'default' => '',
'placeholder' => __( 'Placeholder Text', 'fl-builder' ),
'rows' => '6'
),
/* editor */
'my_editor_field' => array(
'type' => 'editor',
'media_buttons' => true,
'rows' => 10
),
/* color */
'my_color_field' => array(
'type' => 'color',
'label' => __( 'Color Picker', 'fl-builder' ),
'default' => '333333',
'show_reset' => true
),
/* link */
'my_link_field' => array(
'type' => 'link',
'label' => __('Link Field', 'fl-builder')
),
/* select */
'my_select_field' => array(
'type' => 'select',
'label' => __( 'Select Field', 'fl-builder' ),
'default' => 'option-1',
'options' => array(
'option-1' => __( 'Option 1', 'fl-builder' ),
'option-2' => __( 'Option 2', 'fl-builder' )
),
'toggle' => array(
'option-1' => array(
'fields' => array( 'my_field_1', 'my_field_2' ),
'sections' => array( 'my_section' ),
'tabs' => array( 'my_tab' )
),
'option-2' => array()
)
),
/* font */
'my_font_field' => array(
'type' => 'font',
'label' => __( 'Font', 'fl-builder' ),
'default' => array(
'family' => 'Helvetica',
'weight' => 300
)
),
/* icon */
'my_icon_field' => array(
'type' => 'icon',
'label' => __( 'Icon Field', 'fl-builder' ),
'show_remove' => true
),
/* form */
'my_form_field' => array(
'type' => 'form',
'label' => __('My Form', 'fl-builder'),
'form' => 'my_form_field', // ID of a registered form.
'preview_text' => 'label', // ID of a field to use for the preview text.
)
/* code */
'my_code_field' => array(
'type' => 'code',
'editor' => 'html',
'rows' => '18'
),
/* video */
'my_video_field' => array(
'type' => 'video',
'label' => __( 'Video Field', 'fl-builder' )
),
/* photo */
'my_photo_field' => array(
'type' => 'photo',
'label' => __('Photo Field', 'fl-builder')
'show_remove' => false
),
/* photo sizes */
'my_photo_sizes_field' => array(
'type' => 'photo-sizes',
'label' => __('Photo Sizes Field', 'fl-builder'),
'default' => 'medium'
),
/* multiple audios */
'my_multiple_audios_field' => array(
'type' => 'multiple-audios',
'label' => __( 'Multiple Audios Field', 'fl-builder' )
),
/* multiple photos */
'my_multiple_photos_field' => array(
'type' => 'multiple-photos',
'label' => __( 'Multiple Photos Field', 'fl-builder' )
),
/* post-type */
'my_post_type_field' => array(
'type' => 'post-type',
'label' => __('Post Type', 'fl-builder'),
'default' => 'post'
),
/* time */
'my_time_field' => array(
'type' => 'time',
'label' => __( 'Time', 'fl-builder' ),
'default' =>array(
'hours' => '01',
'minutes' => '00',
'day_period' => 'am'
)
),
/* custom timezone */
'my_timezone_field' => array(
'type' => 'timezone',
'label' => __( 'Time Zone', 'fl-builder' ),
'default' => 'UTC',
),
/* suggest */
'my_suggest_field' => array(
'type' => 'suggest',
'label' => __( 'Suggest Field', 'fl-builder' ),
'action' => 'fl_as_posts', // Search posts.
'data' => 'page', // Slug of the post type to search.
'limit' => 3, // Limits the number of selections that can be made.
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment