Types Fields API

Audio

Description:

Audio will allow users to upload and play an audio clip on your site.

The Types audio field implements the audio feature of WordPress.

You must be running WordPress 3.6 and above for the audio field to be available.

Display in WP admin:
Display in front-end:
attributes:
  • preload: 'on' | 'off' (default)

    Media will begin downloading as soon as the page is loaded.
  • loop: 'on' | 'off' (default)

    Media will loop to beginning when finished and automatically continue playing
  • id: "$parent" | "post-id" | "$custom post name"

  • autoplay: 'on' | 'off' (default)

    Media will start playing as soon as the page loads.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-audio-field", array("output" => "raw") )
shortcode:
[types field="my-audio-field" loop="on"][/types]
user meta php:
types_render_usermeta_field( "my-audio-field", array( "user_current" => true ) )
user meta shortcode:
[types user_meta="my-audio-field" loop="on"][/types]

Checkbox

Description:

Checkbox can be used to get binary, yes/no responses from a user.

Display in WP admin:
Display in front-end:
If checkbox is checked, the value 1 will be returned. If checkbox is not checked, no value will be returned. If checkbox is not checked, and “Save 0 to the database” is set for the control, 0 will be returned. If the state attribute is used, then the value between the shortcodes will be returned.
attributes:
  • state: ’unchecked’ | ‘checked’

    If true then the value between the [types][/types] will be output.

    For checkboxes state is only valid if option is specified

     
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
This field does not support repeating values
attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-checkbox", array("output" => "raw"))
Read more about displaying custom fields
shortcode:
[types field="my-checkbox"][/types]
Will output the value for the checkbox if checked
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Checkboxes

Description:

Displays a checkbox group to the user. Checkboxes can be used to get binary, yes/no responses from a user.

Display in WP admin:
Display in front-end:
With no attributes set, checkboxes will return a comma separated list of values stored for each checked checkbox.
attributes:
  • state: ’unchecked’ | ‘checked’

    If true then the value between the [types][/types] will be output.

    For checkboxes state is only valid if option is specified

     
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • separator: text or html tags to insert between each field

  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • option: "zero-based index number"

    e.g. option=”0″ Will output the value for the option number specified.  For checkboxes, will display the checked valued of the nth checkbox in the group.
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
This field does not support repeating values
attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-checkboxes", array( "separator" => ", " ) )
Read more about displaying custom fields
shortcode:
[types field="my-checkboxes"][/types]
Will output a comma separated list of values for each checked checkbox
[types field="my-checkboxes" separator=" - "][/types]
Will output a list of values for each checked checkbox separated by a dash.
[types field="my-checkboxes" option="0"][/types]
Will output the value for the first checkbox in the group
[types field="my-checkboxes" option="0" state="unchecked"]text to display[/types]
Will output ‘text to display’ for the first checkbox in the group if it is unchecked
user meta php:
[Will display the value of the field for the post author.[/wpml-string]
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Colorpicker

Description:

Displays a interactive colorpicker to the user to select a color value.

Display in WP admin:
Display in front-end:
The hexadecimal RGB color code.
attributes:

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-colorpicker")
shortcode:
[types field="my-colorpicker"][/types]

Will output a hexadecimal color code e.g. #e869e7.

user meta php:
types_render_usermeta_field( "my-colorpicker", array( "user_current" => true ) )
user meta shortcode:
[types user_meta="colorpicker"][/types]

Date

Description:

Displays a datepicker to the user with optional ‘hour’ and ‘minute’ selection.

Display in WP admin:
Display in front-end:
Date can be displayed as a formatted date time text or as a calendar.
attributes:
  • style: "text" | "calendar"

    “calendar” will show the current month and highlight the current day on the page.
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

  • format: any valid WordPress date format

    WordPress date and time formats. Defaults to the Date Format in site General Settings.
attributes (html):
class

The class attribute will only be processed if the calendar style is selected.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-date", array("style" => "calendar"))
Read more about displaying custom fields
shortcode:
[types field="my-date" style="calendar"][/types]
Will display a calendar on your site with the date value highlighted
[types field="my-date"][/types]
Will display the date formatted according to your site’s WordPress general settings
[types field="my-date" output="raw"][/types]
Will display an integer value for the date from the database
[types field="my-date" format="Y/m/d g:i:s A"][/types]
Will display the date in the format 2015/02/04 8:00:00 AM
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Email

Description:

Displays a email input to the user.

Display in WP admin:
Display in front-end:
Will create a mailto email link on your site.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

attributes (html):
class | style | title

Html attributes all take string values and will be added unchanged to the anchor link element.  Html attributes will not be added if output=”raw”.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-date", array("title" => "mail me..."))
Read more about displaying custom fields
shortcode:
[types field="my-email"][/types]
Will generate the following
my-email@my-domain.com
[types field="my-email" title="mail me..."][/types]
Will generate the following
mail me...
[types field="my-email" ouput="raw"][/types]
Will just output the email address as a string

my-email@my-domain.com

user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Embedded media

Description:

Embedded media will allow users to upload and display/play a wide range of embedded content on your site.

The Types Embedded media field implements the embedded content feature of WordPress.

You must be running WordPress 3.6 and above for the embedded media field to be available.

If width is specified and less than $content_width, the width will be used, otherwise $content_width will be used.

Display in WP admin:
Display in front-end:
attributes:
  • width: image width (e.g. 300)

    Image will be resized before being sent to the client. width and height will be ignored if size is set. For Embedded media the width and height are maximum values and may be ignored if $content_width is set for the theme.
  • id: "$parent" | "post-id" | "$custom post name"

  • height: image height (e.g. 300)

    Image will be resized before being sent to the client. width and height will be ignored if size is set. For Embedded media the width and height are maximum values and may be ignored if $content_width is set for the theme.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-embedded-media-field", array("output" => "raw") )
shortcode:
[types field="my-embedded-media-field" width="450" height="320"][/types]
user meta php:
types_render_usermeta_field( "my-embedded-media-field", array( "user_current" => true ) )
user meta shortcode:
[types field="my-embedded-media-field" width="450" height="320"][/types]

File

Description:

Display a file upload dialog and provide a link to the file on your site.

Display in WP admin:
Display in front-end:
Will display a link to an uploaded file or the URL of the file.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

attributes (html):
class | style | title

html attributes all take string values and will be added unchanged to the file link element.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-file", array("title" => "read me..."))
Read more about displaying custom fields
shortcode:
[types field="my-file"][/types]
Will generate the following
my-file.pdf
[types field="my-file" title="read me..."][/types]
Will generate the following
read me...
[types field="my-file" ouput="raw"][/types]
Will just output the file link as a string

/path-to-my-file/my-file.pdf

user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Image

Description:

Image will let users upload and display an image on their site

Display in WP admin:
Display in front-end:

HTML tag for resized image.

If output=”raw”, url of the image will be returned.

If url=”true”, the url of the resized image will be returned.
attributes:
  • width: image width (e.g. 300)

    Image will be resized before being sent to the client. width and height will be ignored if size is set. For Embedded media the width and height are maximum values and may be ignored if $content_width is set for the theme.
  • url: 'false'(default) | 'true'

    true=output the url of the image instead of the html img tag.

    Works with the size attribute to output the url of the re-sized image
  • size: custom image size | 'full' | 'large' | 'medium' | 'thumbnail'

    width and height will be ignored if size is set.
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • resize: 'crop' | 'proportional' | 'stretch' | 'pad'

    If pad is specified, then the padding_color attribute can be used to set the color or transparency of the padding.
  • proportional: 'true'(default) | 'false'

    false=image will be cropped to specified height and width. Overridden if size is set.
  • padding_color: hex color code | 'transparent'

    Transparent works best with png format images. For image fields, padding_color only is applied if resize=”pad”
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • no_protocol: "true" | "false" (default)

    Display URL without protocol “http:// and https://”.
  • id: "$parent" | "post-id" | "$custom post name"

  • height: image height (e.g. 300)

    Image will be resized before being sent to the client. width and height will be ignored if size is set. For Embedded media the width and height are maximum values and may be ignored if $content_width is set for the theme.
  • align: "center" | "left" | "none"(default) | "right"

    Will add one of the WordPress align classes to the img element (“alignright”, “alignleft”, “aligncenter”). Your theme should define these classes. Read more about aligning images.
attributes (html):
alt | class | style | title

html attributes all take string values and will be added unchanged to the img element.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-image", array( "alt" => "blue bird", "width" => "300", "height" => "200", "proportional" => "true" ) )
Read more about displaying custom fields
shortcode:
[types field="my-image" alt="blue bird" title="Acme logo" class="my-class1 myclass2" style="border:1px solid black;padding:20px" size="thumbnail"]
Will output
blue bird
[types field="my-image"  size="thumbnail" url="true"]
Will output

http://mysite.com/image-path/my-image-name-150x150.jpg

[types field="my-image" output="raw"]
Will output

http://mysite.com/image-path/my-image-name.jpg

user meta php:
types_render_usermeta_field( "my-image", array( "alt" => "blue bird", "width" => "300", "height" => "200", "proportional" => "true", user_id => "1" ) )
Will display the image of the field for the user with user id of 1.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Numeric

Description:

Displays a text input to user but forces numeric value to be entered.

Display in WP admin:
Display in front-end:
Raw DB data or HTML formatted output. Also predefined values can be used to set rendering – FIELD_NAME and FIELD_VALUE. This works similar to sprintf() PHP function.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

  • format: Use the literals FIELD_NAME and FIELD_VALUE in the format to ouput the name and value

    e.g. format=”FIELD_NAME : $ FIELD_VALUE”

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-number", array("style" => "FIELD_NAME : $ FIELD_VALUE"))
Read more about displaying custom fields
shortcode:
[types field="my-number" format="FIELD_NAME : $ FIELD_VALUE"][/types]

Will generate the following
Price : $ 100

user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Phone

Description:

Displays a text input for user, phone behaves the same as single line input with no additional validation.

Display in WP admin:
Display in front-end:
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

user meta php:

Radio

Description:

Radio buttons allow users to select just one option from a group of options.

Display in WP admin:
Display in front-end:
Will display the title for the selected radio option
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-radio", array())
Read more about displaying custom fields
shortcode:
[types field="my-radio"][/types]
Will output the title for the selected option
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Select

Description:

Displays a select box to the user.

Display in WP admin:
Display in front-end:
The option title will be output, or if set, a specific value.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-select", array( ))
Read more about displaying custom fields
shortcode:
[types field="my-select"][/types]
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Skype

Description:

Specify Skype id and button style and display an interactive Skype button on your site.

Display in WP admin:
Display in front-end:
Displays a Skype button, optionally with status to allow uses to place a Skype call from your site.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

  • button_style: "btn1" | "btn2" | "btn3" | "btn4" | "btn5" | "btn6"

    Will render one of the Skype button styles
attributes (html):
class

class attribute takes a string value and will be added unchanged to the anchor link element.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-skype", array( "button_style" => "btn4" ) )
Read more about displaying custom fields
shortcode:
[types field="my-skype" button_style="btn4"][/types]
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Textarea

Description:

Displays a textarea for user input. In the Types interface, this field is called “Multiple lines”

Display in WP admin:
Display in front-end:
Displays multi-line text on your site.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-textarea", array( ) )
Read more about displaying custom fields
shortcode:
[types field="my-textarea"][/types]
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.

Read more about displaying user fields]

