Add a new element to Avada shortcode generator

Add a new element to Avada shortcode generator

To add a new element to Avada shortcode generator you have to register a new shortcode as usual. Add it to Avada shortcode generator via available helper function below.
This element is registered as a shortcode generator element by providing generator_only attribute to
fusion_builder_map() function.
Copy to Clipboardfunction add_my_generator_element() {

fusion_builder_map(
array(
'name' => esc_attr__( 'My element', 'fusion-builder' ),
'shortcode' => 'my_generator_element',
'icon' => 'fusiona-font',
'generator_only' => true,
'params' => array(
array(
'type' => 'tinymce',
'heading' => esc_attr__( 'Content', 'fusion-builder' ),
'description' => esc_attr__( 'Enter description', 'fusion-builder' ),
'param_name' => 'element_content',
'value' => esc_attr__( 'Default value', 'fusion-builder' ),
),
),
)
);
}
add_action( 'fusion_builder_before_init', 'add_my_generator_element' );​x 1function add_my_generator_element() {2​3fusion_builder_map( 4    array(5        'name'            => esc_attr__( 'My element', 'fusion-builder' ),6        'shortcode'       => 'my_generator_element',7        'icon'            => 'fusiona-font',8        'generator_only'  => true,9        'params'          => array(10            array(11                'type'        => 'tinymce',12                'heading'     => esc_attr__( 'Content', 'fusion-builder' ),13                'description' => esc_attr__( 'Enter description', 'fusion-builder' ),14                'param_name'  => 'element_content',15                'value'       => esc_attr__( 'Default value', 'fusion-builder' ),16           ),17       ),18   ) 19);20}21add_action( 'fusion_builder_before_init', 'add_my_generator_element' );

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注