Fields

Field Types

  • multi_select

  • key_select

  • tags

  • communication_channel

  • connection

  • user_select

  • text

  • textarea

  • link

  • date

  • number

  • array

  • tasks

  • boolean

  • location

  • location_meta

Adding fields

Parameters

  • name: (string). The name you want the user to see for the field. Required.

  • type: (string). the field type. Required.

  • description: (string). Extra context for the field. May show up in the help modals. Optional.

  • default: (array, string). Options for the field. Required for key_select_and multi_select fields.

  • icon: (string). The url of the icon to display next to the name.

  • font-icon: (string). Font icon like mdi mdi-robot-outline using material icons. See mdi

  • tile: (string). Which tile this field should be displayed on.

  • customizable: (bool, string). If this field is customizable by the user in the wp_admin settings page. Options: false, 'add_only'

  • in_create_form: (bool, array). Whether this field should be visible by default on the create post page. Either true or an array of (post) types to display on ex: [ "personal", "access" ].

  • hidden: (bool). If this field should show on the front end in filter options or new record pages.

  • show_in_table: (int). If this field should by default show in the list table. Lower number means higher priority.

  • custom_display: (bool). If this field should be ignored by D.T field display generator.

  • only_for_types: (array) array of the record types the field should be visible on.

Extra Parameters for connections fields

  • post_type: the post_type of the connected posts

  • p2p_key: the p2p connection key. See Declaring Connection Fields below.

  • p2p_direction: the p2p direction. See Declaring Connection Fields below.

  • create-icon: url for the icon user in the typeahead create button.

Extra parameters for communication_channel fields

  • hide_domain whether to hide the url domain name when displaying a like. Ex "https://facebook.com/person" would show "person" as a link.

Extra parameters for key_select and multi_select field

  • default_color: (string). Default color for key_select and multi_select options. This triggers the color mode for the select field

  • select_cannot_be_empty: (bool). Selects the first value instead of an empty value by default

  • default: options:

Extra parameters for link field

This field type is similar to the multi-select field type.

Extra parameters for number field

  • min_option: (number). Optional parameter to define a minimum for this field

  • max_option: (number). Optional parameter to define a maximum for this field

Declaring Connection Fields

Here the connection is from the contacts post type to the groups post_type.

Declaring the field on the contacts post_type looks like:

Note the direction and post_type change on the field declaration on the group post_type:

Function to have D.T display a field:

render_field_for_display( $field_key, $fields_options, $post, $show_extra_controls = false, $show_hidden = false )

Last updated

Was this helpful?