Add new settings to Options Panel
To add your element settings to Element Options Panel, you need to use the filter to create your options class that extends to the Fusion_Element class, which will be available in the filter. So, you can add the filter like this:
This will require you to add another file in the options folder named sample-options.php. In which, you need to check for the class Fusion_Element and create your new class for options and inherit it to the Fusion_Element class.
Once you are done with the class creation, just add a new function add_options() to the class, which will be used to add your options to the Options Panel by the Fusion_Element class automatically, like below –
The example is a complete class that will add the Sample Element settings to the options panel.
You can use the Sample Addon we created for better understanding of the implementation of options.
After adding your setting to the options panel, you can also take advantage of the option correlations. This means when you edit the element in the builder, the current default value is displayed along with a link to that setting in the options panel. To do this, you can use a filter from your element class.
For example, the construct function would become:
and then a new function added below that:
The format for each is like so:
There are also optional attributes which can be set in addition to theme-option:
For a better understanding of the available options, please check the get_default_description function within class-fusion-settings.php