Skip to content

Instantly share code, notes, and snippets.

@Maden-maxi
Created December 23, 2017 16:32
Show Gist options
  • Save Maden-maxi/3dac4244d5a2535862b32acdf93ad5ef to your computer and use it in GitHub Desktop.
Save Maden-maxi/3dac4244d5a2535862b32acdf93ad5ef to your computer and use it in GitHub Desktop.
Filter for avada theme options
<?php
add_filter('avada_options_sections', 'avada_child_options_sections');
function avada_child_options_sections( $sections )
{
$sections['header']['fields']['header_info_1']['fields']['header_layout']['choices']['v8'] = AVADA_CHILD_THEME_DIR_URI . '/assets/img/header-pattern/header-8.png';
$sections['header']['fields']['header_info_1']['fields']['header_number']['required'][] = array(
'setting' => 'header_layout',
'operator' => '=',
'value' => 'v8',
);
$sections['extras']['fields']['misc_options_section']['fields']['content_copy_guard'] = array(
'label' => esc_html__( 'Site copy gaurd', 'Avada' ),
'description' => esc_html__( 'Controls content copy gaurd.', 'Avada' ),
'id' => 'content_copy_guard',
'default' => '0',
'type' => 'switch'
);
$sections['footer']['fields']['footer_styling_options_subsection']['fields']['footer_sticky_background_image'] = array(
'label' => esc_html__( 'Sticky Footer Background Image', 'Avada' ),
'description' => esc_html__( 'Controls Background Image Sticky Footer.', 'Avada' ),
'id' => 'footer_sticky_background_image',
'default' => '',
'mod' => '',
'type' => 'media',
'required' => array(
array(
'setting' => 'footer_special_effects',
'operator' => '==',
'value' => 'footer_sticky'
),
),
);
$sections['footer']['fields']['footer_styling_options_subsection']['fields']['footer_sticky_padding'] = array(
'label' => esc_html__( 'Footer Sticky Padding', 'Avada' ),
'description' => esc_html__( 'Controls the top/right/bottom/left padding for the footer sticky.', 'Avada' ),
'id' => 'footer_sticky_padding',
'choices' => array(
'top' => true,
'bottom' => true,
'left' => true,
'right' => true,
'units' => array( 'px', '%' ),
),
'default' => array(
'top' => '43px',
'bottom' => '40px',
'left' => '0px',
'right' => '0px',
),
'type' => 'spacing',
'class' => 'fusion-or-gutter',
'required' => array(
array(
'setting' => 'footer_special_effects',
'operator' => '==',
'value' => 'footer_sticky'
),
),
);
$sections['footer']['fields']['footer_styling_options_subsection']['fields']['footer_sticky_background_color'] = array(
'label' => esc_html__( 'Footer Sticky Background Color', 'Avada' ),
'description' => esc_html__( 'Controls the background color of the sticky footer.', 'Avada' ),
'id' => 'footer_sticky_bg_color',
'default' => '',
'type' => 'color-alpha',
'required' => array(
array(
'setting' => 'footer_special_effects',
'operator' => '==',
'value' => 'footer_sticky',
),
),
);
$sections['footer']['fields']['footer_styling_options_subsection']['fields']['footer_sticky_text_color'] = array(
'label' => esc_html__( 'Footer Sticky Text Color', 'Avada' ),
'description' => esc_html__( 'Controls the text color of the sticky footer.', 'Avada' ),
'id' => 'footer_sticky_text_color',
'default' => '#363839',
'type' => 'color-alpha',
'required' => array(
array(
'setting' => 'footer_special_effects',
'operator' => '==',
'value' => 'footer_sticky',
),
),
);
$sections['footer']['fields']['footer_styling_options_subsection']['fields']['footer_logic_hide'] = array(
'label' => esc_html__( 'Footer Sticky logic hide', 'Avada' ),
'description' => esc_html__( 'Controls the hide logic of the sticky footer.', 'Avada' ),
'id' => 'footer_logic_hide',
'default' => '1',
'type' => 'switch'
);
$sections['footer']['fields']['footer_styling_options_subsection']['fields']['footer_show_in_bottom'] = array(
'label' => esc_html__( 'Show Sticky footer at the bottom of page?', 'Avada' ),
'description' => esc_html__( 'Controls the hide logic of the sticky footer.', 'Avada' ),
'id' => 'footer_show_in_bottom',
'default' => '1',
'type' => 'switch',
'required' => array(
array(
'setting' => 'footer_logic_hide',
'operator' => '==',
'value' => '1',
),
),
);
$sections['debug_section'] = array(
'label' => esc_html__( 'Debug', 'Avada' ),
'id' => 'debug_section',
'priority' => 24,
'icon' => 'el-icon-cogs',
'fields' => array(
array(
'label' => esc_html__( 'Maket debug', 'Avada' ),
'description' => esc_html__( 'Controls the hide or show maket on background.', 'Avada' ),
'id' => 'debug_section_maket',
'default' => '0',
'type' => 'switch'
),
array(
'label' => esc_html__( 'Maket Image', 'Avada' ),
'description' => esc_html__( 'Choose maket.', 'Avada' ),
'id' => 'debug_section_maket_image',
'default' => '',
'mod' => '',
'type' => 'media',
'required' => array(
array(
'setting' => 'debug_section_maket',
'operator' => '==',
'value' => '1'
),
),
)
)
);
return $sections;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment