fusion_builder_map()Copy to Clipboardfusion_builder_map(array $atts) 1fusion_builder_map(array $atts)Add a registered shortcode as an element to the Avada Builder elements library.
Attributes$atts (array) (Required) – An array of element attributes which are used by Avada Builder to register new element.
name (string) Name of element that is displayed in libraryshortcode (string) Shortcode tagicon (string) Element icon that is displayed in librarymulti (boolean) Set to true for elements with nested structure. See: Add new multi (nested) elementpreview (string) Absolute url to element preview template filepreview_id (string) Element preview template IDhide_from_builder (boolean) Hide element from libraryallow_generator (boolean) Enable Avada Builder shortcode generator on this element』s Visual editor windowgenerator_only (boolean) Element can be added from Avada Builder generator onlyparams (array) Element settings. These settings are displayed on element settings windowadmin_enqueue_js (string) Absolute url to javascript file, this file is loaded with the element on WordPress backendadmin_enqueue_css (string) Absolute url to css file, this file is loaded with the element on WordPress backendfront_enqueue_js (string) Element javascript file. Absolute url to javascript file, this file is loaded with the element on frontendfront_enqueue_css (string) Element css file. Absolute url to css file, this file is loaded with the element on frontendon_save (string) Function name. Optional function that runs when saving element settings. Can be used to manipulate generated shortcode attributes contentcustom_settings_view_js (string) Custom element settings backbone view. Absolute url to javascript file, this file is loaded with the element on WordPress backendcustom_settings_view_name (string) Custom element settings view namecustom_settings_template_file (string) Custom element settings template that will be loaded instead of default one. Absolute url to template fileadd_edit_items (string) Sets a custom title/heading of the parent/child sortable area. If this is not used, it defaults to 「Add/Edit Items」sortable_items_info (string) Sets a custom description (the paragraph part under the heading) for the parent/child sortable area. If this is not used, it defaults to 「Add or edit new items for this element. Drag and drop them into the desired order.」ParametersAn associative array of element settings that are displayed on element settings window. Each param_name must match shortcode attribute name.
type (string) Element setting type that is used on element settings page. See: Available setting typesheading (string) Element setting name that is displayed on element settings pagedescription (string) Element setting description text that is displayed on element settings pageparam_name (string) Parameter name. Must match shortcode attribute name. Use element_content as param name for shortcode enclosed contentvalue (string | integer | bloolean | array ) Default setting valuegroup (string) Setting group for this settingmin (string | float | integer ) Minimum setting value. Used for range setting type onlymax (string | float | integer ) Maximum setting value. Used for range setting type onlystep (string | float | integer ) Setting range step. Used for range setting type onlyCopy to Clipboardfunction fusion_element_text() {
fusion_builder_map(
array(
'name' => esc_attr__( 'Text Block', 'fusion-builder' ),
'shortcode' => 'fusion_text',
'icon' => 'fusiona-font',
'preview' => PLUGIN_DIR . 'js/previews/fusion-text-preview.php',
'preview_id' => 'fusion-builder-block-module-text-preview-template',
'allow_generator' => true,
'add_edit_items' => 'Add Content Box',
'sortable_items_info' => 'Some custom intro added here.',
'params' => array(
array(
'type' => 'tinymce',
'heading' => esc_attr__( 'Content', 'fusion-builder' ),
'description' => esc_attr__( 'Enter some content for this textblock.', 'fusion-builder' ),
'param_name' => 'element_content',
'value' => esc_attr__( 'Click edit button to change this text.', 'fusion-builder' ),
),
),
)
);
}
add_action( 'fusion_builder_before_init', 'fusion_element_text' );x 1function fusion_element_text() {23fusion_builder_map( 4 array(5 'name' => esc_attr__( 'Text Block', 'fusion-builder' ),6 'shortcode' => 'fusion_text',7 'icon' => 'fusiona-font',8 'preview' => PLUGIN_DIR . 'js/previews/fusion-text-preview.php',9 'preview_id' => 'fusion-builder-block-module-text-preview-template',10 'allow_generator' => true,11 'add_edit_items' => 'Add Content Box',12 'sortable_items_info' => 'Some custom intro added here.',13 'params' => array(14 array(15 'type' => 'tinymce',16 'heading' => esc_attr__( 'Content', 'fusion-builder' ),17 'description' => esc_attr__( 'Enter some content for this textblock.', 'fusion-builder' ),18 'param_name' => 'element_content',19 'value' => esc_attr__( 'Click edit button to change this text.', 'fusion-builder' ),20 ),21 ),22 ) 23);24}25add_action( 'fusion_builder_before_init', 'fusion_element_text' );