fsn_map

fsn_map( array $params )

Create an Element in Fusion that generates a WordPress shortcode based on user input.

Accepts an associative array of parameters.


Parameters

name
(string) (required) The element name.

shortcode_tag
(string) (required) The shortcode tag. All lowercase, alphanumeric characters and underscores only. Should be unique, we recommend the format “fsn_{name}” 

description
(string) (optional) An optional description which is output at the top of the element’s edit modal. 

icon
(string) (optional) A Google Material Icon textual name. The icon show in the Add Element modal.

disable_style_params
(array) (optional) Optionally disable global style params that are not applicable to the element. Options are text_align, font_size, color, background_color, background_color_opacity

params
(array) (required) An array of field parameters that show in the edit Element modal.


Params Array

type
(string) (required) The Field Type 

param_name
(string) (required) The parameter name, All lowercase, alphanumeric characters and underscores only. This parameter will output as the shortcode attribute name unless the content_field parameter is set to true.

options
(array) (required for radio and select field types) The selectable options for a radio or select fields. 

label
(string) (required) The parameter label in the edit Element modal. 

help
(string) (optional) Help text to further describe a parameter 

class
(string) (optional) CSS class that gets added to the field wrapper div in the edit Element modal 

section
(string) (optional) Controls the tabbed section under which the parameter appears in the edit Element modal. If this is not set, the parameter will appear under the General tab. Other built in options are advanced and style 

content_field
(boolean) (optional) Use this parameter value as the shortcode $content rather than as a shortcode attribute. Can only be used on one parameter per element. Must be used on a textarea field.

encode_base64
(boolean) (optional) Base64 encode the parameter value. Can be used on a text or textarea field type.

encode_url
(boolean) (optional) URL encode the parameter value. Can be used on a text or textarea field type.

id
(string) (required for custom_list type) A unique ID referencing a custom list. Only used on the custom_list field type. 

item_params
(array) (required for custom_list field type) An array of field parameters for custom list items. Only used on the custom_list field type. 

dependency
(array) (optional) Hide or show the parameter based on the value of another parameter


Dependency Array

param_name
(string) (required) The param_name of the parameter on which to depend 

One of the following is required:

not_empty
(boolean) Set to true to show parameter when linked param has any value 

value
(string|array) Set to true to show parameter when linked param has a matching value


Example

Still need help? Contact Us Contact Us