user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Textfield

Description:

Input and displays a single line text input to the user. In the Types interface, this field is called “Single line”

Display in WP admin:
Display in front-end:
Display a text string on your site.
attributes:
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-singlelinetext", array( ) )
Read more about displaying custom fields
shortcode:
[types field="my-singlelinetext"][/types]

Will output a text string on your site

user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

URL

Description:

Displays a URL input to the user and validates input.

Display in WP admin:
Display in front-end:
Displays an external or internal clickable link on your site. With output=”raw” just the text of the link will be output.
attributes:
  • target: "_blank" | "_self" | "_parent" | "_top" | "framename"

    _blank: Opens in a new window or tab. _self: Opens in the same frame as it was clicked. _parent: Opens in the parent frame. _top: Opens in the full body of the window. framename: Opens in a named frame
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

attributes (html):
class | style | title

html attributes all take string values and will be added unchanged to the anchor link element.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-link", array("title" => "got to look at this"))
Read more about displaying custom fields
shortcode:
[types field="my-link"][/types]
Will generate the following
/path-to-my-link/my-link/
[types field="my-link" title="got to look at this"][/types]
Will generate the following
got to look at this
[types field="my-link" output="raw"][/types]

Will just output the URL link as a string
/path-to-my-link/my-link/

user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.

