To add a new element to Avada Builder you have to register a new shortcode as usual. Add it to Avada Builder as a new element via available helper function below.
fusion_builder_map()
Copy 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,
'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 'params' => array(12 array(13 'type' => 'tinymce',14 'heading' => esc_attr__( 'Content', 'fusion-builder' ),15 'description' => esc_attr__( 'Enter some content for this textblock.', 'fusion-builder' ),16 'param_name' => 'element_content',17 'value' => esc_attr__( 'Click edit button to change this text.', 'fusion-builder' ),18 ),19 ),20 ) 21);22}23add_action( 'fusion_builder_before_init', 'fusion_element_text' );