init
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'blog-archive', array(
|
||||
'title' => __( 'Blog Archive', 'flatsome-admin' ),
|
||||
'panel' => 'blog',
|
||||
'description' => __( 'Set custom layouts for archive pages like Categories, Search etc.', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_archive_title',
|
||||
'label' => __( 'Enable Blog Archive Title', 'flatsome-admin' ),
|
||||
'section' => 'blog-archive',
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_style_archive',
|
||||
'label' => __( 'Posts Layout', 'flatsome-admin' ),
|
||||
'section' => 'blog-archive',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'blog-default.svg',
|
||||
'normal' => $image_url . 'blog-normal.svg',
|
||||
'inline' => $image_url . 'blog-inline.svg',
|
||||
'2-col' => $image_url . 'blog-two-col.svg',
|
||||
'3-col' =>$image_url . 'blog-three-col.svg',
|
||||
'list' => $image_url . 'blog-list.svg',
|
||||
),
|
||||
));
|
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'blog-featured', array(
|
||||
'title' => __( 'Blog Featured Posts', 'flatsome-admin' ),
|
||||
'panel' => 'blog',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_featured',
|
||||
'label' => __( 'Featured Posts', 'flatsome-admin' ),
|
||||
'description' => __( 'Show Featured posts in a slider above content. You need to make a post "Sticky" to show it here.', 'flatsome-admin' ),
|
||||
'section' => 'blog-featured',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'disabled.svg',
|
||||
'content' => $image_url . 'featured-posts.svg',
|
||||
'top' =>$image_url . 'featured-posts-top.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_hide_sticky',
|
||||
'label' => __( 'Hide Featured Posts from Default Blog feed.', 'flatsome-admin' ),
|
||||
'section' => 'blog-featured',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'blog_featured_height',
|
||||
'label' => __( 'Featured Posts Height', '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' => 'blog-featured',
|
||||
'default' => 500,
|
||||
'choices' => array(
|
||||
'min' => 200,
|
||||
'max' => 1000,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => $transport,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'blog_featured_image_size',
|
||||
'label' => esc_attr__( 'Image Size', 'flatsome-admin' ),
|
||||
'section' => 'blog-featured',
|
||||
'default' => 'medium',
|
||||
'choices' => array(
|
||||
'thumbnail' => 'Thumbnail',
|
||||
'medium' => 'Medium',
|
||||
'large' => 'Large',
|
||||
'original' => 'Original',
|
||||
),
|
||||
) );
|
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'blog-global', array(
|
||||
'title' => __( 'Blog Global', 'flatsome-admin' ),
|
||||
'panel' => 'blog',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_badge',
|
||||
'label' => __( 'Show Date Box', 'flatsome-admin' ),
|
||||
'section' => 'blog-global',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_badge_style',
|
||||
'label' => __( 'Date Box Style', 'flatsome-admin' ),
|
||||
'section' => 'blog-global',
|
||||
'default' => 'outline',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'blog_badge',
|
||||
'operator' => '==',
|
||||
'value' => '1',
|
||||
),
|
||||
),
|
||||
'choices' => array(
|
||||
'square' => $image_url . 'badge-square.svg',
|
||||
'circle' => $image_url . 'badge-circle.svg',
|
||||
'circle-inside' => $image_url . 'badge-circle-inside.svg',
|
||||
'outline' => $image_url . 'badge-outline.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'blog_excerpt_suffix',
|
||||
'label' => __( 'Blog Excerpt Suffix', 'flatsome-admin' ),
|
||||
'description' => __( 'Choose custom post excerpt suffix. Default [...]', 'flatsome-admin' ),
|
||||
'section' => 'blog-global',
|
||||
'default' => ' [...]',
|
||||
) );
|
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'blog-layout', array(
|
||||
'title' => __( 'Blog Layout', 'flatsome-admin' ),
|
||||
'panel' => 'blog',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'blog_header',
|
||||
//'transport' => $transport,
|
||||
'label' => __( 'Blog Homepage Header', 'flatsome-admin' ),
|
||||
'description' => __( 'Enter HTML for blog header here. Will be placed above content and sidebar. Shortcodes are allowed. F.ex [block id="blog-header"]', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_archive_transparent',
|
||||
'label' => __( 'Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_layout',
|
||||
'label' => __( 'Blog Sidebar', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 'right-sidebar',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'right-sidebar' => $image_url . 'layout-right.svg',
|
||||
'left-sidebar' => $image_url . 'layout-left.svg',
|
||||
'no-sidebar' => $image_url . 'layout-no-sidebar.svg',
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_layout_divider',
|
||||
'label' => __( 'Enable Sidebar Divider', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'transport' => $transport,
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_sticky_sidebar',
|
||||
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_style',
|
||||
'label' => __( 'Posts Layout', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 'normal',
|
||||
'choices' => array(
|
||||
'normal' => $image_url . 'blog-normal.svg',
|
||||
'inline' => $image_url . 'blog-inline.svg',
|
||||
'2-col' => $image_url . 'blog-two-col.svg',
|
||||
'3-col' =>$image_url . 'blog-three-col.svg',
|
||||
'list' => $image_url . 'blog-list.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'blog_style_type',
|
||||
'label' => __( 'Posts Layout Type', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 'masonry',
|
||||
'choices' => array(
|
||||
'row' => __( 'Row', 'flatsome-admin' ),
|
||||
'masonry' => __( 'Masonry', 'flatsome-admin' ),
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'blog_style',
|
||||
'operator' => 'contains',
|
||||
'value' => array( '2-col', '3-col' ),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_show_excerpt',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show Excerpts Only', 'flatsome-admin' ),
|
||||
'help' => __( 'Show Excerpts only of the Blog posts. You can manually add a Read More link by adding a More Tag to the Post Content.', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'blog_bg_color',
|
||||
'label' => __( 'Blog Background Color', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => '',
|
||||
'transport' => 'postMessage',
|
||||
'js_vars' => array(
|
||||
array(
|
||||
'element' => '.blog-wrapper',
|
||||
'function' => 'css',
|
||||
'property' => 'background-color'
|
||||
),
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'blog_posts_depth',
|
||||
'label' => __( 'Depth', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'blog_posts_depth_hover',
|
||||
'label' => __( 'Depth :hover', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1
|
||||
),
|
||||
'transport' => $transport
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_post_layout',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => '<div class="options-title-divider">Post layout</div>',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_posts_header_style',
|
||||
'label' => __( 'Posts Title Style', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'blog_style',
|
||||
'operator' => '===',
|
||||
'value' => 'normal',
|
||||
),
|
||||
),
|
||||
'default' => 'normal',
|
||||
'choices' => array(
|
||||
'normal' => $image_url . 'text-top.svg',
|
||||
'bottom' => $image_url . 'text-bottom.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_posts_title_align',
|
||||
'label' => __( 'Posts Title Align', 'flatsome-admin' ),
|
||||
'section' => 'blog-layout',
|
||||
'default' => 'center',
|
||||
'choices' => array(
|
||||
'left' => $image_url . 'align-left.svg',
|
||||
'center' => $image_url . 'align-center.svg',
|
||||
'right' => $image_url . 'align-right.svg',
|
||||
),
|
||||
));
|
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'blog-single', array(
|
||||
'title' => __( 'Blog Single Post', 'flatsome-admin' ),
|
||||
'panel' => 'blog',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_post_layout',
|
||||
'label' => __( 'Blog Post Single Layout', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 'right-sidebar',
|
||||
'choices' => array(
|
||||
'right-sidebar' => $image_url . 'layout-right.svg',
|
||||
'left-sidebar' => $image_url . 'layout-left.svg',
|
||||
'no-sidebar' => $image_url . 'layout-no-sidebar.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'blog_post_style',
|
||||
'label' => __( 'Title Layout', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 'default',
|
||||
'choices' => array(
|
||||
'default' => $image_url . 'blog-single.svg',
|
||||
'top' => $image_url . 'blog-single-full.svg',
|
||||
'inline' => $image_url . 'blog-single-inline.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_single_transparent',
|
||||
'label' => __( 'Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_single_header_meta',
|
||||
'label' => __( 'Enable Header Meta', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_single_featured_image',
|
||||
'label' => __( 'Enable Featured Image', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_share',
|
||||
'label' => __( 'Enable Share Icons', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_single_footer_meta',
|
||||
'label' => __( 'Enable Footer Meta', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_author_box',
|
||||
'label' => __( 'Enable Blog Author Box', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'blog_single_next_prev_nav',
|
||||
'label' => __( 'Enable Next/Prev Navigation', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'blog_after_post',
|
||||
'label' => __( 'HTML after blog posts', 'flatsome-admin' ),
|
||||
'section' => 'blog-single',
|
||||
'description' => 'Enter HTML or shortcodes that will be visible after blog posts. (Before comment box). Shortcodes are allowed',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_panel( 'blog', array(
|
||||
'title' => __( 'Blog', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
include_once( dirname( __FILE__ ) . '/options-blog-global.php' );
|
||||
include_once(dirname( __FILE__ ).'/options-blog-layout.php');
|
||||
include_once(dirname( __FILE__ ).'/options-blog-archive.php');
|
||||
include_once(dirname( __FILE__ ).'/options-blog-single.php');
|
||||
include_once(dirname( __FILE__ ).'/options-blog-featured.php');
|
||||
|
||||
|
||||
function flatsome_refresh_blog_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( 'blog-layout', array(
|
||||
'selector' => '.blog-wrapper.blog-archive',
|
||||
'settings' => array('blog_posts_depth_hover','blog_posts_depth','blog_layout','blog_layout_divider','blog_show_excerpt'),
|
||||
'render_callback' => function() {
|
||||
get_template_part( 'template-parts/posts/layout', get_theme_mod('blog_layout','right-sidebar') );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'blog-layout-single', array(
|
||||
'selector' => '.blog-wrapper.blog-single',
|
||||
'settings' => array('blog_posts_depth_hover','blog_posts_depth','blog_post_layout','blog_post_style','blog_single_header_meta','blog_single_footer_meta','blog_single_featured_image','blog_share','blog_author_box','blog_single_next_prev_nav'),
|
||||
'render_callback' => function() {
|
||||
get_template_part( 'template-parts/posts/layout', get_theme_mod('blog_post_layout','right-sidebar') );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'blog-featured-posts', array(
|
||||
'selector' => '.featured-posts',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('blog_featured_height'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/posts/featured-posts');
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_blog_partials' );
|
@@ -0,0 +1,405 @@
|
||||
<?php
|
||||
/**
|
||||
* Footer panel.
|
||||
*/
|
||||
|
||||
// Add section immediately to keep sort order.
|
||||
Flatsome_Option::add_section( 'footer', array(
|
||||
'title' => __( 'Footer', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
function flatsome_customizer_footer_options() {
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_custom_footer',
|
||||
'label' => '',
|
||||
'section' => 'footer',
|
||||
'default' => '<div class="options-title-divider" style="margin-bottom:15px">Custom Footer</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'footer_block',
|
||||
'label' => __( 'Custom Footer Block', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'description' => __( 'You can replace the Footer with a Custom Block that you can edit in the Page Builder.', 'flatsome-admin' ),
|
||||
'default' => false,
|
||||
'choices' => flatsome_customizer_blocks(),
|
||||
) );
|
||||
|
||||
$hide_on_custom_footer_block = array(
|
||||
array( 'setting' => 'footer_block', 'operator' => '==', 'value' => false ),
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_html_footer_widgets',
|
||||
'label' => '',
|
||||
'section' => 'footer',
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'default' => '<div class="options-title-divider" style="margin-bottom:15px">Widgets</div><p>Click the button to go to Footer Widgets</p><div><button style="margin-bottom:15px" class="button button-primary" data-to-panel="widgets">Edit Footer Widgets</button></div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_footer_1',
|
||||
'label' => '',
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'section' => 'footer',
|
||||
'default' => '<div class="options-title-divider">Footer 1</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'footer_1',
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'label' => __( 'Enable Footer 1', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'footer_1_columns',
|
||||
'label' => __( 'Columns', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'default' => '4',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'6' => __( '6', 'flatsome-admin' ),
|
||||
'4' => __( '4', 'flatsome-admin' ),
|
||||
'3' => __( '3', 'flatsome-admin' ),
|
||||
'2' => __( '2', 'flatsome-admin' ),
|
||||
'1' => __( '1', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'footer_1_color',
|
||||
'label' => __( 'Text color', 'flatsome-admin' ),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'section' => 'footer',
|
||||
'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' => 'footer_1_bg_color',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '#fff',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'footer_1_bg_image',
|
||||
'label' => __( 'Background Image', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_footer_2',
|
||||
'label' => '',
|
||||
'section' => 'footer',
|
||||
'default' => '<div class="options-title-divider">Footer 2</div>',
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'footer_2',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'label' => __( 'Enable Footer 2', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'footer_2_columns',
|
||||
'label' => __( 'Columns', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '4',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'6' => __( '6', 'flatsome-admin' ),
|
||||
'4' => __( '4', 'flatsome-admin' ),
|
||||
'3' => __( '3', 'flatsome-admin' ),
|
||||
'2' => __( '2', 'flatsome-admin' ),
|
||||
'1' => __( '1', 'flatsome-admin' ),
|
||||
),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'footer_2_color',
|
||||
'label' => __( 'Text color', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => 'dark',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'dark' => flatsome_customizer_images_uri() . '/text-light.svg',
|
||||
'light' => flatsome_customizer_images_uri() . '/text-dark.svg',
|
||||
),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'footer_2_bg_color',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '#777',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'footer_2_bg_image',
|
||||
'label' => __( 'Background Image', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_footer_absolute',
|
||||
'label' => '',
|
||||
'section' => 'footer',
|
||||
'default' => '<div class="options-title-divider">Absolute Footer</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'footer_bottom_text',
|
||||
'label' => __( 'Text color', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'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' => 'radio-buttonset',
|
||||
'settings' => 'footer_bottom_align',
|
||||
'label' => __( 'Align', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'choices' => array(
|
||||
'' => __( 'Left/Right', 'flatsome-admin' ),
|
||||
'center' => __( 'Center', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'footer_bottom_color',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => '',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'footer_left_text',
|
||||
'label' => __( 'Bottom Text - Primary', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => 'Copyright [ux_current_year] © <strong>Flatsome Theme</strong>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'footer_right_text',
|
||||
'label' => __( 'Bottom Text - Secondary', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
$hide_off_back_to_top = array(
|
||||
array( 'setting' => 'back_to_top', 'operator' => '==', 'value' => true ),
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'back_to_top_button_title',
|
||||
'label' => '',
|
||||
'section' => 'footer',
|
||||
'default' => '<div class="options-title-divider">Back To Top Button</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'back_to_top',
|
||||
'label' => __( 'Enable Back To Top Button', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'back_to_top_shape',
|
||||
'label' => __( 'Button Shape', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 'circle',
|
||||
'choices' => array(
|
||||
'circle' => flatsome_customizer_images_uri() . '/back-to-top-outline-circle.svg',
|
||||
'square' => flatsome_customizer_images_uri() . '/back-to-top-outline-square.svg',
|
||||
),
|
||||
'active_callback' => $hide_off_back_to_top,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'back_to_top_position',
|
||||
'label' => __( 'Position', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 'right',
|
||||
'choices' => array(
|
||||
'left' => __( 'Left', 'flatsome-admin' ),
|
||||
'right' => __( 'Right', 'flatsome-admin' ),
|
||||
),
|
||||
'active_callback' => $hide_off_back_to_top,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'back_to_top_mobile',
|
||||
'label' => __( 'Show on Mobile', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'default' => 0,
|
||||
'active_callback' => $hide_off_back_to_top,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_footer_html',
|
||||
'label' => '',
|
||||
'section' => 'footer',
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'default' => '<div class="options-title-divider">Footer HTML</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_before_footer',
|
||||
'label' => __( 'HTML before footer', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_after_footer',
|
||||
'label' => __( 'HTML after footer', 'flatsome-admin' ),
|
||||
'description' => __( 'Add Any HTML or Shortcode here...', 'flatsome-admin' ),
|
||||
'section' => 'footer',
|
||||
'transport' => flatsome_customizer_transport(),
|
||||
'active_callback' => $hide_on_custom_footer_block,
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
}
|
||||
add_action( 'init', 'flatsome_customizer_footer_options' );
|
||||
|
||||
function flatsome_refresh_footer_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( 'footer-layout', array(
|
||||
'selector' => '.footer-wrapper',
|
||||
'settings' => array(
|
||||
'footer_2',
|
||||
'footer_1',
|
||||
'html_before_footer',
|
||||
'html_after_footer',
|
||||
'footer_2_color',
|
||||
'footer_1_color',
|
||||
'footer_2_columns',
|
||||
'footer_1_columns',
|
||||
),
|
||||
'render_callback' => function () {
|
||||
get_template_part( 'template-parts/footer/footer' );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'footer-left-text', array(
|
||||
'selector' => '.copyright-footer',
|
||||
'settings' => array( 'footer_left_text' ),
|
||||
'render_callback' => function () {
|
||||
return do_shortcode( flatsome_option( 'footer_left_text' ) );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'footer-right-text', array(
|
||||
'selector' => '.footer-secondary .footer-text',
|
||||
'settings' => array( 'footer_right_text' ),
|
||||
'render_callback' => function () {
|
||||
return do_shortcode( flatsome_option( 'footer_right_text' ) );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'footer-absolute', array(
|
||||
'selector' => '.absolute-footer',
|
||||
'settings' => array( 'footer_bottom_align', 'footer_bottom_text' ),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function () {
|
||||
get_template_part( 'template-parts/footer/footer-absolute' );
|
||||
},
|
||||
) );
|
||||
|
||||
// Refresh custom styling / Colors etc.
|
||||
$wp_customize->selective_refresh->add_partial( 'refresh_css_footer', array(
|
||||
'selector' => 'head > style#custom-css',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array( 'footer_1_bg_image', 'footer_2_bg_image' ),
|
||||
'render_callback' => function () {
|
||||
flatsome_custom_css();
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'flatsome_refresh_footer_partials' );
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'advanced', array(
|
||||
'title' => __( 'Reset Options', 'flatsome-admin' ),
|
||||
'priority' => 999,
|
||||
'description' => __( 'Click the reset button to reset all options to default values.', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_advanced_reset',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'advanced',
|
||||
'default' => '<div class="reset-options-container"><button name="Reset" id="flatsome-customizer-reset" class="button-primary button" title="Reset Theme Options">Reset Theme Options</button></div>',
|
||||
) );
|
@@ -0,0 +1 @@
|
||||
<?php
|
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');
|
||||
}
|
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
//Access the WordPress Pages via an Array
|
||||
$list_pages = array();
|
||||
$list_pages_by_id = array();
|
||||
$of_pages_obj = get_pages('sort_column=post_parent,menu_order');
|
||||
$list_pages['0'] = 'Select a page:';
|
||||
$list_pages_by_id['0'] = 'Select a page:';
|
||||
foreach ($of_pages_obj as $of_page) {
|
||||
$list_pages[$of_page->post_name] = $of_page->post_title;
|
||||
$list_pages_by_id[$of_page->ID] = $of_page->post_title;
|
||||
}
|
||||
|
||||
function flatsome_customizer_blocks() {
|
||||
$blocks = array( false => '-- None --' );
|
||||
$items = flatsome_get_post_type_items( 'blocks' );
|
||||
|
||||
if ( ! empty( $items ) ) {
|
||||
foreach ( $items as $item ) {
|
||||
$blocks[ $item->post_name ] = $item->post_title;
|
||||
}
|
||||
}
|
||||
|
||||
return $blocks;
|
||||
}
|
||||
|
||||
// Set default transport
|
||||
$transport = 'postMessage';
|
||||
if ( ! isset( $wp_customize->selective_refresh ) ) {
|
||||
$transport = 'refresh';
|
||||
}
|
||||
|
||||
function flatsome_customizer_transport() {
|
||||
global $wp_customize;
|
||||
return ! isset( $wp_customize->selective_refresh )
|
||||
? 'refresh'
|
||||
: 'postMessage';
|
||||
}
|
||||
|
||||
$image_url = get_template_directory_uri().'/inc/admin/customizer/img/';
|
||||
|
||||
function flatsome_customizer_images_uri() {
|
||||
return get_template_directory_uri() . '/inc/admin/customizer/img';
|
||||
}
|
||||
|
||||
|
||||
function flatsome_customizer_nav_elements() {
|
||||
return apply_filters( 'flatsome_header_element', array(
|
||||
'cart' => __( 'Cart', 'flatsome-admin' ),
|
||||
'account' => __( 'Account', 'flatsome-admin' ),
|
||||
'menu-icon' => __( '☰ Nav Icon', 'flatsome-admin' ),
|
||||
'nav' => __( 'Main Menu', 'flatsome-admin' ),
|
||||
'nav-top' => __( 'Top Bar Menu', 'flatsome-admin' ),
|
||||
'nav-vertical' => __( '☰ Vertical Menu', 'flatsome-admin' ),
|
||||
'search' => __( 'Search Icon', 'flatsome-admin' ),
|
||||
'search-form' => __( 'Search Form', 'flatsome-admin' ),
|
||||
'social' => __( 'Social Icons', 'flatsome-admin' ),
|
||||
'contact' => __( 'Contact', 'flatsome-admin' ),
|
||||
'button-1' => __( 'Button 1', 'flatsome-admin' ),
|
||||
'button-2' => __( 'Button 2', 'flatsome-admin' ),
|
||||
'checkout' => __( 'Checkout Button', 'flatsome-admin' ),
|
||||
'newsletter' => __( 'Newsletter', 'flatsome-admin' ),
|
||||
'languages' => __( 'Languages', 'flatsome-admin' ),
|
||||
'divider' => __( '|', 'flatsome-admin' ),
|
||||
'divider_2' => __( '|', 'flatsome-admin' ),
|
||||
'divider_4' => __( '|', 'flatsome-admin' ),
|
||||
'divider_3' => __( '|', 'flatsome-admin' ),
|
||||
'divider_5' => __( '|', 'flatsome-admin' ),
|
||||
'block-1' => __( 'Block 1', 'flatsome-admin' ),
|
||||
'block-2' => __( 'Block 2', 'flatsome-admin' ),
|
||||
'html' => __( 'HTML 1', 'flatsome-admin' ),
|
||||
'html-2' => __( 'HTML 2', 'flatsome-admin' ),
|
||||
'html-3' => __( 'HTML 3', 'flatsome-admin' ),
|
||||
'html-4' => __( 'HTML 4', 'flatsome-admin' ),
|
||||
'html-5' => __( 'HTML 5', 'flatsome-admin' ),
|
||||
) );
|
||||
}
|
||||
|
||||
// Add Hooked Header Elements
|
||||
$nav_elements = flatsome_customizer_nav_elements();
|
||||
|
||||
$visibility= array(
|
||||
'' => __( 'Show for All', 'flatsome-admin' ),
|
||||
'hide-for-small' => __( 'Hide For Mobile', 'flatsome-admin' ),
|
||||
'hide-for-medium' => __( 'Hide For Tablet', 'flatsome-admin' ),
|
||||
'show-for-small' => __( 'Show For Mobile', 'flatsome-admin' ),
|
||||
'show-for-medium' => __( 'Show For Tablet', 'flatsome-admin' ),
|
||||
'show-for-large' => __( 'Show For Desktop', 'flatsome-admin' ),
|
||||
);
|
||||
|
||||
$nav_styles_img = array(
|
||||
'' => $image_url . 'nav-default.svg',
|
||||
'divided' => $image_url . 'nav-divided.svg',
|
||||
'line' => $image_url . 'nav-line.svg',
|
||||
'line-grow' => $image_url . 'nav-line-grow.svg',
|
||||
'line-bottom' => $image_url . 'nav-line-bottom.svg',
|
||||
'box' => $image_url . 'nav-box.svg',
|
||||
'outline' => $image_url . 'nav-outline.svg',
|
||||
'pills' => $image_url . 'nav-pills.svg',
|
||||
'tabs' => $image_url . 'nav-tabs.svg'
|
||||
);
|
||||
|
||||
$smart_links = __( '', 'flatsome-admin' );
|
||||
|
||||
$sizes = array(
|
||||
'xxlarge' => __( 'XX Large', 'flatsome-admin' ),
|
||||
'xlarge' => __( 'X Large', 'flatsome-admin' ),
|
||||
'larger' => __( 'Larger', 'flatsome-admin' ),
|
||||
'large' => __( 'Large', 'flatsome-admin' ),
|
||||
'medium' => __( 'Medium', 'flatsome-admin' ),
|
||||
'small' => __( 'Small', 'flatsome-admin' ),
|
||||
'smaller' => __( 'Smaller', 'flatsome-admin' ),
|
||||
'xsmall' => __( 'X Small', 'flatsome-admin' ),
|
||||
);
|
||||
|
||||
$button_styles = array(
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'outline' => __( 'Outline', 'flatsome-admin' ),
|
||||
'underline' => __( 'Underline', 'flatsome-admin' ),
|
||||
'shade' => __( 'Shade', 'flatsome-admin' ),
|
||||
'bevel' => __( 'Bevel', 'flatsome-admin' ),
|
||||
'gloss' => __( 'Gloss', 'flatsome-admin' ),
|
||||
'link' => __( 'Link', 'flatsome-admin' ),
|
||||
);
|
||||
|
||||
$nav_sizes = array(
|
||||
'xsmall' => __( 'XS', 'flatsome-admin' ),
|
||||
'small' => __( 'S', 'flatsome-admin' ),
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'medium' => __( 'M', 'flatsome-admin' ),
|
||||
'large' => __( 'L', 'flatsome-admin' ),
|
||||
'xlarge' => __( 'XL', 'flatsome-admin' ),
|
||||
);
|
||||
|
||||
$nav_spacing = array(
|
||||
'xsmall' => __( 'XS', 'flatsome-admin' ),
|
||||
'small' => __( 'S', 'flatsome-admin' ),
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'medium' => __( 'M', 'flatsome-admin' ),
|
||||
'large' => __( 'L', 'flatsome-admin' ),
|
||||
'xlarge' => __( 'XL', 'flatsome-admin' ),
|
||||
);
|
||||
|
||||
|
||||
$bg_repeat = array(
|
||||
"repeat" => "Tiled",
|
||||
"repeat-x" => "Repeat X",
|
||||
"repeat-y" => "Repeat Y",
|
||||
"no-repeat" => "No Repeat"
|
||||
);
|
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Layout Panel
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_section( 'layout', array(
|
||||
'title' => __( 'Layout', 'flatsome-admin' ),
|
||||
//'description' => __( 'Change the Layout', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'body_layout',
|
||||
'label' => __( 'Layout Mode', 'flatsome-admin' ),
|
||||
'description' => __( 'Select Full width, boxed or framed layout', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'default' => 'full-width',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'full-width' => __( 'Full Width', 'flatsome-admin' ),
|
||||
'boxed' => __( 'Boxed', 'flatsome-admin' ),
|
||||
'framed' => __( 'Framed', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'box_shadow',
|
||||
'label' => __( 'Add Drop Shadow to Content box', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'transport' => 'postMessage',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'body_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'number',
|
||||
'settings' => 'site_width_boxed',
|
||||
'label' => __( 'Site width (px)', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'transport' => 'postMessage',
|
||||
'default' => '1170',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'body_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
),
|
||||
'choices' => [
|
||||
'min' => 560,
|
||||
'max' => 4000,
|
||||
'step' => 10,
|
||||
],
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'body_bg',
|
||||
'label' => __( 'Background Color', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'default' => "",
|
||||
'transport' => 'postMessage',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'body_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'body_bg_image',
|
||||
'label' => __( 'Background Image', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'default' => "",
|
||||
'transport' => 'postMessage',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'body_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'body_bg_type',
|
||||
'label' => __( 'Background Repeat', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'default' => 'bg-full-size',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'bg-full-size' => __( 'Full Size', 'flatsome-admin' ),
|
||||
'bg-tiled' => __( 'Tiled', 'flatsome-admin' ),
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'body_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
array(
|
||||
'setting' => 'body_bg_image',
|
||||
'operator' => '!==',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'number',
|
||||
'settings' => 'site_width',
|
||||
'label' => __( 'Container width (px)', 'flatsome-admin' ),
|
||||
'description' => __( 'Set the default width of content containers. (Header, Rows etc.)', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'transport' => 'postMessage',
|
||||
'default' => '1080',
|
||||
'choices' => [
|
||||
'min' => 560,
|
||||
'max' => 4000,
|
||||
'step' => 10,
|
||||
],
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'content_color',
|
||||
'label' => __( 'Content Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Light or Dark content text color', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'default' => 'light',
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'light' => $image_url . 'text-dark.svg',
|
||||
'dark' => $image_url . 'text-light.svg'
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'content_bg',
|
||||
'label' => __( 'Content Background', 'flatsome-admin' ),
|
||||
'section' => 'layout',
|
||||
'default' => "",
|
||||
'transport' => 'postMessage',
|
||||
));
|
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'notifications', array(
|
||||
'title' => __( 'Notifications', 'flatsome-admin' ),
|
||||
'priority' => 160,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cookie_notice',
|
||||
'section' => 'notifications',
|
||||
'label' => esc_html__( 'Enable cookie notice', 'flatsome-admin' ),
|
||||
'default' => false,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'cookie_notice_text',
|
||||
'section' => 'notifications',
|
||||
'transport' => $transport,
|
||||
'label' => esc_html__( 'Custom cookie text', 'flatsome-admin' ),
|
||||
'description' => esc_html__( 'Add any HTML or shortcode here...', 'flatsome-admin' ),
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'privacy_policy_page',
|
||||
'section' => 'notifications',
|
||||
'label' => esc_html__( 'Privacy policy page', 'flatsome-admin' ),
|
||||
'description' => esc_html__( 'Show a button linked to the cookie policy page.', 'flatsome-admin' ),
|
||||
'default' => false,
|
||||
'choices' => $list_pages_by_id,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'cookie_notice_button_style',
|
||||
'section' => 'notifications',
|
||||
'transport' => $transport,
|
||||
'label' => esc_html__( 'Button style', 'flatsome-admin' ),
|
||||
'choices' => $button_styles,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'cookie_notice_text_color',
|
||||
'section' => 'notifications',
|
||||
'transport' => $transport,
|
||||
'label' => esc_html__( 'Text color', 'flatsome-admin' ),
|
||||
'default' => 'light',
|
||||
'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' => 'cookie_notice_bg_color',
|
||||
'section' => 'notifications',
|
||||
'label' => esc_html__( 'Background color', 'flatsome-admin' ),
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'cookie_notice_version',
|
||||
'section' => 'notifications',
|
||||
'label' => esc_html__( 'Version', 'flatsome-admin' ),
|
||||
'description' => esc_html__( 'Increase the version to reopen the notice to visitors that have accepted before, after making changes to it.', 'flatsome-admin' ),
|
||||
'default' => '1',
|
||||
) );
|
||||
|
||||
function flatsome_refresh_cookies_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_cookies', array(
|
||||
'selector' => 'head > style#custom-css',
|
||||
'settings' => array( 'cookie_notice_bg_color' ),
|
||||
'render_callback' => function () {
|
||||
flatsome_custom_css();
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'cookies-text', array(
|
||||
'selector' => '.flatsome-cookies__text',
|
||||
'settings' => array( 'cookie_notice_text' ),
|
||||
'render_callback' => function () {
|
||||
return get_theme_mod( 'cookie_notice_text' )
|
||||
? do_shortcode( get_theme_mod( 'cookie_notice_text' ) )
|
||||
: __( 'This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.', 'flatsome' );
|
||||
},
|
||||
) );
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'flatsome_refresh_cookies_partials' );
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textfield',
|
||||
'settings' => 'nav_position',
|
||||
'label' => __( 'Nav Position', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textfield',
|
||||
'settings' => 'search_pos',
|
||||
'label' => __( 'Search Position', 'flatsome-admin' ),
|
||||
'section' => 'header-layout',
|
||||
'default' => '',
|
||||
));
|
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* Dev7studios Meta Box Framework
|
||||
*
|
||||
* @author Gilbert Pellegrom
|
||||
* @link https://github.com/Dev7studios/Dev7studios-Meta-Box-Framework
|
||||
* @version 1.0
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
if( !class_exists( 'Dev7_Meta_Box_Framework' ) ) {
|
||||
|
||||
class Dev7_Meta_Box_Framework {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
add_action( 'admin_init', array(&$this, 'admin_init') );
|
||||
add_action( 'add_meta_boxes', array(&$this, 'add_meta_boxes') );
|
||||
add_action( 'pre_post_update', array(&$this, 'meta_box_save') );
|
||||
}
|
||||
|
||||
function admin_init() {
|
||||
do_action( 'dev7_meta_boxes' );
|
||||
}
|
||||
|
||||
function add_meta_boxes() {
|
||||
global $dev7_meta_boxes;
|
||||
|
||||
|
||||
if( !is_array($dev7_meta_boxes) )
|
||||
return;
|
||||
|
||||
foreach( $dev7_meta_boxes as $meta_box ){
|
||||
if( is_array($meta_box['pages']) ){
|
||||
foreach( $meta_box['pages'] as $page ){
|
||||
add_meta_box( $meta_box['id'], $meta_box['title'], array(&$this, 'meta_box_output'), $page, $meta_box['context'], $meta_box['priority'], array('dev7_meta_box' => $meta_box) );
|
||||
}
|
||||
} else {
|
||||
add_meta_box( $meta_box['id'], $meta_box['title'], array(&$this, 'meta_box_output'), $meta_box['pages'], $meta_box['context'], $meta_box['priority'], array('dev7_meta_box' => $meta_box) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function meta_box_save( $post_id ) {
|
||||
|
||||
if(isset($_REQUEST['post_type'])){
|
||||
if ( 'page' == $_REQUEST['post_type'] ) {
|
||||
if ( !current_user_can( 'edit_page', $post_id ) )
|
||||
return;
|
||||
} else {
|
||||
if ( !current_user_can( 'edit_post', $post_id ) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !isset( $_POST['dev7_meta_box_nonce'] ) || !wp_verify_nonce( $_POST['dev7_meta_box_nonce'], plugin_basename( __FILE__ ) ) )
|
||||
return;
|
||||
|
||||
global $dev7_meta_boxes;
|
||||
if( !is_array($dev7_meta_boxes) )
|
||||
return;
|
||||
|
||||
foreach( $dev7_meta_boxes as $meta_box ){
|
||||
if( isset($meta_box['fields']) && is_array($meta_box['fields']) ){
|
||||
foreach( $meta_box['fields'] as $field ){
|
||||
if( isset($field['id']) ){
|
||||
if( $field['type'] == 'checkboxes' && isset($field['choices']) ){
|
||||
foreach( $field['choices'] as $ckey=>$cval ){
|
||||
if( isset($_POST[$field['id'] .'_'. $ckey]) ){
|
||||
update_post_meta( $post_id, $field['id'] .'_'. $ckey, $_POST[$field['id'] .'_'. $ckey] );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if( isset($_POST[$field['id']]) ){
|
||||
update_post_meta( $post_id, $field['id'], $_POST[$field['id']] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function meta_box_output( $post, $args ) {
|
||||
global $dev7_meta_boxes;
|
||||
if( !is_array($dev7_meta_boxes) )
|
||||
return;
|
||||
|
||||
wp_nonce_field( plugin_basename( __FILE__ ), 'dev7_meta_box_nonce' );
|
||||
|
||||
foreach( $dev7_meta_boxes as $meta_box ){
|
||||
if( isset($args['args']['dev7_meta_box']['id']) && $args['args']['dev7_meta_box']['id'] == $meta_box['id'] ){
|
||||
if( isset($meta_box['fields']) && is_array($meta_box['fields']) ){
|
||||
foreach( $meta_box['fields'] as $field ){
|
||||
if( isset($field['id']) && isset($field['type']) ){
|
||||
$value = get_post_meta( $post->ID, $field['id'], true );
|
||||
if( $value === false && isset($field['std']) ) $value = $field['std'];
|
||||
|
||||
if( $field['type'] == 'checkboxes' && isset($field['choices']) ){
|
||||
$value = array();
|
||||
foreach( $field['choices'] as $ckey=>$cval ){
|
||||
$value[$field['id'] .'_'. $ckey] = get_post_meta( $post->ID, $field['id'] .'_'. $ckey, true );
|
||||
}
|
||||
}
|
||||
|
||||
echo '<p>';
|
||||
|
||||
if( isset($field['name']) && $field['name'] && $field['type'] !== 'checkbox' ){
|
||||
echo '<label for="'. $field['id'] .'"><strong>'. $field['name'] .'</strong></label> ';
|
||||
echo '<br />';
|
||||
}
|
||||
if( isset($field['desc']) && $field['desc'] && $field['type'] !== 'checkbox' ){
|
||||
echo '<span class="help">'. $field['desc'] .'</span>';
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
|
||||
switch( $field['type'] ){
|
||||
case 'text':
|
||||
$value = esc_attr(stripslashes($value));
|
||||
echo '<input type="text" name="'. $field['id'] .'" id="'. $field['id'] .'" value="'. $value .'" style="width:100%" />';
|
||||
break;
|
||||
case 'textarea':
|
||||
$value = esc_html(stripslashes($value));
|
||||
echo '<textarea name="'. $field['id'] .'" id="'. $field['id'] .'" style="width:100%;height:150px;">'. $value .'</textarea>';
|
||||
break;
|
||||
case 'select':
|
||||
$value = esc_html(esc_attr($value));
|
||||
if( isset($field['choices']) ){
|
||||
echo '<select name="'. $field['id'] .'" id="'. $field['id'] .'" style="width:100%;">';
|
||||
foreach( $field['choices'] as $ckey=>$cval ){
|
||||
echo '<option value="'. $ckey .'"'. (($ckey == $value) ? ' selected="selected"' : '') .'>'. $cval .'</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
break;
|
||||
case 'radio':
|
||||
$value = esc_html(esc_attr($value));
|
||||
if( isset($field['choices']) ){
|
||||
foreach( $field['choices'] as $ckey=>$cval ){
|
||||
echo '<label><input type="radio" name="'. $field['id'] .'" id="'. $field['id'] .'_'. $ckey .'" value="'. $ckey .'"'. (($ckey == $value) ? ' checked="checked"' : '') .' /> '. $cval .'</label><br />';
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'checkbox':
|
||||
$value = esc_attr(stripslashes($value));
|
||||
echo '<input type="hidden" name="'. $field['id'] .'" value="0" />';
|
||||
echo '<label><input type="checkbox" name="'. $field['id'] .'" id="'. $field['id'] .'" value="1"'. (($value) ? ' checked="checked"' : '') .' /> '. $field['desc'] .'</label>';
|
||||
break;
|
||||
case 'checkboxes':
|
||||
if( isset($field['choices']) ){
|
||||
foreach( $field['choices'] as $ckey=>$cval ){
|
||||
$val = '';
|
||||
if(isset($value[$field['id'] .'_'. $ckey])) $val = $value[$field['id'] .'_'. $ckey];
|
||||
elseif(is_array($field['std']) && in_array($ckey, $field['std'])) $val = $ckey;
|
||||
$val = esc_html(esc_attr($val));
|
||||
echo '<input type="hidden" name="'. $field['id'] .'_'. $ckey .'" value="0" />';
|
||||
echo '<label><input type="checkbox" name="'. $field['id'] .'_'. $ckey .'" id="'. $field['id'] .'_'. $ckey .'" value="'. $ckey .'"'. (($ckey == $val) ? ' checked="checked"' : '') .' /> '. $cval .'</label><br />';
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
echo '</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
new Dev7_Meta_Box_Framework();
|
||||
|
||||
}
|
||||
|
||||
if( !function_exists( 'dev7_add_meta_box' ) ) {
|
||||
|
||||
function dev7_add_meta_box( $meta_box ) {
|
||||
global $dev7_meta_boxes;
|
||||
|
||||
if( !is_array($dev7_meta_boxes) )
|
||||
$dev7_meta_boxes = array();
|
||||
|
||||
$dev7_meta_boxes[] = $meta_box;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// PAGE META OPTIONS
|
||||
include('meta/meta_box_framework.php');
|
||||
|
||||
function flatsome_custom_meta_boxes() {
|
||||
$meta_box = array(
|
||||
'id' => 'flatsome_page_options2', // Meta box ID
|
||||
'title' => 'Page Layout', // Meta box title
|
||||
'pages' => array('page'), // Post types this meta box should be shown on
|
||||
'context' => 'side', // Meta box context
|
||||
'priority' => 'core', // Meta box priority
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => '_footer',
|
||||
'name' => 'Page Footer',
|
||||
//'desc' => 'This is a description.',
|
||||
'type' => 'select',
|
||||
'std' => 'normal',
|
||||
'choices' => array(
|
||||
'normal' => 'Normal',
|
||||
'simple' => 'Simple',
|
||||
'custom' => 'Custom',
|
||||
'transparent' => 'Transparent',
|
||||
'disabled' => 'Hide',
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
dev7_add_meta_box( $meta_box );
|
||||
}
|
||||
add_action( 'dev7_meta_boxes', 'flatsome_custom_meta_boxes' );
|
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Adds Pages Panel and options to the Customizer for Flatsome.
|
||||
*
|
||||
* @package Flatsome
|
||||
*/
|
||||
|
||||
Flatsome_Option::add_section( 'pages', array(
|
||||
'title' => __( 'Pages', 'flatsome-admin' ),
|
||||
'description' => __( 'Change the default page layout for all pages. You can also override some of these options per page in the page editor.', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'pages_template',
|
||||
'label' => __( 'Default - Page Template', 'flatsome-admin' ),
|
||||
'section' => 'pages',
|
||||
'default' => 'default',
|
||||
'choices' => array(
|
||||
'default' => __( 'Container (Default)', 'flatsome-admin' ),
|
||||
'blank-title-center' => __( 'Container - Center Title', 'flatsome-admin' ),
|
||||
'blank' => __( 'Full-Width', 'flatsome-admin' ),
|
||||
'header-on-scroll' => __( 'Full-Width - Header On Scroll', 'flatsome-admin' ),
|
||||
'blank-featured' => __( 'Full-Width - Parallax Title', 'flatsome-admin' ),
|
||||
'transparent-header' => __( 'Full-Width - Transparent Header', 'flatsome-admin' ),
|
||||
'transparent-header-light' => __( 'Full-Width - Transparent Header Light', 'flatsome-admin' ),
|
||||
'left-sidebar' => __( 'Sidebar Left', 'flatsome-admin' ),
|
||||
'blank-landingpage' => __( 'No Header / No Footer', 'flatsome-admin' ),
|
||||
'right-sidebar' => __( 'Sidebar Right', 'flatsome-admin' ),
|
||||
'single-page-nav' => __( 'Single Page Navigation', 'flatsome-admin' ),
|
||||
'single-page-nav-transparent' => __( 'Single Page Navigation - Transparent Header', 'flatsome-admin' ),
|
||||
'single-page-nav-transparent-light' => __( 'Single Page Navigation - Transparent Header - Light', 'flatsome-admin' ),
|
||||
'blank-sub-nav-vertical' => __( 'Vertical Sub Navigation', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'default_title',
|
||||
'label' => __( 'Show H1 Page title on the container (default), left sidebar and right sidebar templates.', 'flatsome-admin' ),
|
||||
'section' => 'pages',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'page_top_excerpt',
|
||||
'label' => __( 'Add excerpt content to top of pages.', 'flatsome-admin' ),
|
||||
'section' => 'pages',
|
||||
'default' => 1,
|
||||
));
|
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'fl-portfolio', array(
|
||||
'title' => __( 'Portfolio', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'featured_items_page',
|
||||
'label' => __( 'Custom Portfolio Page', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => false,
|
||||
'choices' => $list_pages
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_save_permalinks',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'You need to Click <strong>"Save & Publish"</strong> and then <strong>"Update Permalinks"</strong> button to make sure it works!<br><br> <a class="button" href="'.admin_url().'options-permalink.php?settings-updated=true" target="_blank">Update permalinks</a>',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_portfolio_single',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => '<div class="options-title-divider">Single Page</div>',
|
||||
) );
|
||||
|
||||
// Single Posts
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'portfolio_layout',
|
||||
'label' => __( 'Single Portfolio Layout', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'' => $image_url . 'portfolio.svg',
|
||||
'sidebar-right' => $image_url . 'portfolio-sidebar-right.svg',
|
||||
'top' => $image_url . 'portfolio-top.svg',
|
||||
'top-full' => $image_url . 'portfolio-top-full.svg',
|
||||
'bottom' => $image_url . 'portfolio-bottom.svg',
|
||||
'bottom-full' => $image_url . 'portfolio-bottom-full.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'portfolio_title_transparent',
|
||||
'label' => __( 'Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'portfolio_title',
|
||||
'label' => __( 'Single Portfolio Title', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'' => $image_url . 'portfolio-title.svg',
|
||||
'featured' => $image_url . 'portfolio-title-featured.svg',
|
||||
'breadcrumbs' => $image_url . 'portfolio-title-breadcrumbs.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'portfolio_share',
|
||||
'label' => __( 'Show share icons', 'flatsome' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'portfolio_related',
|
||||
'label' => __( 'Show related items', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 1
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'portfolio_next_prev',
|
||||
'label' => __( 'Show Next/Prev navigation', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 1
|
||||
));
|
||||
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_portfolio_archive',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => '<div class="options-title-divider">Archive Page</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'portfolio_archive_orderby',
|
||||
'label' => __( 'Portfolio Items Orderby', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'menu_order',
|
||||
'choices' => array(
|
||||
'title' => 'Title',
|
||||
'name' => 'Name',
|
||||
'date' => 'Date',
|
||||
'menu_order' => 'Menu Order',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'portfolio_archive_order',
|
||||
'label' => __( 'Portfolio Items Order', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'desc',
|
||||
'choices' => array(
|
||||
'desc' => 'DESC',
|
||||
'asc' => 'ASC',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'portfolio_style',
|
||||
'label' => __( 'Portfolio Style', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'' => $image_url . 'portfolio-simple.svg',
|
||||
'overlay' => $image_url . 'portfolio-overlay.svg',
|
||||
'shade' => $image_url . 'portfolio-shade.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'portfolio_height',
|
||||
'label' => __( 'Image Height', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
0 => 'Auto',
|
||||
'50%' => '1:2 (Wide)',
|
||||
'75%' => '4:3 (Rectangular)',
|
||||
'56%' => '16:9 (Widescreen)',
|
||||
'100%' => '1:1 (Square)',
|
||||
'125%' => 'Portrait',
|
||||
'200%' => '2:1 (Tall)',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'portfolio_archive_image_radius',
|
||||
'label' => __( 'Image Radius (%)', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'portfolio_archive_image_size',
|
||||
'label' => __( 'Image Size', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'medium',
|
||||
'choices' => array(
|
||||
'large' => 'Large',
|
||||
'medium' => 'Medium',
|
||||
'thumbnail' => 'Thumbnail',
|
||||
'original' => 'Original',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'portfolio_archive_depth',
|
||||
'label' => __( 'Item Depth', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'portfolio_archive_depth_hover',
|
||||
'label' => __( 'Item Depth :hover', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'portfolio_archive_spacing',
|
||||
'label' => __( 'Column Spacing', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'small',
|
||||
'choices' => array(
|
||||
'collapse' => 'Collapse',
|
||||
'xsmall' => 'X Small',
|
||||
'small' => 'Small',
|
||||
'normal' => 'Normal',
|
||||
'large' => 'Large',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'portfolio_archive_columns',
|
||||
'label' => __( 'Items per row - Desktop', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 4,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 6,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'portfolio_archive_columns_tablet',
|
||||
'label' => __( 'Items per row - Tablet', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 3,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 4,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'portfolio_archive_columns_mobile',
|
||||
'label' => __( 'Items per row - Mobile', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 2,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 3,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'portfolio_archive_title',
|
||||
'label' => __( 'Archive Portfolio Title', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'' => $image_url . 'portfolio-title.svg',
|
||||
'featured' => $image_url . 'portfolio-title-featured.svg',
|
||||
'breadcrumbs' => $image_url . 'portfolio-title-breadcrumbs.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'portfolio_archive_title_transparent',
|
||||
'label' => __( 'Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'portfolio_archive_bg',
|
||||
'label' => __( 'Portfolio Header Background', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => "",
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'portfolio_archive_filter',
|
||||
'label' => __( 'Filter Navigation', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'left',
|
||||
'choices' => array(
|
||||
'left' => 'Left',
|
||||
'center' => 'Center',
|
||||
'disabled' => 'Disabled'
|
||||
),
|
||||
'transport' => $transport,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'portfolio_archive_filter_style',
|
||||
'label' => __( 'Filter Nav style', 'flatsome-admin' ),
|
||||
'section' => 'fl-portfolio',
|
||||
'default' => 'line-grow',
|
||||
'transport' => $transport,
|
||||
'choices' => $nav_styles_img
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
function flatsome_refresh_portfolio_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( 'portfolio-single-layout', array(
|
||||
'selector' => '.portfolio-single-page',
|
||||
'settings' => array('portfolio_style','portfolio_layout','portfolio_title'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/portfolio/single-portfolio', flatsome_option('portfolio_layout'));
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'portfolio-archive-layout', array(
|
||||
'selector' => '.portfolio-archive',
|
||||
'settings' => array('portfolio_archive_title','portfolio_archive_filter','portfolio_style','portfolio_archive_filter_style'),
|
||||
'render_callback' => function() {
|
||||
get_template_part('template-parts/portfolio/archive-portfolio', flatsome_option('portfolio_archive_layout'));
|
||||
},
|
||||
) );
|
||||
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_portfolio_partials' );
|
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
// CART
|
||||
|
||||
Flatsome_Option::add_section( 'cart-checkout', array(
|
||||
'title' => __( 'Cart', 'flatsome-admin' ),
|
||||
'panel' => 'woocommerce',
|
||||
'priority' => 1000
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'cart_layout',
|
||||
'label' => __( 'Cart layout', 'flatsome-admin' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'simple' => __( 'Simple', 'flatsome-admin' ),
|
||||
'focused' => __( 'Focused', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cart_sticky_sidebar',
|
||||
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cart_auto_refresh',
|
||||
'label' => __( 'Auto update on quantity change', 'flatsome-admin' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cart_boxed_shipping_labels',
|
||||
'label' => __( 'Boxed Shipping labels', 'flatsome' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cart_estimate_text',
|
||||
'label' => __( 'Show shipping estimate destination', 'flatsome' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 1
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'cart_steps_title',
|
||||
'label' => '',
|
||||
'section' => 'cart-checkout',
|
||||
'default' => '<div class="options-title-divider">Steps</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'cart_steps_size',
|
||||
'label' => __( 'Steps size', 'flatsome-admin' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 'h2',
|
||||
'choices' => array(
|
||||
'h2' => __( 'Default', 'flatsome-admin' ),
|
||||
'h3' => __( 'Small', 'flatsome-admin' ),
|
||||
'h4' => __( 'Smaller', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'cart_steps_case',
|
||||
'label' => esc_attr__( 'Steps letter case', 'flatsome-admin' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 'uppercase',
|
||||
'choices' => array(
|
||||
'uppercase' => 'UPPERCASE',
|
||||
'none' => 'Normal',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'cart_steps_numbers',
|
||||
'label' => __( 'Step numbers', 'flatsome-admin' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'html_cart_title',
|
||||
'label' => '',
|
||||
'section' => 'cart-checkout',
|
||||
'default' => '<div class="options-title-divider">Custom Content</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_cart_sidebar',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Cart Sidebar content', 'flatsome-admin' ),
|
||||
'help' => __( 'Enter HTML that will show on bottom of cart sidebar' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_cart_footer',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'After Cart content', 'flatsome-admin' ),
|
||||
'help' => __( 'Enter HTML or Shortcodes that will show after cart here.' ),
|
||||
'section' => 'cart-checkout',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
|
||||
// CHECKOUT
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'checkout_layout',
|
||||
'priority' => 1,
|
||||
'label' => __( 'Checkout layout', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'simple' => __( 'Simple', 'flatsome-admin' ),
|
||||
'focused' => __( 'Focused', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
if ( is_nextend_facebook_login() || is_nextend_google_login() ) {
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'facebook_login_checkout',
|
||||
'label' => __( 'Social Login Buttons', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => 0
|
||||
));
|
||||
}
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'checkout_terms_and_conditions',
|
||||
'label' => __( 'Terms and conditions link style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'tab' => __( 'New Tab', 'flatsome-admin' ),
|
||||
'lightbox' => __( 'Lightbox', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'terms_and_conditions_lightbox_buttons',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Terms and conditions "Agree" button', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => 1,
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'checkout_terms_and_conditions',
|
||||
'operator' => '==',
|
||||
'value' => 'lightbox',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'checkout_floating_labels',
|
||||
'label' => __( 'Floating field labels', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'checkout_fields_email_first',
|
||||
'label' => __( 'Move E-mail field to first position', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'checkout_sticky_sidebar',
|
||||
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => 0
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_checkout_sidebar',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Checkout Sidebar content', 'flatsome-admin' ),
|
||||
'help' => __( 'Enter HTML that will show on bottom of checkout sidebar' ),
|
||||
'section' => 'woocommerce_checkout',
|
||||
'default' => '',
|
||||
));
|
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
Flatsome_Option::add_section( 'catalog-mode', array(
|
||||
'title' => __( 'Catalog Mode', 'flatsome-admin' ),
|
||||
'panel' => 'woocommerce',
|
||||
'description' => __( 'Enable Catalog Mode', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'catalog_mode',
|
||||
'label' => __( 'Enable Catalogue Mode.', 'flatsome-admin' ),
|
||||
'section' => 'catalog-mode',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'catalog_mode_prices',
|
||||
'label' => __( 'Disable Prices', 'flatsome-admin' ),
|
||||
'description' => 'Select to disable prices on category pages and product page.',
|
||||
'section' => 'catalog-mode',
|
||||
'default' => 0,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'catalog_mode_header',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Header Cart replacement', 'flatsome-admin' ),
|
||||
'help' => __( "Enter content you want to display instad of Account / Cart. Shortcodes are allowed.", 'flatsome-admin'),
|
||||
'section' => 'catalog-mode',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'catalog_mode_product',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Product page Add to cart replacement.', 'flatsome-admin' ),
|
||||
'help' => __( 'Enter contact information or enquery form shortcode here.', 'flatsome-admin'),
|
||||
'section' => 'catalog-mode',
|
||||
'default' => 'Add any HTML or Shortcode here...',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'catalog_mode_lightbox',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Add to cart replacement - Product Quick View', 'flatsome-admin' ),
|
||||
'help' => __( 'Enter text that will show in product quick view', 'flatsome-admin'),
|
||||
'section' => 'catalog-mode',
|
||||
'default' => '',
|
||||
));
|
@@ -0,0 +1,794 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'woocommerce_product_catalog', array(
|
||||
'title' => __( 'Product Catalog', 'woocommerce' ),
|
||||
'panel' => 'woocommerce',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_homepage',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Shop Page</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_shop_page',
|
||||
'label' => __( 'Shop Page Header', 'flatsome-admin' ),
|
||||
'description' => __( 'Enter HTML that should be placed on top of main shop page. Shortcodes are allowed. This will replace Shop Homepage Header', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_shop_page_content',
|
||||
'label' => __( 'Shop Page Content', 'flatsome-admin' ),
|
||||
'description' => __( 'Enter HTML/Shortcodes that should replace Shop Homepage content.', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_layout',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Catalog Layout</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'category_sidebar',
|
||||
'label' => __( 'Layout', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 'left-sidebar',
|
||||
'choices' => array(
|
||||
'none' => $image_url . 'category-no-sidebar.svg',
|
||||
'left-sidebar' => $image_url . 'category-left-sidebar.svg',
|
||||
'right-sidebar' => $image_url . 'category-right-sidebar.svg',
|
||||
'off-canvas' => $image_url . 'category-off-canvas.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'category_sticky_sidebar',
|
||||
'label' => __( 'Sticky sidebar', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'category_sidebar',
|
||||
'operator' => '!==',
|
||||
'value' => 'none',
|
||||
),
|
||||
array(
|
||||
'setting' => 'category_sidebar',
|
||||
'operator' => '!==',
|
||||
'value' => 'off-canvas',
|
||||
),
|
||||
),
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'category_grid_style',
|
||||
'label' => __( 'List Style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 'grid',
|
||||
'choices' => array(
|
||||
'grid' => $image_url . 'category-style-grid.svg',
|
||||
'list' => $image_url . 'category-style-list.svg',
|
||||
'masonry' => $image_url . 'category-style-masonry.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'category_force_image_height',
|
||||
// 'transport' => $transport,
|
||||
'label' => __( 'EQUAL IMAGE HEIGHTS', 'flatsome-admin' ),
|
||||
'description' => 'Force all images to have the same height',
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => false,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'category_image_height',
|
||||
'label' => __( 'Equal Image height', 'flatsome-admin' ),
|
||||
'description' => 'Change the image height in %. (100% = 1:1)',
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'category_force_image_height',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'transport' => $transport,
|
||||
'default' => 100,
|
||||
'choices' => array(
|
||||
'min' => 50,
|
||||
'max' => 200,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_html_woocommerce_image_shortcut_category',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<button style="margin-top: 15px; margin-bottom:15px" class="button button-primary" data-to-section="woocommerce_product_images">Thumbnail Image Settings →</button>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'products_pr_page',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Products per Page', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 12,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'category_row_count',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Products per row - Desktop', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 3,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 6,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'category_row_count_tablet',
|
||||
'label' => __( 'Products per row - Tablet', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 3,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 4,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'category_row_count_mobile',
|
||||
'label' => __( 'Products per row - Mobile', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 2,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 3,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_header',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Header</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'category_title_style',
|
||||
'label' => __( 'Title Style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => $image_url . 'category-title.svg',
|
||||
'featured' => $image_url . 'category-title-featured.svg',
|
||||
'featured-center' => $image_url . 'category-title-featured-center.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'category_show_title',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show title', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '0',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'breadcrumb_home',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show home link in breadcrumb', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => function () {
|
||||
$wpseo = class_exists( 'WPSEO_Options' ) && get_theme_mod( 'wpseo_breadcrumb' ) ? true : false;
|
||||
$rank_math = class_exists( 'RankMath' ) && get_theme_mod( 'rank_math_breadcrumb' ) ? true : false;
|
||||
|
||||
return ! $wpseo && ! $rank_math;
|
||||
},
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'category_header_transparent',
|
||||
'label' => __( 'Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '0',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'header_shop_bg_featured',
|
||||
'transport' => $transport,
|
||||
'help' => __( 'Use Featured Images from categories and products as background. Will fallback to default Shop Title background if nothing is set.', 'flatsome-admin' ),
|
||||
'label' => __( 'Featured Image as Background', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'header_shop_bg_image',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Shop Title Background', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'header_shop_bg_color',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Title Background Color', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 'rgba(0,0,0,.3)',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'category_filter_text',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Custom Filter Text', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_breadcrumbs',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Breadcrumbs</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'breadcrumb_size',
|
||||
'label' => __( 'Breadcrumb Size', 'flatsome-admin' ),
|
||||
'help' => __( 'Change size of breadcrumb on product categories. Useful if you have long breadcrumbs.', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 'large',
|
||||
'choices' => $sizes,
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'breadcrumb_case',
|
||||
'label' => esc_attr__( 'Breadcrumbs Case', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 'uppercase',
|
||||
'choices' => array(
|
||||
'uppercase' => 'UPPERCASE',
|
||||
'' => 'Normal',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_category_box',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Category Box</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'cat_style',
|
||||
'label' => __( 'Category Box Style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 'badge',
|
||||
'choices' => array(
|
||||
'normal' => $image_url . 'category-box.svg',
|
||||
'badge' => $image_url . 'category-box-badge.svg',
|
||||
'overlay' => $image_url . 'category-box-overlay.svg',
|
||||
'label' => $image_url . 'category-box-label.svg',
|
||||
'shade' => $image_url . 'category-box-shade.svg',
|
||||
'bounce' => $image_url . 'category-box-bounce.svg',
|
||||
'push' => $image_url . 'category-box-push.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'category_show_count',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show product count', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_product_box',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Product Box</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'grid_style',
|
||||
'label' => __( 'Grid Style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 'grid1',
|
||||
'choices' => array(
|
||||
'grid1' => $image_url . 'product-box.svg',
|
||||
'grid2' => $image_url . 'product-box-center.svg',
|
||||
'grid3' => $image_url . 'product-box-wide.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_hover',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Product Image Hover style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 'fade_in_back',
|
||||
'choices' => array(
|
||||
'none' => __( 'None', 'flatsome-admin' ),
|
||||
'fade_in_back' => __( 'Back Image - Fade In', 'flatsome-admin' ),
|
||||
'zoom_in' => __( 'Back Image - Zoom In', 'flatsome-admin' ),
|
||||
'zoom' => 'Zoom',
|
||||
'zoom-fade' => 'Zoom Fade',
|
||||
'blur' => 'Blur',
|
||||
'fade-in' => 'Fade In',
|
||||
'fade-out' => 'Fade Out',
|
||||
'glow' => 'Glow',
|
||||
'color' => 'Add Color',
|
||||
'grayscale' => 'Grayscale',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'category_shadow',
|
||||
'label' => __( 'Drop Shadow', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'category_shadow_hover',
|
||||
'label' => __( 'Drop Shadow :hover', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'add_to_cart_icon',
|
||||
'label' => __( 'Add To Cart Button', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 'disable',
|
||||
'choices' => array(
|
||||
'disable' => $image_url . 'product-box.svg',
|
||||
'show' => $image_url . 'product-box-add-to-cart-icon.svg',
|
||||
'button' => $image_url . 'product-box-add-to-cart-button.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'add_to_cart_style',
|
||||
'label' => __( 'Button Style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 'outline',
|
||||
'choices' => array(
|
||||
'flat' => __( 'Plain', 'flatsome-admin' ),
|
||||
'outline' => __( 'Outline', 'flatsome-admin' ),
|
||||
'underline' => __( 'Underline', 'flatsome-admin' ),
|
||||
'shade' => __( 'Shade', 'flatsome-admin' ),
|
||||
'bevel' => __( 'Bevel', 'flatsome-admin' ),
|
||||
'gloss' => __( 'Gloss', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_box_category',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show Category', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_box_rating',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show Ratings', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'short_description_in_grid',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Show Short Description', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '0',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'disable_quick_view',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Disable Quick View', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'equalize_product_box',
|
||||
'transport' => $transport,
|
||||
'label' => esc_attr__( 'Equalize Items', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '0',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'bubble_style',
|
||||
'label' => __( 'Bubble Style', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 'style1',
|
||||
'choices' => array(
|
||||
'style1' => $image_url . 'badge-circle.svg',
|
||||
'style2' => $image_url . 'badge-square.svg',
|
||||
'style3' => $image_url . 'badge-border.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'sale_bubble_text',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Custom Sale Bubble Text', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'sanitize_callback' => 'wp_kses_post',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'sale_bubble_percentage',
|
||||
'label' => __( 'Enable % instead of "Sale!"', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '0',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'sale_bubble_percentage_formatting',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Sale Bubble % Formatting', 'flatsome-admin' ),
|
||||
'description' => __( 'How the discount should be displayed. e.g. -{value}%', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'sanitize_callback' => 'wp_kses_post',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'sale_bubble_percentage',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'default' => '-{value}%',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'number',
|
||||
'settings' => 'new_bubble_auto',
|
||||
'label' => __( 'Auto "New" bubble', 'flatsome-admin' ),
|
||||
'description' => __( 'Shown on products witch age is x and lower in days.', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'default' => 0,
|
||||
'choices' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
if ( get_theme_mod( 'swatches' ) ) :
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_category_swatches',
|
||||
'label' => '',
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '<div class="options-title-divider">Swatches</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'swatches_box_attribute',
|
||||
'label' => __( 'Product attribute', 'flatsome-admin' ),
|
||||
'tooltip' => __( 'The product (variation) atrribute that swatches will be populated for (usually an attribute that determines colors).', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'default' => '',
|
||||
'choices' => flatsome_get_product_attribute_taxonomies_list_by_id( array( 'option_none' => '-- None --' ) ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'swatches_box_layout',
|
||||
'label' => __( 'Layout', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'Normal',
|
||||
'limit' => 'Limited',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'swatches_box_limit',
|
||||
'label' => __( 'Limit', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
array(
|
||||
'setting' => 'swatches_box_layout',
|
||||
'operator' => '===',
|
||||
'value' => 'limit',
|
||||
),
|
||||
),
|
||||
'default' => 5,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'swatches_box_size',
|
||||
'label' => __( 'Size', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'x-small' => 'X Small',
|
||||
'small' => 'Small',
|
||||
'' => 'Medium',
|
||||
'large' => 'Large',
|
||||
'x-large' => 'X Large',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'swatches_box_shape',
|
||||
'label' => __( 'Shape', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'transport' => $transport,
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'Square',
|
||||
'rounded' => 'Rounded',
|
||||
'circle' => 'Circle',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'swatches_box_select_event',
|
||||
'label' => __( 'Select event - Desktop', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'On hover',
|
||||
'click' => 'On click',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'swatches_box_color_selected',
|
||||
'transport' => 'postMessage',
|
||||
'label' => __( 'Color :selected', 'flatsome' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => Flatsome_Default::COLOR_SECONDARY,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'swatches_box_behavior_selected',
|
||||
'label' => __( 'Behavior :selected', 'flatsome-admin' ),
|
||||
'description' => __( 'When clicking an already selected swatch.', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'Go to product page',
|
||||
'unselect' => 'Unselect swatch',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'swatches_box_update_urls',
|
||||
'label' => __( 'Update links to selected variation', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'swatches_box_reset',
|
||||
'label' => __( 'Auto reset selection', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'swatches_box_reset_extent',
|
||||
'label' => __( 'Reset extent', 'flatsome-admin' ),
|
||||
'description' => __( 'The area the pointer should leave for a reset.', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
array(
|
||||
'setting' => 'swatches_box_reset',
|
||||
'operator' => '!=',
|
||||
'value' => 0,
|
||||
),
|
||||
),
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => __( 'Swatch', 'flatsome-admin' ),
|
||||
'product-box' => __( 'Product box', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'swatches_box_reset_time',
|
||||
'label' => __( 'Reset time', 'flatsome-admin' ),
|
||||
'description' => __( 'In milliseconds (1000ms = 1sec).', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_product_catalog',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'swatches_box_attribute',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
array(
|
||||
'setting' => 'swatches_box_reset',
|
||||
'operator' => '!=',
|
||||
'value' => 0,
|
||||
),
|
||||
),
|
||||
'default' => 300,
|
||||
'choices' => array(
|
||||
'min' => 100,
|
||||
'max' => 10000,
|
||||
'step' => 100,
|
||||
),
|
||||
) );
|
||||
endif;
|
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
global $wc;
|
||||
|
||||
Flatsome_Option::add_section( 'fl-my-account', array(
|
||||
'title' => __( 'My Account', 'flatsome-admin' ),
|
||||
'description' => 'Note: Register form/link is only visible for non logged in users and the WooCommerce setting, "Allow customers to create an account on the "My account" page" is enabled.',
|
||||
'panel' => 'woocommerce',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'alpha' => true,
|
||||
'settings' => 'my_account_title_bg_color',
|
||||
'label' => __( 'Title Background Color', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'facebook_login_bg',
|
||||
'label' => __( 'Title Background Image', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'transport' => $transport,
|
||||
'default' => ''
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'my_account_title_align',
|
||||
'label' => __( 'Title Align', 'flatsome-admin' ),
|
||||
'description' => __( 'For logged in users only.', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'default' => 'left',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'left' => $image_url . 'align-left.svg',
|
||||
'center' => $image_url . 'align-center.svg',
|
||||
'right' => $image_url . 'align-right.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'my_account_title_text_color',
|
||||
'label' => __( 'Text color', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'default' => 'dark',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'light' => $image_url . 'text-light.svg',
|
||||
'dark' => $image_url . 'text-dark.svg',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'facebook_login_text',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Login Text', 'flatsome-admin' ),
|
||||
'description' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'social_login_pos',
|
||||
'label' => __( 'Social Button', 'flatsome-admin' ),
|
||||
'description' => __( 'Change position of Social Login Buttons in lightbox.', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'default' => 'top',
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'flatsome-admin' ),
|
||||
'bottom' => __( 'Bottom', 'flatsome-admin' ),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'wc_account_links',
|
||||
'label' => __( 'Enable default WooCommerce Account links in Dropdown and Account Sidebar. You can create a custom my account menu instead if you want.', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'default' => 1,
|
||||
));
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_html_header_account_shortcut',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'fl-my-account',
|
||||
'default' => '<button style="margin-top:30px; margin-bottom:15px" class="button button-primary" data-to-section="header_account">Header Element →</button>',
|
||||
) );
|
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
|
||||
Flatsome_Option::add_section( 'payment-icons', array(
|
||||
'title' => __( 'Payments Icons', 'flatsome-admin' ),
|
||||
'description' => 'Note: This is not where you select payment methods. These are graphical icons that show which payment methods your shop supports. You can add these anywhere by using the shortcode [ux_payment_icons]',
|
||||
'panel' => 'woocommerce',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'sortable',
|
||||
'settings' => 'payment_icons',
|
||||
'label' => __( 'Payment Icons', 'flatsome-admin' ),
|
||||
'section' => 'payment-icons',
|
||||
'transport' => $transport,
|
||||
'multiple' => 99,
|
||||
'default' => array( 'visa', 'paypal', 'stripe', 'mastercard', 'cashondelivery' ),
|
||||
'choices' => flatsome_get_payment_icons_list(),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'payment_icons_custom',
|
||||
'label' => __( 'Custom Icons (Replace)', 'flatsome-admin' ),
|
||||
'section' => 'payment-icons',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'multicheck',
|
||||
'settings' => 'payment_icons_placement',
|
||||
'label' => __( 'Placement', 'flatsome-admin' ),
|
||||
'description' => __( 'Select where you want to show the payment icons', 'flatsome-admin' ),
|
||||
'section' => 'payment-icons',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'footer' => __( 'Absolute Footer', 'flatsome-admin' ),
|
||||
'cart' => __( 'Cart Sidebar', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
@@ -0,0 +1,544 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'product-page', array(
|
||||
'title' => __( 'Product Page', 'flatsome-admin' ),
|
||||
'panel' => 'woocommerce',
|
||||
) );
|
||||
|
||||
function flatsome_customizer_shop_product_page_options() {
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_product_layout',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Layout</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'product_layout',
|
||||
'label' => __( 'Product Layout', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => flatsome_product_layout(),
|
||||
'choices' => array(
|
||||
'no-sidebar' => flatsome_customizer_images_uri() . '/layout-no-sidebar.svg',
|
||||
'left-sidebar' => flatsome_customizer_images_uri() . '/layout-left.svg',
|
||||
'left-sidebar-full' => flatsome_customizer_images_uri() . '/layout-left-full.svg',
|
||||
'left-sidebar-small' => flatsome_customizer_images_uri() . '/layout-left-small.svg',
|
||||
'right-sidebar' => flatsome_customizer_images_uri() . '/layout-right.svg',
|
||||
'right-sidebar-small' => flatsome_customizer_images_uri() . '/layout-right-small.svg',
|
||||
'right-sidebar-full' => flatsome_customizer_images_uri() . '/layout-right-full.svg',
|
||||
'gallery-wide' => flatsome_customizer_images_uri() . '/layout-wide-gallery.svg',
|
||||
'stacked-right' => flatsome_customizer_images_uri() . '/product-stacked.svg',
|
||||
'custom' => flatsome_customizer_images_uri() . '/layout-custom.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_custom_layout',
|
||||
'label' => __( 'Custom product layout', 'flatsome' ),
|
||||
'description' => __( 'Create a custom product layout by using the UX Builder. You need to select a Block and then open it in the UX Builder from a product page in the front-end.', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'product_layout',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'default' => false,
|
||||
'choices' => flatsome_customizer_blocks(),
|
||||
) );
|
||||
|
||||
$hide_on_gallery_wide = array(
|
||||
'setting' => 'product_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'gallery-wide',
|
||||
);
|
||||
$hide_on_custom_product = array(
|
||||
'setting' => 'product_layout',
|
||||
'operator' => '!==',
|
||||
'value' => 'custom',
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_offcanvas_sidebar',
|
||||
'label' => __( 'Off-canvas Sidebar for Mobile', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'product_header',
|
||||
'label' => __( 'Product Header', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '',
|
||||
'active_callback' => array(
|
||||
$hide_on_gallery_wide,
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'choices' => array(
|
||||
'' => flatsome_customizer_images_uri() . '/product-title.svg',
|
||||
'top' => flatsome_customizer_images_uri() . '/product-title-top.svg',
|
||||
'featured' => flatsome_customizer_images_uri() . '/product-title-featured.svg',
|
||||
'featured-center' => flatsome_customizer_images_uri() . '/product-title-featured-center.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_header_transparent',
|
||||
'label' => __( 'Transparent Header', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_next_prev_nav',
|
||||
'active_callback' => array(
|
||||
$hide_on_gallery_wide,
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'label' => __( 'Next / Prev Navigation', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_product_gallery',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Gallery</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_image_width',
|
||||
'label' => __( 'Product Image Width', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => function () {
|
||||
return ! get_theme_mod( 'product_gallery_woocommerce' )
|
||||
&& get_theme_mod( 'product_layout' ) !== 'gallery-wide'
|
||||
&& get_theme_mod( 'product_layout' ) !== 'custom';
|
||||
},
|
||||
'transport' => 'postMessage',
|
||||
'default' => '6',
|
||||
'choices' => array(
|
||||
'8' => __( '8/12', 'flatsome-admin' ),
|
||||
'7' => __( '7/12', 'flatsome-admin' ),
|
||||
'6' => __( '6/12 (50%)', 'flatsome-admin' ),
|
||||
'5' => __( '5/12', 'flatsome-admin' ),
|
||||
'4' => __( '4/12', 'flatsome-admin' ),
|
||||
'3' => __( '3/12', 'flatsome-admin' ),
|
||||
'2' => __( '2/12', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'product_image_style',
|
||||
'label' => __( 'Product Image Style', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => function () {
|
||||
return ! get_theme_mod( 'product_gallery_woocommerce' )
|
||||
&& get_theme_mod( 'product_layout' ) !== 'gallery-wide'
|
||||
&& get_theme_mod( 'product_layout' ) !== 'custom'
|
||||
&& get_theme_mod( 'product_layout' ) !== 'stacked-right';
|
||||
},
|
||||
'default' => 'normal',
|
||||
'choices' => array(
|
||||
'normal' => flatsome_customizer_images_uri() . '/product-gallery.svg',
|
||||
'vertical' => flatsome_customizer_images_uri() . '/product-gallery-vertical.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_lightbox',
|
||||
'active_callback' => function() {
|
||||
return ! get_theme_mod( 'product_gallery_woocommerce' );
|
||||
},
|
||||
'label' => __( 'Product Image Lightbox', 'flatsome-admin' ),
|
||||
'description' => __( 'Show images in a lightbox when clicking on image in gallery. You might need to save and close Customizer for this to work properly.', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 'default',
|
||||
'choices' => array(
|
||||
'default' => __( 'New WooCommerce 3.0 Lightbox', 'flatsome-admin' ),
|
||||
'flatsome' => __( 'Flatsome Lightbox', 'flatsome-admin' ),
|
||||
'woocommerce' => __( 'Old WooCommerce Lightbox', 'flatsome-admin' ),
|
||||
'disabled' => __( 'Disable Lightbox', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_zoom',
|
||||
'active_callback' => function () {
|
||||
return ! get_theme_mod( 'product_gallery_woocommerce' )
|
||||
&& get_theme_mod( 'product_layout' ) !== 'gallery-wide';
|
||||
},
|
||||
'label' => __( 'Product Image Hover Zoom', 'flatsome-admin' ),
|
||||
'description' => __( 'Show a zoomed version of image when hovering gallery', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_html_woocommerce_image_shortcut_product',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<button style="margin-top: 15px; margin-bottom:15px" class="button button-primary" data-to-section="woocommerce_product_images">WooCommerce Image Settings →</button>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_section_gallery_message',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'active_callback' => function () {
|
||||
return get_theme_mod( 'product_gallery_woocommerce' ) ? true : false;
|
||||
},
|
||||
'section' => 'product-page',
|
||||
'default' => '<span style="margin-top: -10px" class="description customize-control-description">The default WooCommerce gallery has been activated in section Advanced → WooCommerce. Multiple Flatsome gallery options are disabled.</span>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_product_info',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Product Summary</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'product_info_align',
|
||||
'label' => __( 'Text Align', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
$hide_on_gallery_wide,
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'default' => 'left',
|
||||
'choices' => array(
|
||||
'left' => __( 'Left', 'flatsome-admin' ),
|
||||
'center' => __( 'Center', 'flatsome-admin' ),
|
||||
'right' => __( 'Right', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'product_info_form',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'label' => __( 'Form Style', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => __( 'Default', 'flatsome-admin' ),
|
||||
'flat' => __( 'Flat', 'flatsome-admin' ),
|
||||
'minimal' => __( 'Minimal', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_title_divider',
|
||||
'label' => __( 'Product Title divider', 'flatsome-admin' ),
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'section' => 'product-page',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_sticky_cart',
|
||||
'label' => __( 'Sticky add to cart', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 0,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_info_review_count',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'label' => __( 'Show Review Count', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => false,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_info_review_count_style',
|
||||
'label' => __( 'Review Count Style', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
array(
|
||||
'setting' => 'product_info_review_count',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'default' => 'inline',
|
||||
'choices' => array(
|
||||
'tooltip' => __( 'Tooltip', 'flatsome-admin' ),
|
||||
'stacked' => __( 'Stacked', 'flatsome-admin' ),
|
||||
'inline' => __( 'Inline', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_info_meta',
|
||||
'active_callback' => array(
|
||||
$hide_on_gallery_wide,
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'label' => __( 'Show Meta / Categories', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'product_info_share',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'label' => __( 'Show Share Icons', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
if ( get_theme_mod( 'swatches' ) ) :
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_swatches',
|
||||
'label' => '',
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Swatches</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'swatches_layout',
|
||||
'label' => __( 'Layout', 'flatsome' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => flatsome_customizer_images_uri() . '/product-swatches.svg',
|
||||
'stacked' => flatsome_customizer_images_uri() . '/product-swatches-stacked.svg',
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'swatches_tooltip',
|
||||
'label' => __( 'Tooltip', 'flatsome' ),
|
||||
'description' => __( 'Show a tooltip with the term or term description.', 'flatsome' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'swatches_color_selected',
|
||||
'transport' => 'postMessage',
|
||||
'label' => __( 'Color :selected', 'flatsome' ),
|
||||
'section' => 'product-page',
|
||||
'default' => Flatsome_Default::COLOR_SECONDARY,
|
||||
) );
|
||||
endif;
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_product_tabs',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Tabs</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_display',
|
||||
'label' => __( 'Product Tabs Style', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'default' => 'tabs',
|
||||
'choices' => array(
|
||||
'tabs' => __( 'Line Tabs', 'flatsome-admin' ),
|
||||
'tabs_normal' => __( 'Tabs Normal', 'flatsome-admin' ),
|
||||
'line-grow' => __( 'Line Tabs - Grow', 'flatsome-admin' ),
|
||||
'tabs_vertical' => __( 'Tabs vertical', 'flatsome-admin' ),
|
||||
'tabs_pills' => __( 'Pills', 'flatsome-admin' ),
|
||||
'tabs_outline' => __( 'Outline', 'flatsome-admin' ),
|
||||
'sections' => __( 'Sections', 'flatsome-admin' ),
|
||||
'accordian' => __( 'Accordion', 'flatsome-admin' ),
|
||||
'accordian-collapsed' => __( 'Accordion - Collapsed', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'product_tabs_align',
|
||||
'label' => __( 'Product Tabs Align', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'default' => 'left',
|
||||
'choices' => array(
|
||||
'left' => __( 'Left', 'flatsome-admin' ),
|
||||
'center' => __( 'Center', 'flatsome-admin' ),
|
||||
'right' => __( 'Right', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'tab_title',
|
||||
'label' => __( 'Global custom tab title', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'tab_content',
|
||||
'label' => __( 'Global custom tab content', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_product_related',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Related / Upsell</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'product_upsell',
|
||||
'label' => __( 'Product Upsell', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
$hide_on_gallery_wide,
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'default' => 'sidebar',
|
||||
'choices' => array(
|
||||
'sidebar' => __( 'In Sidebar', 'flatsome-admin' ),
|
||||
'bottom' => __( 'Below Description', 'flatsome-admin' ),
|
||||
'disabled' => __( 'Disabled', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'select',
|
||||
'settings' => 'related_products',
|
||||
'label' => __( 'Related Products Style', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'active_callback' => array(
|
||||
$hide_on_custom_product,
|
||||
),
|
||||
'default' => 'slider',
|
||||
'choices' => array(
|
||||
'slider' => __( 'Slider', 'flatsome-admin' ),
|
||||
'grid' => __( 'Grid', 'flatsome-admin' ),
|
||||
'hidden' => __( 'Disabled', 'flatsome-admin' ),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'related_products_pr_row',
|
||||
'label' => __( 'Products per row - Desktop', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 4,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 6,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'related_products_pr_row_tablet',
|
||||
'label' => __( 'Products per row - Tablet', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 3,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 4,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'related_products_pr_row_mobile',
|
||||
'label' => __( 'Products per row - Mobile', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => 2,
|
||||
'choices' => array(
|
||||
'min' => 1,
|
||||
'max' => 3,
|
||||
'step' => 1,
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'max_related_products',
|
||||
'label' => __( 'Max number of Related Products', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '12',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_product_html',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'default' => '<div class="options-title-divider">Custom HTML</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_before_add_to_cart',
|
||||
'label' => __( 'HTML before Add To Cart button', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'html_after_add_to_cart',
|
||||
'label' => __( 'HTML after Add To Cart button', 'flatsome-admin' ),
|
||||
'section' => 'product-page',
|
||||
'sanitize_callback' => 'flatsome_custom_sanitize',
|
||||
'default' => '',
|
||||
) );
|
||||
}
|
||||
add_action( 'init', 'flatsome_customizer_shop_product_page_options' );
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'woocommerce_store_notice_top',
|
||||
'label' => __( 'Move store notice to the top', 'flatsome-admin' ),
|
||||
'section' => 'woocommerce_store_notice',
|
||||
'default' => 0
|
||||
) );
|
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
/*************
|
||||
* Shop Panel
|
||||
*************/
|
||||
|
||||
|
||||
Flatsome_Option::add_panel( 'woocommerce', array(
|
||||
'title' => __( 'WooCommerce', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
include_once(dirname( __FILE__ ).'/options-shop-category.php');
|
||||
include_once(dirname( __FILE__ ).'/options-shop-product-page.php');
|
||||
include_once(dirname( __FILE__ ).'/options-shop-my-account.php');
|
||||
include_once(dirname( __FILE__ ).'/options-shop-cart-checkout.php');
|
||||
include_once(dirname( __FILE__ ).'/options-shop-payments-icons.php');
|
||||
include_once(dirname( __FILE__ ).'/options-shop-store-notice.php');
|
||||
//include_once(dirname( __FILE__ ).'/options-shop-catalog-mode.php');
|
||||
|
||||
function flatsome_refresh_shop_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( 'product-layout', array(
|
||||
'selector' => '.product-container',
|
||||
'settings' => array('product_layout'),
|
||||
'fallback_refresh' => false,
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
wc_get_template_part( 'single-product/layouts/product', get_theme_mod( 'product_layout', flatsome_product_layout() ) );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'shop-header', array(
|
||||
'selector' => '.woocommerce .category-page-title',
|
||||
'fallback_refresh' => false,
|
||||
'settings' => array('html_shop_page','category_title_style','category_show_title','breadcrumb_home','category_filter_text'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
flatsome_category_header();
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'shop-grid', array(
|
||||
'selector' => '.category-page-row',
|
||||
'fallback_refresh' => false,
|
||||
'settings' => array('sale_bubble_text','category_grid_style','short_description_in_grid','cat_style','category_show_count','sale_bubble_percentage_formatting','new_bubble_auto','add_to_cart_style','add_to_cart_icon','product_box_category','product_box_rating','product_hover','bubble_style','grid_style','category_sidebar','products_pr_page','category_row_count','category_row_count_mobile','category_row_count_tablet','category_shadow','category_shadow_hover','equalize_product_box','disable_quick_view'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
wc_get_template_part( 'layouts/category', get_theme_mod( 'category_sidebar', 'left-sidebar' ) );
|
||||
},
|
||||
) );
|
||||
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'account-header', array(
|
||||
'selector' => '.my-account-header',
|
||||
'fallback_refresh' => false,
|
||||
'settings' => array( 'my_account_title_bg_color', 'facebook_login_bg', 'facebook_login_text', 'my_account_title_text_color', 'my_account_title_align' ),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
wc_get_template( 'myaccount/header.php' );
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'html_cart_footer', array(
|
||||
'selector' => '.cart-footer-content',
|
||||
'settings' => array('html_cart_footer'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
flatsome_html_cart_footer();
|
||||
}
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'html_cart_sidebar', array(
|
||||
'selector' => '.cart-sidebar-content',
|
||||
'settings' => array('html_cart_sidebar'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
flatsome_html_cart_sidebar();
|
||||
}
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'html_checkout_sidebar', array(
|
||||
'selector' => '.html-checkout-sidebar',
|
||||
'settings' => array('html_checkout_sidebar'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
flatsome_html_checkout_sidebar();
|
||||
}
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'payment-icons', array(
|
||||
'selector' => '.payment-icons',
|
||||
'settings' => array('payment_icons', 'payment_icons_custom'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
return do_shortcode('[ux_payment_icons]');
|
||||
}
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'refresh_css_shop', array(
|
||||
'selector' => 'head > style#custom-css',
|
||||
'container_inclusive' => true,
|
||||
'settings' => array('category_image_height','color_new_bubble','color_new_bubble_auto','color_checkout','color_sale','color_review','color_regular_price','color_sale_price'),
|
||||
'render_callback' => function() {
|
||||
flatsome_custom_css();
|
||||
},
|
||||
) );
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_shop_partials' );
|
@@ -0,0 +1,293 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Add our controls.
|
||||
*/
|
||||
|
||||
|
||||
function flatsome_social_panels_sections( $wp_customize ) {
|
||||
|
||||
|
||||
$wp_customize->add_section( 'share', array(
|
||||
'title' => __( 'Share', 'flatsome-admin' ),
|
||||
'description' => __( 'This is the default settings for the [share] shortcode and various share icons on the website.', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
$wp_customize->add_section( 'follow', array(
|
||||
'title' => __( 'Follow Icons', 'flatsome-admin' ),
|
||||
'panel' => 'header',
|
||||
'description' => __( 'This is the default settings for the [follow] shortcode and Social Icons header element.', 'flatsome-admin' ),
|
||||
) );
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_social_panels_sections' );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'social_icons_style',
|
||||
'label' => __( 'Share Icons Style', 'flatsome-admin' ),
|
||||
'section' => 'share',
|
||||
'default' => 'outline',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'small' => $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' => 'multicheck',
|
||||
'settings' => 'social_icons',
|
||||
'label' => __( 'Share Icons', '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' => 'share',
|
||||
'transport' => $transport,
|
||||
'default' => array(
|
||||
'facebook',
|
||||
'twitter',
|
||||
'email',
|
||||
'pinterest',
|
||||
'whatsapp',
|
||||
'tumblr'
|
||||
),
|
||||
'choices' => array(
|
||||
"facebook" => "Facebook",
|
||||
"linkedin" => "LinkedIn",
|
||||
"twitter" => "Twitter",
|
||||
"email" => "Email",
|
||||
"pinterest" => "Pinterest",
|
||||
"vk" => "VKontakte",
|
||||
"tumblr" => "Tumblr",
|
||||
"telegram" => "Telegram",
|
||||
"whatsapp" => "WhatsApp (Only for Mobile)",
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'textarea',
|
||||
'settings' => 'custom_share_icons',
|
||||
'label' => __( 'Share Replace', 'flatsome-admin' ),
|
||||
'description' => __( 'Replace Share Icons with Custom Scripts etc.', 'flatsome-admin' ),
|
||||
'section' => 'share',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
|
||||
|
||||
/*************
|
||||
* Social Icons
|
||||
*************/
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'radio-image',
|
||||
'settings' => 'follow_style',
|
||||
'label' => __( 'Icons Style', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'default' => 'small',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'small' => $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' => 'text',
|
||||
'settings' => 'follow_facebook',
|
||||
'label' => __( 'Facebook', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
//'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' => 'follow',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_twitter',
|
||||
'label' => __( 'Twitter', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
//'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' => 'follow',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_pinterest',
|
||||
'label' => __( 'Pinterest', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
'section' => 'follow',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_instagram',
|
||||
'label' => __( 'Instagram', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
//'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' => 'follow',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_tiktok',
|
||||
'label' => __( 'TikTok', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
'section' => 'follow',
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_linkedin',
|
||||
'label' => __( 'LinkedIn', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
//'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' => 'follow',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_youtube',
|
||||
'label' => __( 'YouTube', 'flatsome-admin' ),
|
||||
'transport' => $transport,
|
||||
//'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' => 'follow',
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_vk',
|
||||
'label' => __( 'VKontakte', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_flickr',
|
||||
'label' => __( 'Flickr', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_email',
|
||||
'label' => __( 'E-mail', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_phone',
|
||||
'label' => __( 'Phone', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_rss',
|
||||
'label' => __( 'RSS', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_500px',
|
||||
'label' => __( '500px', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_telegram',
|
||||
'label' => __( 'Telegram', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_twitch',
|
||||
'label' => __( 'Twitch', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'follow_discord',
|
||||
'label' => __( 'Discord', 'flatsome-admin' ),
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'image',
|
||||
'settings' => 'follow_snapchat',
|
||||
'label' => __( 'SnapChat', 'flatsome-admin' ),
|
||||
'description' => 'Upload a Snapcode image here. You can generate it here: https://accounts.snapchat.com/accounts/snapcodes',
|
||||
'section' => 'follow',
|
||||
'transport' => $transport,
|
||||
));
|
||||
|
||||
function flatsome_refresh_social( 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( 'follow_icons', array(
|
||||
'selector' => '.follow-icons',
|
||||
'settings' => array('follow_linkedin','follow_flickr','follow_email','follow_phone','follow_style','follow_facebook','follow_twitter','follow_instagram','follow_tiktok','follow_rss','follow_vk','follow_youtube','follow_pinterest','follow_snapchat','follow_500px','follow_telegram','follow_twitch','follow_discord'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
return do_shortcode('[follow defaults="true" style="'.flatsome_option('follow_style').'"]');
|
||||
},
|
||||
) );
|
||||
|
||||
$wp_customize->selective_refresh->add_partial( 'social_icons', array(
|
||||
'selector' => '.share-icons',
|
||||
'settings' => array('social_icons','social_icons_style'),
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => function() {
|
||||
return do_shortcode('[share]');
|
||||
},
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'flatsome_refresh_social' );
|
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
/**
|
||||
* Style & Colors
|
||||
*/
|
||||
|
||||
Flatsome_Option::add_section( 'colors', array(
|
||||
'title' => __( 'Colors', 'flatsome-admin' ),
|
||||
'panel' => 'style',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_colors_main',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '<div class="options-title-divider">Main Colors</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_primary',
|
||||
'label' => __( 'Primary Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Change primary color.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => Flatsome_Default::COLOR_PRIMARY,
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_secondary',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Secondary Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Change secondary color.', 'flatsome-admin' ),
|
||||
'default' => Flatsome_Default::COLOR_SECONDARY,
|
||||
'section' => 'colors',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_success',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Success Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Change the success color. Used for global success messages.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => Flatsome_Default::COLOR_SUCCESS,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_alert',
|
||||
'transport' => $transport,
|
||||
'label' => __( 'Alert Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Change the alert color. Used for global error messages etc.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => Flatsome_Default::COLOR_ALERT,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_color_type',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '<div class="options-title-divider">Type</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_texts',
|
||||
'label' => __( 'Base Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Used for all normal texts.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '#777',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'type_headings_color',
|
||||
'label' => __( 'Headline Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Used for all headlines on white backgrounds. (H1, H2, H3 etc.)', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '#555',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color-alpha',
|
||||
'settings' => 'color_divider',
|
||||
'label' => __( 'Divider Color', 'flatsome-admin' ),
|
||||
'description' => __( 'Used for dividers.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_type_links',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '<div class="options-title-divider">Links</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_links',
|
||||
'label' => __( 'Link Colors', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '#4e657b',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_links_hover',
|
||||
'label' => __( 'Link Colors :hover', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '#111',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_widget_links',
|
||||
'label' => __( 'Widget Link Colors', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_widget_links_hover',
|
||||
'label' => __( 'Widget Link Colors :hover', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
if ( is_woocommerce_activated() ) {
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_colors_shop',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'default' => '<div class="options-title-divider">Shop Colors</div>',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_checkout',
|
||||
'label' => __( 'Add to cart / Checkout buttons', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color for checkout buttons. Default is Secondary color', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_sale',
|
||||
'label' => __( 'Sale bubble', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color of sale bubble. Default is Secondary color', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_new_bubble_auto',
|
||||
'label' => __( 'New bubble (auto)', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color of the automatic "New" bubble.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_new_bubble',
|
||||
'label' => __( 'Custom bubble', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color of the custom bubble.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_review',
|
||||
'label' => __( 'Review Stars', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color of review stars', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_regular_price',
|
||||
'label' => __( 'Regular Price', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color of the regular price of an on sale product.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'color_sale_price',
|
||||
'label' => __( 'Sale Price', 'flatsome-admin' ),
|
||||
'description' => __( 'Change color of the sale price.', 'flatsome-admin' ),
|
||||
'section' => 'colors',
|
||||
'transport' => $transport,
|
||||
) );
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_panel( 'style', array(
|
||||
'title' => __( 'Style', 'flatsome-admin' ),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_section( 'custom-css', array(
|
||||
'title' => __( 'Custom CSS', 'flatsome-admin' ),
|
||||
'panel' => 'style',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'code',
|
||||
'settings' => 'html_custom_css',
|
||||
'label' => __( 'Custom CSS', 'flatsome-admin' ),
|
||||
'section' => 'custom-css',
|
||||
'transport' => $transport,
|
||||
'placeholder' => '.add-css-here{}',
|
||||
'choices' => array(
|
||||
'language' => 'css',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'code',
|
||||
'settings' => 'html_custom_css_tablet',
|
||||
'label' => __( 'Custom Tablet CSS', 'flatsome-admin' ),
|
||||
'section' => 'custom-css',
|
||||
'default' => '',
|
||||
'placeholder' => '.add-css-here{}',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'language' => 'css',
|
||||
),
|
||||
));
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'code',
|
||||
'settings' => 'html_custom_css_mobile',
|
||||
'label' => __( 'Custom Mobile CSS', 'flatsome-admin' ),
|
||||
'section' => 'custom-css',
|
||||
'default' => '',
|
||||
'placeholder' => '.add-css-here{}',
|
||||
'transport' => $transport,
|
||||
'choices' => array(
|
||||
'language' => 'css',
|
||||
),
|
||||
));
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
|
||||
Flatsome_Option::add_section( 'global-styles', array(
|
||||
'title' => __( 'Global Styles', 'flatsome-admin' ),
|
||||
'panel' => 'style',
|
||||
) );
|
||||
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'text',
|
||||
'settings' => 'button_radius',
|
||||
'label' => __( 'Default Button Radius', 'flatsome-admin' ),
|
||||
'section' => 'global-styles',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
));
|
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'lightbox', array(
|
||||
'title' => __( 'Image Lightbox', 'flatsome-admin' ),
|
||||
'panel' => 'style',
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'flatsome_lightbox',
|
||||
'label' => __( 'Enable Flatsome Lightbox', 'flatsome-admin' ),
|
||||
'section' => 'lightbox',
|
||||
'default' => 1,
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'color',
|
||||
'settings' => 'flatsome_lightbox_bg',
|
||||
'label' => __( 'Lightbox background color', 'flatsome-admin' ),
|
||||
'section' => 'lightbox',
|
||||
'transport' => $transport,
|
||||
'default' => '',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'flatsome_lightbox',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( '', array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_lightbox_gallery_layout',
|
||||
'label' => '',
|
||||
'section' => 'lightbox',
|
||||
'default' => '<div class="options-title-divider">Gallery</div>',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'flatsome_lightbox',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
Flatsome_Option::add_field( 'option', array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'flatsome_lightbox_multi_gallery',
|
||||
'label' => __( 'Use multiple galleries on a page', 'flatsome-admin' ),
|
||||
'description' => __( 'When enabled, lightbox galleries on a page are treated separately, else combined in one gallery.', 'flatsome-admin' ),
|
||||
'section' => 'lightbox',
|
||||
'default' => 0,
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'flatsome_lightbox',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
) );
|
@@ -0,0 +1,329 @@
|
||||
<?php
|
||||
|
||||
Flatsome_Option::add_section( 'type',
|
||||
array(
|
||||
'title' => __( 'Typography', 'flatsome-admin' ),
|
||||
'panel' => 'style',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'settings' => 'disable_fonts',
|
||||
'label' => __( 'Disable Google Fonts. No fonts will be loaded from Google.', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => 0,
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'settings' => 'googlefonts_font_display',
|
||||
'label' => __( 'Google Fonts font-display type', 'flatsome-admin' ),
|
||||
'description' => 'Choose how Google Fonts will be loaded.',
|
||||
'tooltip' => '<ul>
|
||||
<li><span style="font-weight: bold">auto</span> font display strategy is defined by the user agent</li>
|
||||
<li><span style="font-weight: bold">block</span> flash of invisible text until the font loads</li>
|
||||
<li><span style="font-weight: bold">swap</span> fallback font until custom font loads (flash of unstyled text)</li>
|
||||
<li><span style="font-weight: bold">fallback</span> between block and swap, invisible text for a short time</li>
|
||||
<li><span style="font-weight: bold">optional</span> like fallback, but the browser can decide to not use the custom font</li>
|
||||
</ul>',
|
||||
'section' => 'type',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
'default' => 'swap',
|
||||
'choices' => array(
|
||||
'auto' => __( 'Auto', 'flatsome-admin' ),
|
||||
'block' => __( 'Block', 'flatsome-admin' ),
|
||||
'swap' => __( 'Swap', 'flatsome-admin' ),
|
||||
'fallback' => __( 'Fallback', 'flatsome-admin' ),
|
||||
'optional' => __( 'Optional', 'flatsome-admin' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_type_headings',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '<div class="options-title-divider">Headlines</div>',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'typography',
|
||||
'settings' => 'type_headings',
|
||||
'description' => 'This is the font for all H1, H2, H3, H5, H6 titles.',
|
||||
'label' => esc_attr__( 'Font', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => array(
|
||||
'font-family' => 'Lato',
|
||||
'variant' => '700',
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_type_base',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '<div class="options-title-divider">Base</div>',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'typography',
|
||||
'settings' => 'type_texts',
|
||||
'label' => esc_attr__( 'Base Text Font', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => array(
|
||||
'font-family' => 'Lato',
|
||||
'variant' => '400',
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'type_size',
|
||||
'label' => __( 'Base Font Size', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'description' => 'Set base font size in %.',
|
||||
'default' => 100,
|
||||
'choices' => array(
|
||||
'min' => 50,
|
||||
'max' => 200,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'slider',
|
||||
'settings' => 'type_size_mobile',
|
||||
'label' => __( 'Mobile Base Font Size', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'description' => 'Set mobile base font size in %.',
|
||||
'default' => 100,
|
||||
'choices' => array(
|
||||
'min' => 50,
|
||||
'max' => 200,
|
||||
'step' => 1,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_type_nav',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '<div class="options-title-divider">Navigation</div>',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'typography',
|
||||
'settings' => 'type_nav',
|
||||
'label' => esc_attr__( 'Font', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => array(
|
||||
'font-family' => 'Lato',
|
||||
'variant' => '700',
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_type_alt',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '<div class="options-title-divider">Alt Fonts</div>',
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'typography',
|
||||
'settings' => 'type_alt',
|
||||
'description' => 'Alt font can be selected in the Format dropdown in Text Editor.',
|
||||
'label' => esc_attr__( 'Alt font (.alt-font)', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => array(
|
||||
'font-family' => 'Dancing Script',
|
||||
'variant' => '400',
|
||||
),
|
||||
'active_callback' => array(
|
||||
array(
|
||||
'setting' => 'disable_fonts',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( '',
|
||||
array(
|
||||
'type' => 'custom',
|
||||
'settings' => 'custom_title_type_transform',
|
||||
'label' => __( '', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '<div class="options-title-divider">Text Transforms</div>',
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'text_transform_breadcrumbs',
|
||||
'label' => esc_attr__( 'Breadcrumbs', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'UPPERCASE',
|
||||
'none' => 'Normal',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'text_transform_buttons',
|
||||
'label' => esc_attr__( 'Buttons', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'UPPERCASE',
|
||||
'none' => 'Normal',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'text_transform_navigation',
|
||||
'label' => esc_attr__( 'Navigation / Tabs', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'UPPERCASE',
|
||||
'none' => 'Normal',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'text_transform_section_titles',
|
||||
'label' => esc_attr__( 'Section Titles', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'UPPERCASE',
|
||||
'none' => 'Normal',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Flatsome_Option::add_field( 'option',
|
||||
array(
|
||||
'type' => 'radio-buttonset',
|
||||
'settings' => 'text_transform_widget_titles',
|
||||
'label' => esc_attr__( 'Widget Titles', 'flatsome-admin' ),
|
||||
'section' => 'type',
|
||||
'default' => '',
|
||||
'choices' => array(
|
||||
'' => 'UPPERCASE',
|
||||
'none' => 'Normal',
|
||||
),
|
||||
)
|
||||
);
|