init
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* - Account
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header_account', array(
|
||||
'title' => __( 'Account', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'account_icon_style',
|
||||
'label' => __( 'Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'disabled.svg',
|
||||
'image' => $image_url . 'account-icon-image.svg',
|
||||
'plain' => $image_url . 'account-icon-plain.svg',
|
||||
'fill' => $image_url . 'account-icon-fill.svg',
|
||||
'fill-round' => $image_url . 'account-icon-fill-round.svg',
|
||||
'outline' => $image_url . 'account-icon-outline.svg',
|
||||
'outline-round' => $image_url . 'account-icon-outline-round.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_account_title',
|
||||
'label' => __( 'Show label', 'flatsome-admin' ),
|
||||
'description' => __( 'Display label for logged in users.', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_account_username',
|
||||
'label' => __( 'Use username as label', 'flatsome-admin' ),
|
||||
'description' => __( 'Display username instead of fixed label for logged in users.', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'transport' => $transport,
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_account_title',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_account_login',
|
||||
'label' => '',
|
||||
'section' => 'header_account',
|
||||
'default' => '<div class="options-title-divider">Login</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'account_login_style',
|
||||
'label' => __( 'Login Style', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'transport' => $transport,
|
||||
'default' => 'lightbox',
|
||||
'choices' => array(
|
||||
'link' => __( 'Link', 'flatsome-admin' ),
|
||||
'lightbox' => __( 'Lightbox', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_account_register',
|
||||
'label' => '',
|
||||
'section' => 'header_account',
|
||||
'default' => '<div class="options-title-divider">Register</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_account_register',
|
||||
'label' => __( 'Show "Register" label', 'flatsome-admin' ),
|
||||
'description' => __( 'Display "Register" for non logged in users.', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'account_login_lightbox_layout',
|
||||
'label' => __( 'Lightbox layout (register)', 'flatsome-admin' ),
|
||||
'description' => 'Register form/link is only visible for non logged in users and if the WooCommerce setting, "Allow customers to create an account on the "My account" page" is enabled.',
|
||||
'section' => 'header_account',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'account_login_style',
|
||||
'operator' => '===',
|
||||
'value' => 'lightbox',
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => flatsome_customizer_images_uri() . '/form-login.svg',
|
||||
'lightbox-left-panel' => flatsome_customizer_images_uri() . '/form-login-lightbox-left-panel.svg',
|
||||
'lightbox-right-panel' => flatsome_customizer_images_uri() . '/form-login-lightbox-right-panel.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'settings' => 'account_login_lightbox_side_panel_block',
|
||||
'label' => __( 'Side panel block', 'flatsome-admin' ),
|
||||
'description' => __( 'Replace side panel content with a custom Block that can be edited in UX Builder.', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'account_login_style',
|
||||
'operator' => '===',
|
||||
'value' => 'lightbox',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_layout',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => false,
|
||||
'choices' => flatsome_customizer_blocks(),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'account_login_lightbox_side_panel_bg_color',
|
||||
'label' => __( 'Side panel background color', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'account_login_style',
|
||||
'operator' => '===',
|
||||
'value' => 'lightbox',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_layout',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_side_panel_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'default' => Flatsome_Default::COLOR_PRIMARY,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'account_login_lightbox_side_panel_bg_image',
|
||||
'label' => __( 'Side panel background image', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'account_login_style',
|
||||
'operator' => '===',
|
||||
'value' => 'lightbox',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_layout',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_side_panel_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'account_login_lightbox_side_panel_bg_overlay',
|
||||
'label' => __( 'Side panel background overlay', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'account_login_style',
|
||||
'operator' => '===',
|
||||
'value' => 'lightbox',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_layout',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
array(
|
||||
'setting' => 'account_login_lightbox_side_panel_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_html_account_shortcut',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'header_account',
|
||||
'default' => '<button style="margin-top:30px; margin-bottom:15px" class="button button-primary" data-to-section="fl-my-account">Account Page Layout →</button>',
|
||||
) );
|
||||
|
||||
function flatsome_refresh_header_account_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Account
|
||||
$wp_customize->selective_refresh->add_partial( 'header-account', array(
|
||||
'selector' => '.header .account-item',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('header_account_register','account_login_style','account_icon_style','header_account_title','header_account_username'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','account');
|
||||
},
|
||||
) );
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_account_partials' );
|
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Header Main
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'bottom_bar', array(
|
||||
'title' => __( 'Header Bottom', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_bottom_layout',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => '<div class="options-title-divider">Layout</div>',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_bottom_height',
|
||||
'label' => __( 'Height', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'min' => 10,
|
||||
'max' => 100,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'nav_position_bg',
|
||||
'label' => __( 'Background color', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => "#f1f1f1",
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_bottom_nav',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => '<div class="options-title-divider">Navigation</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'nav_style_bottom',
|
||||
'label' => __( 'Nav Style', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_styles_img
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'nav_height_bottom',
|
||||
'label' => __( 'Nav Height', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => 16,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'nav_size_bottom',
|
||||
'label' => __( 'Nav Size', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => $nav_sizes
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'nav_spacing_bottom',
|
||||
'label' => __( 'Nav Spacing', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => $nav_sizes
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'nav_uppercase_bottom',
|
||||
'label' => __( 'Uppercase', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'nav_bottom_body_overlay',
|
||||
'label' => __( 'Add overlay on hover', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'nav_position_color',
|
||||
'label' => __( 'Nav Base Color', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'default' => 'light',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'dark' => $image_url . 'text-light.svg',
|
||||
'light' => $image_url . 'text-dark.svg'
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_nav_bottom_color',
|
||||
'label' => __( 'Nav Color', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_nav_bottom_color_hover',
|
||||
'label' => __( 'Nav Color :hover', 'flatsome-admin' ),
|
||||
'section' => 'bottom_bar',
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
|
@@ -0,0 +1,343 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'header_buttons',
|
||||
array(
|
||||
'title' => __( 'Buttons', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_button_1',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => '<div class="options-title-divider">Button 1</div>',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_1',
|
||||
'transport' => $transport,
|
||||
'default' => 'Button 1',
|
||||
'label' => __( 'Text', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_1_link',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'label' => __( 'Link', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'description' => $smart_links,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_button_1_link_target',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Target', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => '_self',
|
||||
'choices' => array(
|
||||
'_self' => __( 'Same window', 'flatsome-admin' ),
|
||||
'_blank' => __( 'New window', 'flatsome-admin' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_1_link_rel',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'label' => __( 'Rel', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_1_radius',
|
||||
'transport' => $transport,
|
||||
'default' => '99px',
|
||||
'label' => __( 'Radius', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_button_1_color',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Color', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 'primary',
|
||||
'choices' => array(
|
||||
'plain' => __( 'Plain', 'flatsome-admin' ),
|
||||
'primary' => __( 'Primary', 'flatsome-admin' ),
|
||||
'secondary' => __( 'Secondary', 'flatsome-admin' ),
|
||||
'success' => __( 'Success', 'flatsome-admin' ),
|
||||
'alert' => __( 'Alert', 'flatsome-admin' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_button_1_style',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Style', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'choices' => $button_styles,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_button_1_size',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Size', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'choices' => $nav_sizes,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_button_1_depth',
|
||||
'label' => __( 'Depth', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => $transport,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_button_1_depth_hover',
|
||||
'label' => __( 'Depth :hover', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => $transport,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_button_2',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => '<div class="options-title-divider">Button 2</div>',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_2',
|
||||
'transport' => $transport,
|
||||
'default' => 'Button 2',
|
||||
'label' => __( 'Text', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_2_link',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'label' => __( 'Link', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'description' => $smart_links,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_button_2_link_target',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Target', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => '_self',
|
||||
'choices' => array(
|
||||
'_self' => __( 'Same window', 'flatsome-admin' ),
|
||||
'_blank' => __( 'New window', 'flatsome-admin' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_2_link_rel',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'label' => __( 'Rel', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_button_2_radius',
|
||||
'transport' => $transport,
|
||||
'default' => '99px',
|
||||
'label' => __( 'Radius', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_button_2_color',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Color', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 'secondary',
|
||||
'choices' => array(
|
||||
'plain' => __( 'Plain', 'flatsome-admin' ),
|
||||
'primary' => __( 'Primary', 'flatsome-admin' ),
|
||||
'secondary' => __( 'Secondary', 'flatsome-admin' ),
|
||||
'success' => __( 'Success', 'flatsome-admin' ),
|
||||
'alert' => __( 'Alert', 'flatsome-admin' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_button_2_style',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Style', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 'outline',
|
||||
'choices' => $button_styles,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_button_2_size',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Size', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'choices' => $nav_sizes,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_button_2_depth',
|
||||
'label' => __( 'Depth', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => $transport,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_button_2_depth_hover',
|
||||
'label' => __( 'Depth :hover', 'flatsome-admin' ),
|
||||
'section' => 'header_buttons',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => $transport,
|
||||
)
|
||||
);
|
||||
|
||||
function flatsome_refresh_header_buttons_partials( WP_Customize_Manager $wp_customize ) {
|
||||
// Abort if selective refresh is not available.
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-button-2',
|
||||
array(
|
||||
'selector' => '.header-button-2',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array(
|
||||
'header_button_2',
|
||||
'header_button_2_radius',
|
||||
'header_button_2_link',
|
||||
'header_button_2_style',
|
||||
'header_button_2_color',
|
||||
'header_button_2_size',
|
||||
'header_button_2_depth',
|
||||
'header_button_2_depth_hover',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
get_template_part( 'template-parts/header/partials/element', 'button-2' );
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-button-1',
|
||||
array(
|
||||
'selector' => '.header-button-1',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array(
|
||||
'header_button_1',
|
||||
'header_button_1_radius',
|
||||
'header_button_1_link',
|
||||
'header_button_1_style',
|
||||
'header_button_1_color',
|
||||
'header_button_1_size',
|
||||
'header_button_1_depth',
|
||||
'header_button_1_depth_hover',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
get_template_part( 'template-parts/header/partials/element', 'button-1' );
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_buttons_partials' );
|
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* - Cart
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header_cart', array(
|
||||
'title' => __( 'Cart', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_cart_style',
|
||||
'label' => __( 'Cart Style', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'transport' => $transport,
|
||||
'default' => 'dropdown',
|
||||
'choices' => array(
|
||||
'dropdown' => __( 'Dropdown', 'flatsome-admin' ),
|
||||
'off-canvas' => __( 'Off-Canvas Sidebar', 'flatsome-admin' ),
|
||||
'link' => __( 'Link Only', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cart_dropdown_show',
|
||||
'label' => __( 'Auto reveal mini cart', 'flatsome-admin' ),
|
||||
'description' => __( 'Reveal mini cart after a product is added', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_cart_style',
|
||||
'operator' => '!==',
|
||||
'value' => 'link',
|
||||
),
|
||||
),
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'cart_icon_style',
|
||||
'label' => __( 'Cart Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'cart-icon-default.svg',
|
||||
'plain' => $image_url . 'cart-icon-plain.svg',
|
||||
'outline' => $image_url . 'cart-icon-outline.svg',
|
||||
'fill' => $image_url . 'cart-icon-fill.svg',
|
||||
'fill-round' => $image_url . 'cart-icon-fill-round.svg',
|
||||
'outline-round' => $image_url . 'cart-icon-outline-round.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'cart_icon',
|
||||
'label' => __( 'Cart Icon', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'transport' => $transport,
|
||||
'default' => 'basket',
|
||||
'choices' => array(
|
||||
'basket' => $image_url . 'cart-icon-basket.svg',
|
||||
'cart' => $image_url . 'cart-icon-cart.svg',
|
||||
'bag' => $image_url . 'cart-icon-bag.svg',
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'custom_cart_icon',
|
||||
'label' => __( 'Custom Cart Icon', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_cart_total',
|
||||
'label' => __( 'Show cart totals', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_cart_title',
|
||||
'label' => __( 'Show cart title', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_cart_header',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Custom Content after Cart', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'header_cart',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
function flatsome_refresh_header_cart_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Cart
|
||||
$wp_customize->selective_refresh->add_partial( 'header-cart', array(
|
||||
'selector' => '.cart-item',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','cart');
|
||||
},
|
||||
) );
|
||||
|
||||
// Cart
|
||||
$wp_customize->selective_refresh->add_partial( 'header-cart', array(
|
||||
'selector' => '.header-nav .cart-item',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','cart');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-cart-mobile', array(
|
||||
'selector' => '.mobile-nav .cart-item',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','cart-mobile');
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_cart_partials' );
|
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/*****
|
||||
* Contact
|
||||
*************/
|
||||
Flatsome_Option::add_section( 'header_contact', array(
|
||||
'title' => __( 'Contact', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'contact_style',
|
||||
'label' => __( 'Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => 'left',
|
||||
'choices' => array(
|
||||
'left' => __( 'Icons Left', 'flatsome-admin' ),
|
||||
'icons' => __( 'Icons Only', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_icon_size',
|
||||
'label' => __( 'Icon Size', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '16px',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_phone',
|
||||
'label' => __( 'Phone', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '+47 900 99 000',
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_email',
|
||||
'label' => __( 'E-mail', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => 'youremail@gmail.com',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_email_label',
|
||||
'label' => __( 'E-mail label', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_location',
|
||||
'label' => __( 'Location', 'flatsome-admin' ),
|
||||
'help' => __( 'Type in the location of your place or shop. It will open in a new window on Google Maps', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_location_label',
|
||||
'label' => __( 'Location label', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'contact_hours',
|
||||
'label' => __( 'Open Hours', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '08:00 - 17:00',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'contact_hours_details',
|
||||
'label' => __( 'Open Hours - Details', 'flatsome-admin' ),
|
||||
'section' => 'header_contact',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
function flatsome_refresh_header_contact_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-contact', array(
|
||||
'selector' => '.header-contact-wrapper',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('contact_location_label','contact_email_label','contact_icon_size','contact_style','contact_location','contact_phone','contact_email','contact_hours_details','contact_hours','contact_hours'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','contact');
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_contact_partials' );
|
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* HTML content
|
||||
*************/
|
||||
|
||||
// Add section immediately to keep sort order.
|
||||
Flatsome_Option::add_section( 'header_content', array(
|
||||
'title' => __( 'HTML', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
) );
|
||||
|
||||
function flatsome_customizer_header_content_options() {
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header-block-1',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'Header Block 1', 'flatsome-admin' ),
|
||||
'description' => __( 'Blocks can be edited in the page builder. Select a block, go to a page and open in the the Page Builder.', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'choices' => flatsome_customizer_blocks(),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header-block-2',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'Header Block 2', 'flatsome-admin' ),
|
||||
'description' => __( 'Blocks can be edited in the page builder. Select a block, go to a page and open in the the Page Builder.', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'choices' => flatsome_customizer_blocks(),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'topbar_left',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'HTML 1', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '<strong class="uppercase">Add anything here or just remove it...</strong>',
|
||||
));
|
||||
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'topbar_right',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'HTML 2', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'top_right_text',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'HTML 3', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'nav_position_text_top',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'HMTL 4', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'nav_position_text',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'HTML 5', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'header_content',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
}
|
||||
add_action( 'init', 'flatsome_customizer_header_content_options' );
|
||||
|
||||
function flatsome_refresh_header_content_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'top_right_text', array(
|
||||
'selector' => '.html_top_right_text',
|
||||
'settings' => array('top_right_text'),
|
||||
'render_callback' => function() {
|
||||
return flatsome_option('top_right_text');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'nav_position_text_top', array(
|
||||
'selector' => '.html_nav_position_text_top',
|
||||
'settings' => array('nav_position_text_top'),
|
||||
'render_callback' => function() {
|
||||
return flatsome_option('nav_position_text_top');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'topbar_left', array(
|
||||
'selector' => '.html_topbar_left',
|
||||
'settings' => array('topbar_left'),
|
||||
'render_callback' => function() {
|
||||
return flatsome_option('topbar_left');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'topbar_right', array(
|
||||
'selector' => '.html_topbar_right',
|
||||
'settings' => array('topbar_right'),
|
||||
'render_callback' => function() {
|
||||
return flatsome_option('topbar_right');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'nav_position_text', array(
|
||||
'selector' => '.html_nav_position_text',
|
||||
'settings' => array('nav_position_text'),
|
||||
'render_callback' => function() {
|
||||
return flatsome_option('nav_position_text');
|
||||
},
|
||||
) );
|
||||
|
||||
|
||||
// Header block
|
||||
$wp_customize->selective_refresh->add_partial( 'header-block-1', array(
|
||||
'selector' => '.header-block-1',
|
||||
'settings' => array('header-block-1'),
|
||||
'render_callback' => function() {
|
||||
return do_shortcode('[block id="'.flatsome_option('header-block-1').'"]');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-block-2', array(
|
||||
'selector' => '.header-block-2',
|
||||
'settings' => array('header-block-2'),
|
||||
'render_callback' => function() {
|
||||
return do_shortcode('[block id="'.flatsome_option('header-block-2').'"]');
|
||||
},
|
||||
) );
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_content_partials' );
|
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Header Dropdown Style
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header_dropdown', array(
|
||||
'title' => __( 'Dropdown Style', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_dropdown_all',
|
||||
'label' => '',
|
||||
'section' => 'header_dropdown',
|
||||
'default' => '<div class="options-title-divider">All Dropdowns</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'dropdown_bg',
|
||||
'transport' => 'postMessage',
|
||||
'label' => __( 'Background color', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'dropdown_border_enabled',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Add border', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'dropdown_border',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Border Color', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'dropdown_border_enabled',
|
||||
'operator' => '==',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'dropdown_shadow',
|
||||
'label' => __( 'Add shadow', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
'section' => 'header_dropdown',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'dropdown_nav_size',
|
||||
'label' => __( 'Dropdown Content Size (%)', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'default' => 100,
|
||||
'choices' => array(
|
||||
'min' => 50,
|
||||
'max' => 200,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'dropdown_radius',
|
||||
'label' => __( 'Dropdown radius', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'transport' => 'postMessage',
|
||||
'default' => '0',
|
||||
'choices' => array(
|
||||
'0' => __( '0px', 'flatsome-admin' ),
|
||||
'3px' => __( '3px', 'flatsome-admin' ),
|
||||
'5px' => __( '5px', 'flatsome-admin' ),
|
||||
'10px' => __( '10px', 'flatsome-admin' ),
|
||||
'15px' => __( '15px', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_dropdown_default',
|
||||
'label' => '',
|
||||
'section' => 'header_dropdown',
|
||||
'default' => '<div class="options-title-divider">Default Dropdowns</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'dropdown_arrow',
|
||||
'label' => __( 'Add arrow', 'flatsome-admin' ),
|
||||
'description' => __( 'Shows a focusing arrow towards the active menu item.', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
'section' => 'header_dropdown',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'dropdown_style',
|
||||
'transport' => 'postMessage',
|
||||
'label' => __( 'Link Style', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'default' => 'default',
|
||||
'choices' => array(
|
||||
'simple' => $image_url . 'dropdown-style-1.svg',
|
||||
'default' => $image_url . 'dropdown-style-2.svg',
|
||||
'bold' => $image_url . 'dropdown-style-3.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'dropdown_text',
|
||||
'label' => __( 'Text Color', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'transport' => 'postMessage',
|
||||
'default' => 'light',
|
||||
'choices' => array(
|
||||
'light' => __( 'Dark', 'flatsome-admin' ),
|
||||
'dark' => __( 'Light', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'dropdown_text_style',
|
||||
'transport' => 'postMessage',
|
||||
'label' => __( 'Text Style', 'flatsome-admin' ),
|
||||
'section' => 'header_dropdown',
|
||||
'default' => 'simple',
|
||||
'choices' => array(
|
||||
'simple' => __( 'Simple', 'flatsome-admin' ),
|
||||
'uppercase' => __( 'UPPERCASE', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
function flatsome_refresh_dropdown_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
// Abort if selective refresh is not available.
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'refresh_css_dropdown', array(
|
||||
'selector' => 'head > style#custom-css',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array(
|
||||
'dropdown_border_enabled',
|
||||
'dropdown_border',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
flatsome_custom_css();
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'flatsome_refresh_dropdown_partials' );
|
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Header Main
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header-layout', array(
|
||||
'title' => __( 'Elements', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'flatsome_version',
|
||||
'label' => __( 'Flatsome Version', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'topbar_elements_left',
|
||||
'label' => __( '← Left Elements', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_topbar_elements_left(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'topbar_elements_center',
|
||||
'label' => __( 'Center Elements', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => array(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'topbar_elements_right',
|
||||
'label' => __( 'Right Elements →', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'transport' => $transport,
|
||||
'default' => flatsome_topbar_elements_right(),
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_layout_main',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'default' => '<div class="options-title-divider">Main Header</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_elements_left',
|
||||
'label' => __( 'Left Elements', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'transport' => 'postMessage',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_elements_left(),
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_elements_right',
|
||||
'label' => __( 'Right Elements', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'transport' => 'postMessage',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_elements_right(),
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_elements_bottom_left',
|
||||
'label' => __( 'Left Elements', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_elements_bottom_left(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_elements_bottom_center',
|
||||
'label' => __( 'Left Elements', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_elements_bottom_center(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_elements_bottom_right',
|
||||
'label' => __( 'Right Elements', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_elements_bottom_right(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_mobile_elements_top',
|
||||
'label' => __( 'Mobile Top', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_mobile_elements_top(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_mobile_elements_left',
|
||||
'label' => __( 'Left Elements', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_mobile_elements_left(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_mobile_elements_right',
|
||||
'label' => __( 'Left Elements', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => flatsome_header_mobile_elements_right(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_mobile_elements_bottom',
|
||||
'label' => __( 'Left Elements', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'multiple' => 5,
|
||||
'default' => array(),
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_elements
|
||||
));
|
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* LOGO
|
||||
*************/
|
||||
|
||||
function flatsome_logo_name_customizer( $wp_customize ) {
|
||||
global $transport;
|
||||
$wp_customize->get_setting('blogname')->transport=$transport;
|
||||
$wp_customize->get_setting('blogdescription')->transport=$transport;
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_logo_name_customizer' );
|
||||
|
||||
Flatsome_Option::add_section( 'title_tagline', array(
|
||||
'title' => __( 'Logo & Site Identity', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'site_logo_slogan',
|
||||
'label' => __( 'Display below Logo', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'transport' => $transport,
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'logo_position',
|
||||
'label' => __( 'Logo position', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'transport' => 'postMessage',
|
||||
'default' => 'left',
|
||||
'choices' => array(
|
||||
'left' => $image_url . 'logo-left.svg',
|
||||
'center' => $image_url . 'logo-right.svg',
|
||||
//'vertical' => $image_url . 'logo-vertical.png'
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'site_logo',
|
||||
'label' => __( 'Logo image', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'transport' => $transport,
|
||||
'default' => get_template_directory_uri().'/assets/img/logo.png',
|
||||
'choices' => array( 'save_as' => 'id' ),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'site_logo_dark',
|
||||
'label' => __( 'Logo image - Light Version', 'flatsome-admin' ),
|
||||
'description' => __( 'Upload an alternative light logo that will be used on Dark and Transparent Header templates', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'transport' => $transport,
|
||||
'choices' => array( 'save_as' => 'id' ),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'logo_width',
|
||||
'label' => __( 'Logo container width', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'default' => 200,
|
||||
'choices' => array(
|
||||
'min' => 30,
|
||||
'max' => 700,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'logo_max_width',
|
||||
'label' => __( 'Logo max width (px)', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'description' => __( 'Set the logo max width in pixels. Leave it blank to make it auto fit inside the logo container.', 'flatsome-admin' ),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'logo_padding',
|
||||
'label' => __( 'Logo Padding', 'flatsome-admin' ),
|
||||
'section' => 'title_tagline',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 30,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'link',
|
||||
'settings' => 'logo_link',
|
||||
'label' => __( 'Logo link', 'flatsome' ),
|
||||
'description' => __( 'Custom logo link (defaults to home page link if empty).', 'flatsome' ),
|
||||
'section' => 'title_tagline',
|
||||
'default' => '',
|
||||
) );
|
@@ -0,0 +1,295 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Header Main
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'main_bar', array(
|
||||
'title' => __( 'Header Main', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_layout',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '<div class="options-title-divider">Layout</div>',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'header_width',
|
||||
'label' => __( 'Header Width', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 'container',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'container' => $image_url . 'container.svg',
|
||||
'full-width' => $image_url . 'full-width.svg'
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_height',
|
||||
'label' => __( 'Height', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 90,
|
||||
'choices' => array(
|
||||
'min' => 30,
|
||||
'max' => 500,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage'
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'header_color',
|
||||
'label' => __( 'Text color', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 'light',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'dark' => $image_url . 'text-light.svg',
|
||||
'light' => $image_url . 'text-dark.svg'
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'header_bg',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 'rgba(255,255,255,0.9)',
|
||||
'transport' => 'postMessage'
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'header_bg_img',
|
||||
'label' => __( 'Background Image', 'flatsome-admin' ),
|
||||
'help' => __( 'Image is added to .header container. Try set a header background with opacity if you can not see the background image. (Drag the alpha slider in the background selector)', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => "",
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_bg_img_repeat',
|
||||
'label' => __( 'Background Repeat', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 'repeat',
|
||||
'choices' => $bg_repeat,
|
||||
'transport' => 'postMessage',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_bg_img',
|
||||
'operator' => '!==',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'box_shadow_header',
|
||||
'label' => __( 'Add Shadow', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => 'postMessage',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_divider',
|
||||
'label' => __( 'Add Divider', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_after_header',
|
||||
'label' => __( 'HTML after header', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_nav',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '<div class="options-title-divider">Navigation</div>',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'nav_style',
|
||||
'label' => __( 'Navigation Style', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_styles_img
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'nav_size',
|
||||
'label' => __( 'Nav Size', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => $nav_sizes
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'nav_spacing',
|
||||
'label' => __( 'Nav Spacing', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => $nav_sizes
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'nav_uppercase',
|
||||
'label' => __( 'Uppercase', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'nav_body_overlay',
|
||||
'label' => __( 'Add overlay on hover', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'nav_height',
|
||||
'label' => __( 'Nav Height', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 16,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'nav_push',
|
||||
'label' => __( 'Nav Push', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => -50,
|
||||
'max' => 50,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_nav_color',
|
||||
'label' => __( 'Nav Color', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_nav_color_hover',
|
||||
'label' => __( 'Nav Color :hover', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'header_icons_color',
|
||||
'label' => __( 'Icons Color', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '',
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'header_icons_color_hover',
|
||||
'label' => __( 'Icons Color :hover', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '',
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_transparent',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '<div class="options-title-divider">Transparent Header</div>',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_height_transparent',
|
||||
'label' => __( 'Height - Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => 90,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'min' => 30,
|
||||
'max' => 500,
|
||||
'step' => 1
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'header_bg_transparent',
|
||||
'label' => __( 'Transparent Header Background Color', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'default' => '',
|
||||
'transport' => 'postMessage',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_bg_transparent_shade',
|
||||
'label' => __( 'Add Shade', 'flatsome-admin' ),
|
||||
'section' => 'main_bar',
|
||||
'transport' => 'postMessage',
|
||||
'default' => 0,
|
||||
));
|
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Header Mobile
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header_mobile', array(
|
||||
'title' => __( 'Header Mobile Menu / Overlay', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_height_mobile',
|
||||
'label' => __( 'Mobile Header Height', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'default' => '70',
|
||||
'choices' => array(
|
||||
'min' => 30,
|
||||
'max' => 500,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage'
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'logo_position_mobile',
|
||||
'label' => __( 'Logo position', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => $transport,
|
||||
'default' => 'center',
|
||||
'choices' => array(
|
||||
'left' => $image_url . 'logo-left.svg',
|
||||
'center' => $image_url . 'logo-right.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'menu_icon_style',
|
||||
'label' => __( 'Menu Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'' => $image_url . 'nav-icon-plain.svg',
|
||||
'outline' => $image_url . 'nav-icon-outline.svg',
|
||||
'fill' => $image_url . 'nav-icon-fill.svg',
|
||||
'fill-round' => $image_url . 'nav-icon-fill-round.svg',
|
||||
'outline-round' => $image_url . 'nav-icon-outline-round.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'menu_icon_title',
|
||||
'label' => __( 'Show Menu title', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => $transport,
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'mobile_overlay',
|
||||
'label' => __( 'Menu Overlay', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => $transport,
|
||||
'default' => 'left',
|
||||
'choices' => array(
|
||||
'left' => $image_url . 'overlay-left.svg',
|
||||
'right' => $image_url . 'overlay-right.svg',
|
||||
'center' => $image_url . 'overlay-center.svg'
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio',
|
||||
'settings' => 'mobile_submenu_parent_behavior',
|
||||
'label' => __( 'Menu item behavior', 'flatsome' ),
|
||||
'description' => __( 'Click behavior for menu items with a submenu', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => 'refresh',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => __( 'Open link', 'flatsome' ),
|
||||
'toggle' => __( 'Toggle submenu', 'flatsome' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio',
|
||||
'settings' => 'mobile_submenu_effect',
|
||||
'label' => __( 'Submenu effect', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => 'refresh',
|
||||
'default' => 'accordion',
|
||||
'choices' => array(
|
||||
'accordion' => __( 'Accordion', 'flatsome' ),
|
||||
'slide' => __( 'Slide', 'flatsome' ),
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'mobile_overlay',
|
||||
'operator' => '!=',
|
||||
'value' => 'center',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'mobile_submenu_levels',
|
||||
'label' => __( 'Submenu levels', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => 'refresh',
|
||||
'default' => '1',
|
||||
'choices' => array(
|
||||
'1' => __( '1 level', 'flatsome' ),
|
||||
'2' => __( '2 levels', 'flatsome' ),
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'mobile_overlay',
|
||||
'operator' => '!=',
|
||||
'value' => 'center',
|
||||
),
|
||||
array(
|
||||
'setting' => 'mobile_submenu_effect',
|
||||
'operator' => '===',
|
||||
'value' => 'slide',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'mobile_sidebar_top_content',
|
||||
'label' => __( 'Top content', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'mobile_sidebar_tabs',
|
||||
'label' => __( 'Tabs', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'default' => '0',
|
||||
'choices' => array(
|
||||
'0' => __( 'None', 'flatsome' ),
|
||||
'2' => __( '2 Tabs', 'flatsome' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'mobile_sidebar_tab_text',
|
||||
'label' => __( 'Tab 1 text', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'default' => '',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'mobile_sidebar_tabs',
|
||||
'operator' => '!=',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'sortable',
|
||||
'settings' => 'mobile_sidebar',
|
||||
'label' => __( 'Menu elements', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => $transport,
|
||||
'multiple' => 10,
|
||||
'default' => flatsome_header_mobile_sidebar(),
|
||||
'choices' => $nav_elements
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'mobile_sidebar_tab_2_text',
|
||||
'label' => __( 'Tab 2 text', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'default' => '',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'mobile_sidebar_tabs',
|
||||
'operator' => '!=',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'sortable',
|
||||
'settings' => 'mobile_sidebar_tab_2',
|
||||
'label' => __( 'Menu elements tab 2', 'flatsome' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'multiple' => 10,
|
||||
'default' => '',
|
||||
'choices' => $nav_elements,
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'mobile_sidebar_tabs',
|
||||
'operator' => '!=',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'mobile_overlay_color',
|
||||
'label' => __( 'Overlay Color', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'text-dark.svg',
|
||||
'dark' => $image_url . 'text-light.svg',
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'mobile_overlay_bg',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
'section' => 'header_mobile',
|
||||
'default' => '',
|
||||
'transport' => 'postMessage'
|
||||
));
|
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/**
|
||||
* Options for nav vertical element.
|
||||
*
|
||||
* @package flatsome
|
||||
*/
|
||||
|
||||
Flatsome_Option::add_section( 'header_nav_vertical', array(
|
||||
'title' => __( 'Vertical Menu', 'flatsome' ),
|
||||
'panel' => 'header',
|
||||
) );
|
||||
|
||||
/**
|
||||
* Add options.
|
||||
*/
|
||||
function flatsome_customizer_header_nav_vertical_options() {
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_nav_vertical_layout',
|
||||
'label' => '',
|
||||
'section' => 'header_nav_vertical',
|
||||
'default' => '<div class="options-title-divider">Opener</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'header_nav_vertical_icon_style',
|
||||
'label' => __( 'Icon', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'default' => 'plain',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'' => flatsome_customizer_images_uri() . '/disabled.svg',
|
||||
'plain' => flatsome_customizer_images_uri() . '/nav-icon-plain.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_nav_vertical_height',
|
||||
'label' => __( 'Height', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '50',
|
||||
'choices' => array(
|
||||
'min' => '10',
|
||||
'max' => '500',
|
||||
'step' => '1',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_nav_vertical_width',
|
||||
'label' => __( 'Width', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '250',
|
||||
'choices' => array(
|
||||
'min' => '10',
|
||||
'max' => '500',
|
||||
'step' => '1',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_nav_vertical_tagline',
|
||||
'label' => __( 'Tag line', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_nav_vertical_text',
|
||||
'label' => __( 'Text', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'header_nav_vertical_text_color',
|
||||
'label' => __( 'Text color', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'default' => 'dark',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'dark' => flatsome_customizer_images_uri() . '/text-light.svg',
|
||||
'light' => flatsome_customizer_images_uri() . '/text-dark.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'header_nav_vertical_bg_color',
|
||||
'label' => __( 'Background color', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_nav_vertical_fly_out',
|
||||
'label' => '',
|
||||
'section' => 'header_nav_vertical',
|
||||
'default' => '<div class="options-title-divider">Fly out</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_nav_vertical_fly_out_frontpage',
|
||||
'label' => __( 'Keep open on front page', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_nav_vertical_fly_out_shadow',
|
||||
'label' => __( 'Add shadow', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'header_nav_vertical_fly_out_text_color',
|
||||
'label' => __( 'Text color', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'default' => 'light',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'dark' => flatsome_customizer_images_uri() . '/text-light.svg',
|
||||
'light' => flatsome_customizer_images_uri() . '/text-dark.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'header_nav_vertical_fly_out_bg_color',
|
||||
'label' => __( 'Background color', 'flatsome' ),
|
||||
'section' => 'header_nav_vertical',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '',
|
||||
) );
|
||||
}
|
||||
|
||||
add_action( 'init', 'flatsome_customizer_header_nav_vertical_options' );
|
||||
|
||||
/**
|
||||
* Refresh partials.
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Customizer manager.
|
||||
*/
|
||||
function flatsome_refresh_header_nav_vertical_partials( WP_Customize_Manager $wp_customize ) {
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-vertical-menu', array(
|
||||
'selector' => '.header-vertical-menu',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array(
|
||||
'header_nav_vertical_icon_style',
|
||||
'header_nav_vertical_tagline',
|
||||
'header_nav_vertical_text',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
get_template_part( 'template-parts/header/partials/element', 'nav-vertical' );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-vertical-menu-refresh-css', array(
|
||||
'selector' => 'head > style#custom-css',
|
||||
'settings' => array(
|
||||
'header_nav_vertical_bg_color',
|
||||
'header_nav_vertical_fly_out_bg_color',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
flatsome_custom_css();
|
||||
},
|
||||
) );
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_nav_vertical_partials' );
|
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
/**
|
||||
* Newsletter Element
|
||||
*/
|
||||
|
||||
// Add section immediately to keep sort order.
|
||||
Flatsome_Option::add_section( 'header_newsletter',
|
||||
array(
|
||||
'title' => __( 'Newsletter', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
)
|
||||
);
|
||||
|
||||
function flatsome_customizer_header_newsletter_options() {
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_newsletter_layout',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'default' => '<div class="options-title-divider">Layout</div>',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'newsletter_icon_style',
|
||||
'label' => __( 'Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 'plain',
|
||||
'choices' => array(
|
||||
'' => flatsome_customizer_images_uri() . '/disabled.svg',
|
||||
'plain' => flatsome_customizer_images_uri() . '/account-icon-plain.svg',
|
||||
'fill' => flatsome_customizer_images_uri() . '/account-icon-fill.svg',
|
||||
'fill-round' => flatsome_customizer_images_uri() . '/account-icon-fill-round.svg',
|
||||
'outline' => flatsome_customizer_images_uri() . '/account-icon-outline.svg',
|
||||
'outline-round' => flatsome_customizer_images_uri() . '/account-icon-outline-round.svg',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_newsletter_label',
|
||||
'label' => __( 'Label', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 'Newsletter',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_newsletter_block',
|
||||
'label' => __( 'Newsletter Block', 'flatsome-admin' ),
|
||||
'description' => __( 'Replace newsletter pop-up content with a custom Block that can be edited in UX Builder.' ),
|
||||
'section' => 'header_newsletter',
|
||||
'default' => false,
|
||||
'choices' => flatsome_customizer_blocks(),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_newsletter_title',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Title', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 'Sign up for Newsletter',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_newsletter_sub_title',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Sub Title', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => 'Signup for our newsletter to get notified about sales and new products. Add any text here or remove it.',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_newsletter_shortcode',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Form Shortcode', 'flatsome-admin' ),
|
||||
'description' => __( 'Insert any form shortcode here.', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'image',
|
||||
'settings' => 'header_newsletter_bg',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Background Image', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_newsletter_height',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_block',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Height', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'default' => '500px',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_newsletter_behavior',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'default' => '<div class="options-title-divider">Behavior</div>',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_newsletter_auto_open',
|
||||
'label' => __( 'Auto Open', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => false,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_newsletter_auto_timer',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_auto_open',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Auto Timer', 'flatsome-admin' ),
|
||||
'description' => __( 'In milliseconds (1000ms = 1sec).', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 3000,
|
||||
'choices' => array(
|
||||
'min' => 1000,
|
||||
'max' => 300000,
|
||||
'step' => 500,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'settings' => 'header_newsletter_auto_show',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_auto_open',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Auto Show', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 'always',
|
||||
'multiple' => 0,
|
||||
'choices' => array(
|
||||
'always' => __( 'Always', 'flatsome-admin' ),
|
||||
'once' => __( 'Once', 'flatsome-admin' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_newsletter_version',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'header_newsletter_auto_open',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'label' => __( 'Version', 'flatsome-admin' ),
|
||||
'description' => __( 'Increase the version to reopen a "show once" configured newsletter popup to visitors after making changes to it.', 'flatsome-admin' ),
|
||||
'section' => 'header_newsletter',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => '1',
|
||||
) );
|
||||
}
|
||||
add_action( 'init', 'flatsome_customizer_header_newsletter_options' );
|
||||
|
||||
function flatsome_refresh_header_newsletter_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
// Abort if selective refresh is not available.
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-newsletter',
|
||||
array(
|
||||
'selector' => '.header-newsletter-item',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array(
|
||||
'header_newsletter_height',
|
||||
'header_newsletter_bg',
|
||||
'header_newsletter_sub_title',
|
||||
'header_newsletter_label',
|
||||
'header_newsletter_shortcode',
|
||||
'newsletter_icon_style',
|
||||
'header_newsletter_title',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
get_template_part( 'template-parts/header/partials/element', 'newsletter' );
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_newsletter_partials' );
|
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
$preset_url = get_template_directory_uri().'/inc/admin/options/header/img/';
|
||||
|
||||
Flatsome_Option::add_section( 'header-presets', array(
|
||||
'title' => __( 'Presets', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
'priority' => '1',
|
||||
'description' => __( 'You can quick change between header presets here. This works best on a fresh install or resetted options. You can safely try new layouts without loosing changes. Just remember to NOT save if you do not want to use the selected preset.', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'preset',
|
||||
'settings' => 'preset_demo',
|
||||
'label' => __( 'Preset', 'kirki' ),
|
||||
'section' => 'header-presets',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => get_flatsome_header_presets()
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'select_preset',
|
||||
'section' => 'header-presets',
|
||||
'default' => '
|
||||
<div class="preset-click one-col">
|
||||
<h3 class="preset-title">Header Presets</h3>
|
||||
<img data-preset="header-default" title="Header Default" src="'.$preset_url.'header-default.svg"/>
|
||||
<img data-preset="header-default-center" title="Header Default Center" src="'.$preset_url.'header-default-center.svg"/>
|
||||
<img data-preset="header-default-dark" title="Header Default Dark" src="'.$preset_url.'header-default-dark.svg"/>
|
||||
<img data-preset="header-wide-nav-dark" title="Header Wide Nav Dark" src="'.$preset_url.'header-wide-nav-dark.svg"/>
|
||||
<img data-preset="header-wide-nav" title="Header Wide Nav" src="'.$preset_url.'header-wide-nav.svg"/>
|
||||
<img data-preset="header-simple" title="Header Simple" src="'.$preset_url.'header-simple.svg"/>
|
||||
<img data-preset="header-simple-center" title="Header Simple" src="'.$preset_url.'header-simple-center.svg"/>
|
||||
<img data-preset="header-simple-signup" title="Header Simple Signup" src="'.$preset_url.'header-simple-signup.svg"/>
|
||||
<img data-preset="header-simple-right-buttons" title="Header Simple Right Buttons" src="'.$preset_url.'header-simple-right-buttons.svg"/>
|
||||
<img data-preset="header-cart-top" title="Header Cart Top" src="'.$preset_url.'header-cart-top.svg"/>
|
||||
</div>
|
||||
',
|
||||
) );
|
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
function flatsome_refresh_header_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
// Abort if selective refresh is not available.
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_wrapper', array(
|
||||
'selector' => '.header-wrapper',
|
||||
'settings' => array('header_bg_transparent_shade','topbar_show'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/header', 'wrapper');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_top', array(
|
||||
'selector' => '#top-bar',
|
||||
'settings' => array('header_mobile_elements_top','topbar_elements_center', 'topbar_elements_right','topbar_elements_left','nav_style_top'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/header','top');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_bottom', array(
|
||||
'selector' => '#wide-nav',
|
||||
'settings' => array('nav_style_bottom','nav_spacing_bottom','nav_size_bottom','header_mobile_elements_bottom','header_elements_bottom_left', 'header_elements_bottom_center', 'header_elements_bottom_right'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/header','bottom');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_main', array(
|
||||
'selector' => '#masthead',
|
||||
'settings' => array('nav_style','nav_size','nav_spacing','header_divider'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/header','main');
|
||||
},
|
||||
) );
|
||||
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_elements_right', array(
|
||||
'selector' => '.header-nav-main.nav-right',
|
||||
'settings' => array('header_elements_right'),
|
||||
'render_callback' => function() {
|
||||
flatsome_header_elements('header_elements_right');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_elements_left', array(
|
||||
'selector' => '.header-nav-main.nav-left',
|
||||
'settings' => array('header_elements_left'),
|
||||
'render_callback' => function() {
|
||||
flatsome_header_elements('header_elements_left');
|
||||
},
|
||||
) );
|
||||
|
||||
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'logo', array(
|
||||
'selector' => '.logo',
|
||||
'settings' => array('blogdescription','site_logo_sticky','blogname','site_logo','site_logo_dark','site_logo_slogan'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','logo');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'mobile-icon', array(
|
||||
'selector' => 'li.nav-icon',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('menu_icon_title','menu_icon_style','mobile_overlay','mobile_overlay_color'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','menu-icon');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'mobile-sidebar-tab-1', array(
|
||||
'selector' => '.mobile-sidebar .nav[data-tab="1"]',
|
||||
'settings' => array( 'mobile_sidebar' ),
|
||||
'render_callback' => function () {
|
||||
flatsome_header_elements( 'mobile_sidebar', 'sidebar' );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'mobile-sidebar-tab-2', array(
|
||||
'selector' => '.mobile-sidebar .nav[data-tab="2"]',
|
||||
'settings' => array( 'mobile_sidebar_tab_2' ),
|
||||
'render_callback' => function () {
|
||||
flatsome_header_elements( 'mobile_sidebar_tab_2', 'sidebar' );
|
||||
},
|
||||
) );
|
||||
|
||||
// Mobile Elements
|
||||
$wp_customize->selective_refresh->add_partial( 'header_mobile_elements_left', array(
|
||||
'selector' => '.header-main .mobile-nav.nav-left',
|
||||
'settings' => array('header_mobile_elements_left'),
|
||||
'render_callback' => function() {
|
||||
flatsome_header_elements('header_mobile_elements_left','mobile');
|
||||
},
|
||||
) );
|
||||
|
||||
// Mobile Right
|
||||
$wp_customize->selective_refresh->add_partial( 'header_mobile_elements_right', array(
|
||||
'selector' => '.header-main .mobile-nav.nav-right',
|
||||
'settings' => array('header_mobile_elements_right'),
|
||||
'render_callback' => function() {
|
||||
flatsome_header_elements('header_mobile_elements_right','mobile');
|
||||
},
|
||||
) );
|
||||
|
||||
// Refresh custom styling / Colors etc.
|
||||
$wp_customize->selective_refresh->add_partial( 'refresh_css_header', array(
|
||||
'selector' => 'head > style#custom-css',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('color_widget_links','color_widget_links_hover','button_radius','type_headings','color_texts','type_headings_color','header_shop_bg_image','header_shop_bg_color','header_shop_bg_image','header_shop_bg_featured','color_secondary','type_nav_bottom_color','type_nav_bottom_color_hover','type_nav_color_hover','type_nav_color','color_links','color_links_hover','header_top_height','header_bottom_height','header_height','header_height_transparent','color_primary','header_height_sticky','flatsome_lightbox_bg','header_icons_color','header_icons_color_hover','type_nav_top_color','type_nav_top_color_hover'),
|
||||
'render_callback' => function() {
|
||||
flatsome_custom_css();
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_partials' );
|
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Search
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header_search', array(
|
||||
'title' => __( 'Search', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'search_icon_style',
|
||||
'label' => __( 'Search Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_search',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'' => $image_url . 'search-icon-plain.svg',
|
||||
'outline' => $image_url . 'search-icon-outline.svg',
|
||||
'fill' => $image_url . 'search-icon-fill.svg',
|
||||
'fill-round' => $image_url . 'search-icon-fill-round.svg',
|
||||
'outline-round' => $image_url . 'search-icon-outline-round.svg',
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_search_style',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Search Icon Type', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header_search',
|
||||
'default' => 'dropdown',
|
||||
'choices' => array(
|
||||
'dropdown' => __( 'Dropdown', 'flatsome-admin' ),
|
||||
'lightbox' => __( 'Lightbox', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'header_search_form_style',
|
||||
'label' => __( 'Search Form Style', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header_search',
|
||||
'default' => '',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'' => __( 'Normal', 'flatsome-admin' ),
|
||||
'flat' => __('Flat', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'search_placeholder',
|
||||
'transport' => 'postMessage',
|
||||
'label' => __( 'Placeholder text', 'flatsome-admin' ),
|
||||
'section' => 'header_search',
|
||||
'placeholder' => 'Search...',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'transport' => $transport,
|
||||
'settings' => 'header_search_categories',
|
||||
'label' => __( 'Search Categories', 'flatsome-admin' ),
|
||||
'help' => __( 'Search categories', 'flatsome-admin' ),
|
||||
'section' => 'header_search',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_search_width',
|
||||
'label' => __( 'Header Search form width', 'flatsome-admin' ),
|
||||
'section' => 'header_search',
|
||||
'default' => '60',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'min' => 10,
|
||||
'max' => 100,
|
||||
'step' => 1
|
||||
)
|
||||
));
|
||||
|
||||
function flatsome_refresh_header_search_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_search', array(
|
||||
'selector' => '.header-search',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('search_icon_style','header_search_style'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','search');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header_search_form', array(
|
||||
'selector' => '.search-form',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('header_search_categories'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','search-form');
|
||||
},
|
||||
) );
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_header_search_partials' );
|
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* Header Sticky
|
||||
*
|
||||
* @package Flatsome/Admin/Options/Header
|
||||
*/
|
||||
|
||||
Flatsome_Option::add_section( 'header_sticky', array(
|
||||
'title' => __( 'Sticky Header', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_height_sticky',
|
||||
'label' => __( 'Header Height on Sticky', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'transport' => $transport,
|
||||
'default' => 70,
|
||||
'choices' => array(
|
||||
'min' => 30,
|
||||
'max' => 300,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'sticky_logo_padding',
|
||||
'label' => __( 'Sticky Logo Padding', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'nav_height_sticky',
|
||||
'label' => __( 'Nav Height on Sticky', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'topbar_sticky',
|
||||
'label' => __( 'Top Bar - Sticky on Scroll', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_sticky',
|
||||
'label' => __( 'Header Main - Sticky on Scroll', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'bottombar_sticky',
|
||||
'label' => __( 'Header Bottom - Sticky on Scroll', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'sticky_style',
|
||||
'label' => __( 'Sticky Style', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => 'jump',
|
||||
'choices' => array(
|
||||
'jump' => __( 'Jump Down', 'flatsome-admin' ),
|
||||
'fade' => __( 'Fade', 'flatsome-admin' ),
|
||||
'shrink' => __( 'Shrink', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'sticky_hide_on_scroll',
|
||||
'label' => __( 'Hide sticky when scrolling down', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'site_logo_sticky',
|
||||
'label' => __( 'Custom Sticky Logo', 'flatsome-admin' ),
|
||||
'section' => 'header_sticky',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => array( 'save_as' => 'id' ),
|
||||
) );
|
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Header Top
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'top_bar', array(
|
||||
'title' => __( 'Top Bar', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
//'description' => __( 'This is the section description', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'topbar_show',
|
||||
//'transport' => $transport,
|
||||
'label' => __( 'Enable Top Bar', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_top_layout',
|
||||
'section' => 'top_bar',
|
||||
'default' => '<div class="options-title-divider">Layout</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'header_top_height',
|
||||
'label' => __( 'Height', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'default' => 30,
|
||||
'choices' => array(
|
||||
'min' => 20,
|
||||
'max' => 100,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => 'postMessage'
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'topbar_color',
|
||||
'label' => __( 'Text Color', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'default' => 'dark',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'dark' => $image_url . 'text-light.svg',
|
||||
'light' => $image_url . 'text-dark.svg'
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'topbar_bg',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'default' => '',
|
||||
'transport' => 'postMessage',
|
||||
'js_vars' => array(
|
||||
array(
|
||||
'element' => '.header-top',
|
||||
'function' => 'css',
|
||||
'property' => 'background-color'
|
||||
),
|
||||
)
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_header_top_nav',
|
||||
'section' => 'top_bar',
|
||||
'default' => '<div class="options-title-divider">Navigation</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'nav_style_top',
|
||||
'label' => __( 'Navigation Style', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'default' => 'divided',
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_styles_img
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'nav_top_uppercase',
|
||||
'label' => __( 'Uppercase', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'transport' => $transport,
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'nav_top_body_overlay',
|
||||
'label' => __( 'Add overlay on hover', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'nav_height_top',
|
||||
'label' => __( 'Nav Height', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'transport' => $transport,
|
||||
'default' => 16,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_nav_top_color',
|
||||
'label' => __( 'Nav Color', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_nav_top_color_hover',
|
||||
'label' => __( 'Nav Color :hover', 'flatsome-admin' ),
|
||||
'section' => 'top_bar',
|
||||
'transport' => $transport,
|
||||
) );
|
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* - Wishlist Options
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'header_wishlist', array(
|
||||
'title' => __( 'Wishlist', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
'priority' => 110,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'wishlist_icon',
|
||||
'label' => __( 'Wishlist Icon', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
'section' => 'header_wishlist',
|
||||
'default' => 'heart',
|
||||
'choices' => array(
|
||||
'' => "None",
|
||||
"heart" => "Heart (Default)",
|
||||
"heart-o" => "Heart Outline",
|
||||
"star" => "Star",
|
||||
"star-o" => "Star Outline",
|
||||
"menu" => "List",
|
||||
"pen-alt-fill" => "Pen",
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'wishlist_icon_style',
|
||||
'label' => __( 'Wishlist Icon Style', 'flatsome-admin' ),
|
||||
'section' => 'header_wishlist',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'icon-plain.svg',
|
||||
'outline' => $image_url . 'icon-outline.svg',
|
||||
'fill' => $image_url . 'icon-fill.svg',
|
||||
'fill-round' => $image_url . 'icon-fill-round.svg',
|
||||
'outline-round' => $image_url . 'icon-outline-round.svg',
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'wishlist_title',
|
||||
'label' => __( 'Show Wishlist Title', 'flatsome-admin' ),
|
||||
//'description' => __( 'This is the control description', 'flatsome-admin' ),
|
||||
//'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'flatsome-admin' ),
|
||||
'section' => 'header_wishlist',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'header_wishlist_label',
|
||||
'label' => __( 'Custom Title', 'flatsome-admin' ),
|
||||
'section' => 'header_wishlist',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
|
||||
function flatsome_refresh_wishlist_partials( WP_Customize_Manager $wp_customize ) {
|
||||
|
||||
// Abort if selective refresh is not available.
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'header-wishlist', array(
|
||||
'selector' => '.header-wishlist-icon',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('wishlist_title','wishlist_icon','wishlist_title','wishlist_icon_style','header_wishlist_label'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/header/partials/element','wishlist');
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_wishlist_partials' );
|
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*************
|
||||
* Header Panel
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_panel( 'header', array(
|
||||
'title' => __( 'Header', 'flatsome-admin' ),
|
||||
'description' => __( 'Change Theme Header Options here.', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
|
||||
include_once(dirname( __FILE__ ).'/options-header-presets.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-layout.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-logo.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-top.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-main.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-bottom.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-mobile.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-sticky.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-dropdown.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-buttons.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-refresh.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-account.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-cart.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-search.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-content.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-contact.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-newsletter.php');
|
||||
include_once(dirname( __FILE__ ).'/options-header-nav-vertical.php');
|
||||
|
||||
if(class_exists( 'YITH_WCWL' )){
|
||||
include_once(dirname( __FILE__ ).'/options-header-wishlist.php');
|
||||
}
|