Video

Description:

Video will allow users to upload and play an audio clip on your site.

The Types video field implements the video feature of WordPress.

You must be running WordPress 3.6 and above for the video field to be available.

Display in WP admin:
Display in front-end:
attributes:
  • width: image width (e.g. 300)

    Image will be resized before being sent to the client. width and height will be ignored if size is set. For Embedded media the width and height are maximum values and may be ignored if $content_width is set for the theme.
  • preload: 'on' | 'off' (default)

    Media will begin downloading as soon as the page is loaded.
  • poster: 'image URL'

    The poster image will be displayed while the video is not playing. The image height will be set to match the height of the video container.
  • padding_color: hex color code | 'transparent'

    Transparent works best with png format images. For image fields, padding_color only is applied if resize=”pad”
  • loop: 'on' | 'off' (default)

    Media will loop to beginning when finished and automatically continue playing
  • id: "$parent" | "post-id" | "$custom post name"

  • height: image height (e.g. 300)

    Image will be resized before being sent to the client. width and height will be ignored if size is set. For Embedded media the width and height are maximum values and may be ignored if $content_width is set for the theme.
  • autoplay: 'on' | 'off' (default)

    Media will start playing as soon as the page loads.

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field( "my-video", array("output" => "raw") )
shortcode:
[types field="my-video-field" width="625" height="469" poster="/wp-content/uploads/2013/09/Tricholoma_terreum.jpg" loop="on"][/types]
user meta php:
types_render_usermeta_field( "my-video", array( "user_current" => true ) )
user meta shortcode:
[types user_meta="my-video-field" width="625" height="469" poster="/wp-content/uploads/2013/09/Tricholoma_terreum.jpg" loop="on"][/types]

WYSIWYG

Description:

Displays a WYSIWYG editor to the user.

Display in WP admin:
Display in front-end:
Allows same input as Post body. Shortcodes, images and other elements get resolved.
attributes:
  • suppress_filters: 'true' | 'false' (default)

    If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed, when retrieving the WYSIWYG content. In certain circumstances, plugins using this filter can add duplicated content to the WYSIWYG content – removing the filters can resolve this problem.
  • show_name: 'false'(default) | 'true'

    show field name before value e.g. My field name: my-field-value
  • output: 'raw' | 'html' | 'normal'(default)

    ‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
  • id: "$parent" | "post-id" | "$custom post name"

More Repeater attributes, User attributes, Usage examples

attributes (repeater):
  • index: zero-based index number of the field to be output

    Index will return a single value of your repeating field

    Read more about repeating fields
  • separator: text or html tags to insert between each field

attributes (user):
  • user_current: "true" - output user field for the logged in user

  • user_id: "id" - output the field for the user with this id

  • user_is_author: "true" - output field for current Post author

    If no user is specified for the usermeta, then the value for the current post author will be displayed (i.e. default).
  • user_name: "name" - output the field for the user with this login name

How to use this field with:

php:
types_render_field("my-wysiwyg", array( ))
Read more about displaying custom fields
shortcode:
[types field="my-wysiwyg"][/types]
user meta php:
types_render_usermeta_field( "my-field", array( "user_current" => true ) )
Will display the value of the field for the current user.
Read more about displaying user fields
user meta shortcode:
[types user_meta="my-field"][/types]
Will display the value of the field for the post author.