Created
March 26, 2018 05:13
-
-
Save lots0logs/625b4039355db0faa078c0fb56404930 to your computer and use it in GitHub Desktop.
All Advanced Fields Configuration Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SIMP_SimpleHeader extends ET_Builder_Module { | |
// Example 1: Include all advanced fields using their default configuartion | |
public function get_advanced_fields_config() { | |
return array(); | |
} | |
// Example 2: Include all advanced fields using custom configuartions | |
public function get_advanced_fields_config() { | |
return array( | |
'background' => array( | |
'options' => array( | |
'background_color' => array( | |
'default' => et_builder_accent_color(), | |
), | |
), | |
), | |
'borders' => array( | |
'default' => array( | |
'css' => array( | |
'main' => array( | |
'border_styles' => "{$this->main_css_element}.simp-custom-class", | |
), | |
), | |
'defaults' => array( | |
'border_radii' => 'on|3px|3px|3px|3px', | |
), | |
), | |
), | |
'box_shadow' => array( | |
'default' => array( | |
'css' => array( | |
'main' => "{$this->main_css_element}.simp-custom-class", | |
), | |
), | |
), | |
'button' => array( | |
'primary_button' => array( | |
'box_shadow' => array( | |
'css' => array( | |
'main' => "{$this->main_css_element} .simp-button--primary", | |
), | |
), | |
'css' => array( | |
'plugin_main' => "{$this->main_css_element} .simp-button--primary", | |
'alignment' => "{$this->main_css_element} .simp-button-wrapper", | |
), | |
'label' => esc_html__( 'Primary Button', 'simp-simple' ), | |
'use_alignment' => true, | |
), | |
), | |
'filters' => array( | |
'child_filters_target' => array( | |
'tab_slug' => 'advanced', | |
'toggle_slug' => 'image', | |
), | |
'css' => array( | |
'main' => '%%order_class%%', | |
), | |
), | |
'fonts' => array( | |
'body' => array( | |
'css' => array( | |
'line_height' => "{$this->main_css_element} p", | |
'plugin_main' => "{$this->main_css_element} p", | |
'text_shadow' => "{$this->main_css_element} p", | |
), | |
'label' => esc_html__( 'Body', 'simp-simple' ), | |
), | |
'header' => array( | |
'css' => array( | |
'main' => "{$this->main_css_element} h2, {$this->main_css_element} h1, {$this->main_css_element} h3, {$this->main_css_element} h4, {$this->main_css_element} h5, {$this->main_css_element} h6", | |
'important' => 'all', | |
), | |
'header_level' => array( | |
'default' => 'h2', | |
), | |
'label' => esc_html__( 'Title', 'simp-simple' ), | |
), | |
), | |
'margin_padding' => array( | |
'css' => array( | |
'important' => 'all', | |
), | |
), | |
'max_width' => array( | |
'css' => array( | |
'module_alignment' => "{$this->main_css_element}.simp-custom-class", | |
), | |
), | |
); | |
} | |
// Example 3: Do not include any advanced fields | |
public function get_advanced_fields_config() { | |
return array( | |
'background' => false, | |
'borders' => false, | |
'box_shadow' => false, | |
'button' => false, | |
'filters' => false, | |
'fonts' => false, | |
'margin_padding' => false, | |
'max_width' => false, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, It is possible to create a custom field type? i have created a custom element for Divi with field type of Select options with multiple select functionality like <select multiple......, it's a great help if you can give me a direction for this issues. Thanks