If you want to update any existing element setting options, you can simply use this function and the values will get appended to the existing settings for that element.
The functionCopy to Clipboardfusion_builder_update_element( $shortcode_tag, $param_name, $values_to_append ); 1fusion_builder_update_element( $shortcode_tag, $param_name, $values_to_append );Basic usageCopy to Clipboardfunction update_element_options() {
// Example of how to add or modify options to existing element in Fusion Builder.
if ( function_exists( 'fusion_builder_update_element' ) ) {
fusion_builder_update_element( 'fusion_button', 'color', array( 'cyan' => esc_attr__( 'New - Cyan', 'fusion-builder' ) ) );
fusion_builder_update_element( 'fusion_button', 'color', array( 'black' => esc_attr__( 'New - Black', 'fusion-builder' ) ) );
fusion_builder_update_element( 'fusion_button', 'element_content', 'Sample Button' );
}
}
add_action( 'fusion_builder_before_init', 'update_element_options', 11 );x 1function update_element_options() {23 // Example of how to add or modify options to existing element in Fusion Builder.45 if ( function_exists( 'fusion_builder_update_element' ) ) {67 fusion_builder_update_element( 'fusion_button', 'color', array( 'cyan' => esc_attr__( 'New - Cyan', 'fusion-builder' ) ) );89 fusion_builder_update_element( 'fusion_button', 'color', array( 'black' => esc_attr__( 'New - Black', 'fusion-builder' ) ) );1011 fusion_builder_update_element( 'fusion_button', 'element_content', 'Sample Button' );1213 }1415}1617add_action( 'fusion_builder_before_init', 'update_element_options', 11 );The above example will add the color option 「Black」 and 「Cyan」 in the colors dropdown for the button element. Which will output the color class name as 「fusion-black」 and 「fusion-cyan」, which you can use to customize the color for your button.
This is a rather simple solution if you want to use the custom color combination buttons on your site.
Function Parameters$shortcode_tag
( string ) Registered shortcode name in Avada Builder.$param_name
( string ) Param name to be altered. Check shortcode to get the param name.$values_to_append
( array | string ) Value to be set as default or append to the existing array.