/**
* Avada Options.
*
* @author ThemeFusion
* @copyright (c) Copyright by ThemeFusion
* @link http://theme-fusion.com
* @package Avada
* @subpackage Core
* @since 4.0.0
*/
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
/**
* Advanced settings
*
* @param array $sections An array of our sections.
* @return array
*/
function avada_options_section_advanced( $sections ) {
$sections['advanced'] = array(
'label' => esc_html__( 'Advanced', 'Avada' ),
'id' => 'heading_advanced',
'is_panel' => true,
'priority' => 25,
'icon' => 'el-icon-puzzle',
'fields' => array(
'tracking_head_body_section' => array(
'label' => esc_html__( 'Code Fields (Tracking etc.)', 'Avada' ),
'id' => 'tracking_head_body_section',
'icon' => true,
'type' => 'sub-section',
'fields' => array(
'google_analytics' => array(
'label' => esc_html__( 'Tracking Code', 'Avada' ),
'description' => esc_html__( 'Paste your tracking code here. This will be added into the header template of your theme. Place code inside <script> tags.', 'Avada' ),
'id' => 'google_analytics',
'default' => '',
'type' => 'code',
'choices' => array(
'language' => 'html',
'height' => 300,
'theme' => 'chrome',
),
),
'space_head' => array(
'label' => esc_html__( 'Space before </head>', 'Avada' ),
'description' => esc_html__( 'Only accepts javascript code wrapped with <script> tags and HTML markup that is valid inside the </head> tag.', 'Avada' ),
'id' => 'space_head',
'default' => '',
'type' => 'code',
'choices' => array(
'language' => 'html',
'height' => 350,
'theme' => 'chrome',
),
),
'space_body' => array(
'label' => esc_html__( 'Space before </body>', 'Avada' ),
'description' => esc_html__( 'Only accepts javascript code, wrapped with <script> tags and valid HTML markup inside the </body> tag.', 'Avada' ),
'id' => 'space_body',
'default' => '',
'type' => 'code',
'choices' => array(
'language' => 'html',
'height' => 350,
'theme' => 'chrome',
),
),
),
),
'theme_features_section' => array(
'label' => esc_html__( 'Theme Features', 'Avada' ),
'id' => 'theme_features_section',
'icon' => true,
'type' => 'sub-section',
'fields' => array(
'dependencies_status' => array(
'label' => esc_attr__( "Avada's Option Network Dependencies", 'Avada' ),
'description' => esc_html__( "Avada's Option Network consists of Fusion Theme Options, Page Options, Builder options and each of them have dependent options ON by default. This means the only options you see are the only ones currently available for your selection. However, if you wish to disable this feature, simply turn this option off, and all dependencies will be disabled (requires save & refresh).", 'Avada' ),
'id' => 'dependencies_status',
'default' => '1',
'type' => 'switch',
),
'pw_jpeg_quality' => array(
'label' => esc_html__( 'WordPress jpeg Quality', 'Avada' ),
/* translators: "Regenerate Thumbnails" plugin link. */
'description' => sprintf( esc_html__( 'Controls the quality of the generated image sizes for every uploaded image. Ranges between 0 and 100 percent. Higher values lead to better image qualities but also higher file sizes. NOTE: After changing this value, please install and run the %s plugin once.', 'Avada' ), '' . esc_html__( 'Regenerate Thumbnails', 'Avada' ) . '' ),
'id' => 'pw_jpeg_quality',
'default' => '82',
'type' => 'slider',
'choices' => array(
'min' => '1',
'max' => '100',
'step' => '1',
),
),
'smooth_scrolling' => array(
'label' => esc_html__( 'Smooth Scrolling', 'Avada' ),
'description' => esc_html__( 'Turn on to enable smooth scrolling. This will replace default browser scrollbar with a dark scrollbar.', 'Avada' ),
'id' => 'smooth_scrolling',
'default' => '0',
'type' => 'switch',
),
'disable_code_block_encoding' => array(
'label' => esc_html__( 'Code Block Encoding', 'Avada' ),
'description' => esc_html__( 'Turn on to enable encoding in the Fusion Builder code block element.', 'Avada' ),
'id' => 'disable_code_block_encoding',
'default' => '1',
'type' => 'switch',
),
'disable_megamenu' => array(
'label' => esc_html__( 'Mega Menu', 'Avada' ),
'description' => esc_html__( 'Turn on to enable Avada\'s mega menu.', 'Avada' ),
'id' => 'disable_megamenu',
'default' => '1',
'type' => 'switch',
),
'avada_rev_styles' => array(
'label' => esc_html__( 'Avada Styles For Revolution Slider', 'Avada' ),
'description' => esc_html__( 'Turn on to enable the Avada styles and use the default Revolution Slider styles.', 'Avada' ),
'id' => 'avada_rev_styles',
'default' => '1',
'type' => 'switch',
),
'avada_styles_dropdowns' => array(
'label' => esc_html__( 'Avada Dropdown Styles', 'Avada' ),
'description' => esc_html__( 'Turn on to enable the Avada styles for dropdown/select fields site wide. This should be done if you experience any issues with 3rd party plugin dropdowns.', 'Avada' ),
'id' => 'avada_styles_dropdowns',
'default' => '1',
'type' => 'switch',
),
'use_animate_css' => array(
'label' => esc_html__( 'CSS Animations', 'Avada' ),
'description' => esc_html__( 'Turn on to enable CSS animations on elements.', 'Avada' ),
'id' => 'use_animate_css',
'default' => '1',
'type' => 'switch',
),
'disable_mobile_animate_css' => array(
'label' => esc_html__( 'CSS Animations on Mobiles', 'Avada' ),
'description' => esc_html__( 'Turn on to enable CSS animations on mobiles.', 'Avada' ),
'id' => 'disable_mobile_animate_css',
'default' => '0',
'type' => 'switch',
),
'disable_mobile_image_hovers' => array(
'label' => esc_html__( 'CSS Image Hover Animations on Mobiles', 'Avada' ),
'description' => esc_html__( 'Turn on to enable CSS image hover animations on mobiles.', 'Avada' ),
'id' => 'disable_mobile_image_hovers',
'default' => '1',
'type' => 'switch',
),
'status_yt' => array(
'label' => esc_html__( 'Youtube API Scripts', 'Avada' ),
'description' => esc_html__( 'Turn on to enable Youtube API scripts.', 'Avada' ),
'id' => 'status_yt',
'default' => '1',
'type' => 'switch',
),
'status_vimeo' => array(
'label' => esc_html__( 'Vimeo API Scripts', 'Avada' ),
'description' => esc_html__( 'Turn on to enable Vimeo API scripts.', 'Avada' ),
'id' => 'status_vimeo',
'default' => '1',
'type' => 'switch',
),
'status_gmap' => array(
'label' => esc_html__( 'Google Map Scripts', 'Avada' ),
'description' => esc_html__( 'Turn on to enable google map.', 'Avada' ),
'id' => 'status_gmap',
'default' => '1',
'type' => 'switch',
),
'status_totop' => array(
'label' => esc_html__( 'ToTop Script', 'Avada' ),
'description' => esc_html__( 'Turn on to enable the ToTop script which adds the scrolling to top functionality.', 'Avada' ),
'id' => 'status_totop',
'default' => '1',
'type' => 'switch',
),
'status_totop_mobile' => array(
'label' => esc_html__( 'ToTop Script on mobile', 'Avada' ),
'description' => esc_html__( 'Turn on to enable the ToTop script on mobile devices.', 'Avada' ),
'id' => 'status_totop_mobile',
'default' => '0',
'type' => 'switch',
),
'status_fusion_slider' => array(
'label' => esc_html__( 'Fusion Slider', 'Avada' ),
'description' => esc_html__( 'Turn on to enable the fusion slider.', 'Avada' ),
'id' => 'status_fusion_slider',
'default' => '1',
'type' => 'switch',
),
'status_eslider' => array(
'label' => esc_html__( 'Elastic Slider', 'Avada' ),
'description' => esc_html__( 'Turn on to enable the elastic slider.', 'Avada' ),
'id' => 'status_eslider',
'default' => '1',
'type' => 'switch',
),
'status_fontawesome' => array(
'label' => esc_html__( 'FontAwesome', 'Avada' ),
'description' => esc_html__( 'Turn on to enable font awesome icons.', 'Avada' ),
'id' => 'status_fontawesome',
'default' => '1',
'type' => 'switch',
),
'status_opengraph' => array(
'label' => esc_html__( 'Open Graph Meta Tags', 'Avada' ),
'description' => esc_html__( 'Turn on to enable open graph meta tags which is mainly used when sharing pages on social networking sites like Facebook.', 'Avada' ),
'id' => 'status_opengraph',
'default' => '1',
'type' => 'switch',
),
'disable_date_rich_snippet_pages' => array(
'label' => esc_html__( 'Rich Snippets', 'Avada' ),
'description' => esc_html__( 'Turn on to enable rich snippets data site wide. If set to "On", you can also control individual items below. If set to "Off" all items will be disabled.', 'Avada' ),
'id' => 'disable_date_rich_snippet_pages',
'default' => '1',
'type' => 'switch',
),
'disable_rich_snippet_title' => array(
'label' => esc_html__( 'Rich Snippets Title', 'Avada' ),
'description' => esc_html__( 'Turn on to enable title rich snippet data site wide.', 'Avada' ),
'id' => 'disable_rich_snippet_title',
'default' => '1',
'type' => 'switch',
'required' => array(
array(
'setting' => 'disable_date_rich_snippet_pages',
'operator' => '==',
'value' => '1',
),
),
),
'disable_rich_snippet_author' => array(
'label' => esc_html__( 'Rich Snippets Author Info', 'Avada' ),
'description' => esc_html__( 'Turn on to enable author rich snippet data site wide.', 'Avada' ),
'id' => 'disable_rich_snippet_author',
'default' => '1',
'type' => 'switch',
'required' => array(
array(
'setting' => 'disable_date_rich_snippet_pages',
'operator' => '==',
'value' => '1',
),
),
),
'disable_rich_snippet_date' => array(
'label' => esc_html__( 'Rich Snippets Publish Date', 'Avada' ),
'description' => esc_html__( 'Turn on to enable date rich snippet data site wide.', 'Avada' ),
'id' => 'disable_rich_snippet_date',
'default' => '1',
'type' => 'switch',
'required' => array(
array(
'setting' => 'disable_date_rich_snippet_pages',
'operator' => '==',
'value' => '1',
),
),
),
),
),
'dynamic_compiler_section' => array(
'label' => esc_html__( 'Dynamic CSS & JS', 'Avada' ),
'id' => 'dynamic_compiler_section',
'icon' => true,
'type' => 'sub-section',
'fields' => array(
'css_cache_method' => array(
'label' => esc_html__( 'CSS Compiling method', 'Avada' ),
'description' => esc_html__( 'Select "File" mode to compile the dynamic CSS to files (a separate file will be created for each of your pages & posts inside of the uploads/fusion-styles folder), "Database" mode to cache the CSS in your database, or select "Disabled" to disable.', 'Avada' ),
'id' => 'css_cache_method',
'default' => 'file',
'type' => 'radio-buttonset',
'choices' => array(
'file' => esc_attr__( 'File', 'Avada' ),
'db' => esc_attr__( 'Database', 'Avada' ),
'off' => esc_attr__( 'Disabled', 'Avada' ),
),
),
'cache_server_ip' => array(
'label' => esc_html__( 'Cache Server IP', 'Avada' ),
'description' => esc_html__( 'For unique cases where you are using cloud flare and a cache server, ex: varnish cache. Enter your cache server IP to clear the theme options dynamic CSS cache. Consult with your server admin for help.', 'Avada' ),
'id' => 'cache_server_ip',
'default' => '',
'type' => 'text',
),
'js_compiler_note' => ( 'no' != get_transient( 'fusion_dynamic_js_readable' ) ) ? array() : array(
'label' => '',
'description' => '
' . __( 'IMPORTANT NOTE: JS Compiler is disabled. File does not exist or access is restricted.', 'Avada' ) . '
',
'id' => 'js_compiler_note',
'type' => 'custom',
),
'js_compiler' => array(
'label' => esc_html__( 'Enable JS Compiler', 'Avada' ),
'description' => ( Fusion_Dynamic_JS::is_http2() ) ? esc_html__( 'We have detected that your server supports HTTP/2. We recommend you leave the compiler disabled as that will improve performance of your site by allowing multiple JS files to be downloaded simultaneously.', 'Avada' ) : esc_html__( 'By default all the javascript files are combined. Disabling the JS compiler will load non-combined javascript files. This will have an impact on the performance of your site.', 'Avada' ),
'id' => 'js_compiler',
'default' => ( Fusion_Dynamic_JS::is_http2() ) ? '0' : '1',
'type' => 'switch',
),
'reset_caches_button' => array(
'label' => esc_html__( 'Reset Fusion Caches', 'Avada' ),
/* translators: %1$s: uploads/fusion-styles. %2$s: uploads/fusion-scripts. */
'description' => ( is_multisite() && is_main_site() ) ? sprintf( esc_html__( 'Resets all Dynamic CSS & Dynamic JS, cleans-up the database and deletes the %1$s and %2$s folders. When resetting the caches on the main site of a multisite installation, caches for all sub-sites will be reset. IMPORTANT NOTE: On large multisite installations with a low PHP timeout setting, bulk-resetting the caches may timeout.', 'Avada' ), 'uploads/fusion-styles', 'uploads/fusion-scripts' ) : sprintf( esc_html__( 'Resets all Dynamic CSS & Dynamic JS, cleans-up the database and deletes the %1$s and %2$s folders.', 'Avada' ), 'uploads/fusion-styles', 'uploads/fusion-scripts' ),
'id' => 'reset_caches_button',
'default' => '',
'type' => 'raw',
'content' => '' . esc_attr__( 'Reset Fusion Caches', 'Avada' ) . '',
'full_width' => false,
),
),
),
),
);
return $sections;
}
if ( fusion_is_element_enabled( 'fusion_separator' ) ) {
if ( ! class_exists( 'FusionSC_Separator' ) ) {
/**
* Shortcode class.
*
* @package fusion-builder
* @since 1.0
*/
class FusionSC_Separator extends Fusion_Element {
/**
* An array of the shortcode arguments.
*
* @access protected
* @since 1.0
* @var array
*/
protected $args;
/**
* Constructor.
*
* @access public
* @since 1.0
*/
public function __construct() {
parent::__construct();
add_filter( 'fusion_attr_separator-shortcode', array( $this, 'attr' ) );
add_filter( 'fusion_attr_separator-shortcode-icon-wrapper', array( $this, 'icon_wrapper_attr' ) );
add_filter( 'fusion_attr_separator-shortcode-icon', array( $this, 'icon_attr' ) );
add_shortcode( 'fusion_separator', array( $this, 'render' ) );
}
/**
* Render the shortcode
*
* @access public
* @since 1.0
* @param array $args Shortcode parameters.
* @param string $content Content between shortcode.
* @return string HTML output.
*/
public function render( $args, $content = '' ) {
global $fusion_settings;
$defaults = FusionBuilder::set_shortcode_defaults(
array(
'hide_on_mobile' => fusion_builder_default_visibility( 'string' ),
'class' => '',
'id' => '',
'alignment' => 'center',
'bottom_margin' => '',
'border_size' => $fusion_settings->get( 'separator_border_size' ),
'icon' => '',
'icon_circle' => $fusion_settings->get( 'separator_circle' ),
'icon_circle_color' => $fusion_settings->get( 'separator_circle_bg_color' ),
'sep_color' => $fusion_settings->get( 'sep_color' ),
'style_type' => 'none',
'top_margin' => '',
'width' => '',
'bottom' => '', // Deprecated.
'color' => '', // Deprecated.
'style' => '', // Deprecated.
'top' => '', // Deprecated.
), $args
);
$defaults['border_size'] = FusionBuilder::validate_shortcode_attr_value( $defaults['border_size'], 'px' );
$defaults['width'] = FusionBuilder::validate_shortcode_attr_value( $defaults['width'], 'px' );
$defaults['top_margin'] = FusionBuilder::validate_shortcode_attr_value( $defaults['top_margin'], 'px' );
$defaults['bottom_margin'] = FusionBuilder::validate_shortcode_attr_value( $defaults['bottom_margin'], 'px' );
if ( '0' === $defaults['icon_circle'] ) {
$defaults['icon_circle'] = 'no';
}
if ( $defaults['style'] ) {
$defaults['style_type'] = $defaults['style'];
} elseif ( 'default' === $defaults['style_type'] ) {
$defaults['style_type'] = $fusion_settings->get( 'separator_style_type' );
}
extract( $defaults );
$this->args = $defaults;
$this->args['style_type'] = str_replace( ' ', '|', $style_type );
if ( $bottom ) {
$this->args['bottom_margin'] = FusionBuilder::validate_shortcode_attr_value( $bottom, 'px' );
}
if ( $color ) {
$this->args['sep_color'] = $color;
}
if ( $top ) {
$this->args['top_margin'] = FusionBuilder::validate_shortcode_attr_value( $top, 'px' );
if ( ! $bottom && 'none' != $defaults['style'] ) {
$this->args['bottom_margin'] = FusionBuilder::validate_shortcode_attr_value( $top, 'px' );
}
}
$icon_insert = '';
if ( $icon && 'none' !== $style_type ) {
$icon_insert = '';
}
$html = '' . $icon_insert . '
';
if ( 'right' === $this->args['alignment'] ) {
$html .= '';
}
return $html;
}
/**
* Builds the attributes array.
*
* @access public
* @since 1.0
* @return array
*/
public function attr() {
$attr = fusion_builder_visibility_atts(
$this->args['hide_on_mobile'], array(
'class' => 'fusion-separator',
'style' => '',
)
);
if ( ! $this->args['width'] || '100%' == $this->args['width'] ) {
$attr['class'] .= ' fusion-full-width-sep';
}
$styles = explode( '|', $this->args['style_type'] );
if ( ! in_array( 'none', $styles ) && ! in_array( 'single', $styles ) && ! in_array( 'double', $styles ) && ! in_array( 'shadow', $styles ) ) {
$styles[] .= 'single';
}
foreach ( $styles as $style ) {
$attr['class'] .= ' sep-' . $style;
}
if ( $this->args['sep_color'] ) {
if ( 'shadow' === $this->args['style_type'] ) {
$shadow = 'background:radial-gradient(ellipse at 50% -50% , ' . $this->args['sep_color'] . ' 0px, rgba(255, 255, 255, 0) 80%) repeat scroll 0 0 rgba(0, 0, 0, 0);';
$attr['style'] = $shadow;
$attr['style'] .= str_replace( 'radial-gradient', '-webkit-radial-gradient', $shadow );
$attr['style'] .= str_replace( 'radial-gradient', '-moz-radial-gradient', $shadow );
$attr['style'] .= str_replace( 'radial-gradient', '-o-radial-gradient', $shadow );
} elseif ( 'none' !== $this->args['style_type'] ) {
$attr['style'] = 'border-color:' . $this->args['sep_color'] . ';';
}
}
if ( in_array( 'single', $styles ) ) {
$attr['style'] .= 'border-top-width:' . $this->args['border_size'] . ';';
}
if ( in_array( 'double', $styles ) ) {
$attr['style'] .= 'border-top-width:' . $this->args['border_size'] . ';border-bottom-width:' . $this->args['border_size'] . ';';
}
if ( 'center' === $this->args['alignment'] ) {
$attr['style'] .= 'margin-left: auto;margin-right: auto;';
} elseif ( 'right' === $this->args['alignment'] ) {
$attr['style'] .= 'float:right;';
$attr['class'] .= ' fusion-clearfix';
}
$attr['style'] .= 'margin-top:' . $this->args['top_margin'] . ';';
if ( $this->args['bottom_margin'] ) {
$attr['style'] .= 'margin-bottom:' . $this->args['bottom_margin'] . ';';
}
if ( $this->args['width'] ) {
$attr['style'] .= 'width:100%;max-width:' . $this->args['width'] . ';';
}
if ( $this->args['class'] ) {
$attr['class'] .= ' ' . $this->args['class'];
}
if ( $this->args['id'] ) {
$attr['id'] = $this->args['id'];
}
return $attr;
}
/**
* Builds the icon-wrapper attributes array.
*
* @access public
* @since 1.0
* @return array
*/
public function icon_wrapper_attr() {
$attr = array(
'class' => 'icon-wrapper',
);
$circle_color = $this->args['sep_color'];
if ( 'no' === $this->args['icon_circle'] ) {
$circle_color = 'transparent';
}
$attr['style'] = 'border-color:' . $circle_color . ';';
if ( $this->args['icon_circle_color'] && 'no' !== $this->args['icon_circle'] ) {
$attr['style'] .= 'background-color:' . $this->args['icon_circle_color'] . ';';
}
return $attr;
}
/**
* Builds the icon attributes array.
*
* @access public
* @since 1.0
* @return array
*/
public function icon_attr() {
return array(
'class' => 'fa ' . FusionBuilder::font_awesome_name_handler( $this->args['icon'] ),
'style' => 'color:' . $this->args['sep_color'] . ';',
);
}
/**
* Builds the dynamic styling.
*
* @access public
* @since 1.1
* @return array
*/
public function add_styling() {
global $wp_version, $content_media_query, $six_fourty_media_query, $three_twenty_six_fourty_media_query, $ipad_portrait_media_query, $fusion_library, $fusion_settings, $dynamic_css_helpers;
$main_elements = apply_filters( 'fusion_builder_element_classes', array( '.fusion-separator' ), '.fusion-separator' );
$elements = array_merge(
$dynamic_css_helpers->map_selector( $main_elements, '.sep-single' ),
$dynamic_css_helpers->map_selector( $main_elements, '.sep-double' ),
$dynamic_css_helpers->map_selector( $main_elements, '.sep-dashed' ),
$dynamic_css_helpers->map_selector( $main_elements, '.sep-dotted' )
);
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-color'] = $fusion_library->sanitize->color( $fusion_settings->get( 'sep_color' ) );
// Content separator for blog.
$elements = apply_filters( 'fusion_builder_element_classes', array( '.fusion-body .fusion-content-sep:not([class*="sep-"])' ), '.fusion-body .fusion-content-sep' );
$separator_style_type = $fusion_settings->get( 'separator_style_type' );
$separator_border_size = $fusion_settings->get( 'separator_border_size' ) . 'px';
if ( false !== strpos( $separator_style_type, 'none' ) ) {
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['display'] = 'none';
} else if ( false !== strpos( $separator_style_type, 'single' ) ) {
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['height'] = 'auto';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-bottom'] = 'none';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-top-width'] = $separator_border_size;
} else if ( false !== strpos( $separator_style_type, 'double' ) ) {
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-top-width'] = $separator_border_size;
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-bottom-width'] = $separator_border_size;
} else if ( false !== strpos( $separator_style_type, 'shadow' ) ) {
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['height'] = '1px';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-top'] = 'none';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['border-bottom'] = 'none';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['background'] = sprintf( '-webkit-radial-gradient(ellipse at 50%% -50%% , %s 0px, rgba(255, 255, 255, 0) 80%%) repeat scroll 0 0 rgba(0, 0, 0, 0)', $fusion_settings->get( 'sep_color' ) );
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['background'] = sprintf( 'radial-gradient(ellipse at 50%% -50%% , %s 0px, rgba(255, 255, 255, 0) 80%%) repeat scroll 0 0 rgba(0, 0, 0, 0)', $fusion_settings->get( 'sep_color' ) );
$elements = $dynamic_css_helpers->map_selector( $elements, ':after' );
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['display'] = 'block';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['content'] = '""';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['margin-top'] = '10px';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['height'] = '6px';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['width'] = '100%';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['background'] = '-webkit-radial-gradient(ellipse at 50% -50% , rgba(0, 0, 0, 0.5) 0px, rgba(255, 255, 255, 0) 65%);';
$css['global'][ $dynamic_css_helpers->implode( $elements ) ]['background'] = 'radial-gradient(ellipse at 50% -50% , rgba(0, 0, 0, 0.5) 0px, rgba(255, 255, 255, 0) 65%);';
}
return $css;
}
/**
* Adds settings to element options panel.
*
* @access public
* @since 1.1
* @return array $sections Separator settings.
*/
public function add_options() {
return array(
'separator_shortcode_section' => array(
'label' => esc_html__( 'Separator Element', 'fusion-builder' ),
'description' => '',
'id' => 'separator_shortcode_section',
'type' => 'accordion',
'fields' => array(
'style_type' => array(
'label' => esc_html__( 'Separator Style', 'fusion-builder' ),
'description' => esc_html__( 'Controls the line style of all separators, divider lines on portfolio archives, blog archives, product archives and more.', 'fusion-builder' ),
'id' => 'separator_style_type',
'default' => 'double',
'type' => 'select',
'choices' => array(
'none' => esc_attr__( 'No Style', 'fusion-builder' ),
'single' => esc_attr__( 'Single Border Solid', 'fusion-builder' ),
'double' => esc_attr__( 'Double Border Solid', 'fusion-builder' ),
'single|dashed' => esc_attr__( 'Single Border Dashed', 'fusion-builder' ),
'double|dashed' => esc_attr__( 'Double Border Dashed', 'fusion-builder' ),
'single|dotted' => esc_attr__( 'Single Border Dotted', 'fusion-builder' ),
'double|dotted' => esc_attr__( 'Double Border Dotted', 'fusion-builder' ),
'shadow' => esc_attr__( 'Shadow', 'fusion-builder' ),
),
),
'sep_color' => array(
'label' => esc_html__( 'Separator Color', 'fusion-builder' ),
'description' => esc_html__( 'Controls the color of all separators, divider lines and borders for meta, previous & next, filters, archive pages, boxes around number pagination, sidebar widgets, accordion divider lines, counter boxes and more.', 'fusion-builder' ),
'id' => 'sep_color',
'default' => '#e0dede',
'type' => 'color-alpha',
),
'separator_border_size' => array(
'label' => esc_html__( 'Border Size', 'fusion-builder' ),
'description' => esc_html__( 'Controls the border size of the separator.', 'fusion-builder' ),
'id' => 'separator_border_size',
'default' => '1',
'type' => 'slider',
'choices' => array(
'min' => '0',
'max' => '50',
'step' => '1',
),
),
'separator_circle' => array(
'label' => esc_html__( 'Separator Circle', 'fusion-builder' ),
'description' => esc_html__( 'Turn on if you want to display a circle around the separator icon.', 'fusion-builder' ),
'id' => 'separator_circle',
'default' => '1',
'type' => 'switch',
),
'separator_circle_bg_color' => array(
'label' => esc_html__( 'Circle Color', 'fusion-builder' ),
'description' => esc_html__( 'Controls the background color of the circle around the icon.', 'fusion-builder' ),
'id' => 'separator_circle_bg_color',
'default' => 'rgba(255,255,255,0)',
'type' => 'color-alpha',
'required' => array(
array(
'setting' => 'separator_circle',
'operator' => '==',
'value' => '1',
),
),
),
),
),
);
return $sections;
}
}
}
new FusionSC_Separator();
}
/**
* Map shortcode to Fusion Builder.
*
* @since 1.0
*/
function fusion_element_separator() {
global $fusion_settings;
fusion_builder_map(
array(
'name' => esc_attr__( 'Separator', 'fusion-builder' ),
'shortcode' => 'fusion_separator',
'icon' => 'fusiona-minus',
'preview' => FUSION_BUILDER_PLUGIN_DIR . 'inc/templates/previews/fusion-separator-preview.php',
'preview_id' => 'fusion-builder-block-module-separator-preview-template',
'params' => array(
array(
'type' => 'select',
'heading' => esc_attr__( 'Style', 'fusion-builder' ),
'description' => esc_attr__( 'Choose the separator line style.', 'fusion-builder' ),
'param_name' => 'style_type',
'value' => array(
'default' => esc_attr__( 'Default', 'fusion-builder' ),
'none' => esc_attr__( 'No Style', 'fusion-builder' ),
'single solid' => esc_attr__( 'Single Border Solid', 'fusion-builder' ),
'double solid' => esc_attr__( 'Double Border Solid', 'fusion-builder' ),
'single|dashed' => esc_attr__( 'Single Border Dashed', 'fusion-builder' ),
'double|dashed' => esc_attr__( 'Double Border Dashed', 'fusion-builder' ),
'single|dotted' => esc_attr__( 'Single Border Dotted', 'fusion-builder' ),
'double|dotted' => esc_attr__( 'Double Border Dotted', 'fusion-builder' ),
'shadow' => esc_attr__( 'Shadow', 'fusion-builder' ),
),
'default' => 'default',
),
array(
'type' => 'colorpickeralpha',
'heading' => esc_attr__( 'Separator Color', 'fusion-builder' ),
'description' => esc_attr__( 'Controls the separator color.', 'fusion-builder' ),
'param_name' => 'sep_color',
'value' => '',
'default' => $fusion_settings->get( 'sep_color' ),
'group' => esc_attr__( 'Design', 'fusion-builder' ),
),
array(
'type' => 'dimension',
'remove_from_atts' => true,
'heading' => esc_attr__( 'Margin', 'fusion-builder' ),
'param_name' => 'dimensions',
'value' => array(
'top_margin' => '',
'bottom_margin' => '',
),
'description' => esc_attr__( 'Spacing above and below the separator. In px, em or %, e.g. 10px.', 'fusion-builder' ),
'group' => esc_attr__( 'Design', 'fusion-builder' ),
),
array(
'type' => 'range',
'heading' => esc_attr__( 'Border Size', 'fusion-builder' ),
'param_name' => 'border_size',
'value' => '',
'min' => '0',
'max' => '50',
'step' => '1',
'default' => $fusion_settings->get( 'separator_border_size' ),
'description' => esc_attr__( 'In pixels. ', 'fusion-builder' ),
'group' => esc_attr__( 'Design', 'fusion-builder' ),
),
array(
'type' => 'iconpicker',
'heading' => esc_attr__( 'Select Icon', 'fusion-builder' ),
'param_name' => 'icon',
'value' => '',
'description' => esc_attr__( 'Click an icon to select, click again to deselect.', 'fusion-builder' ),
'group' => esc_attr__( 'Design', 'fusion-builder' ),
),
array(
'type' => 'radio_button_set',
'heading' => esc_attr__( 'Circled Icon', 'fusion-builder' ),
'description' => esc_attr__( 'Choose to have a circle in separator color around the icon.', 'fusion-builder' ),
'param_name' => 'icon_circle',
'value' => array(
'' => esc_attr__( 'Default', 'fusion-builder' ),
'yes' => esc_attr__( 'Yes', 'fusion-builder' ),
'no' => esc_attr__( 'No', 'fusion-builder' ),
),
'default' => '',
'group' => esc_attr__( 'Design', 'fusion-builder' ),
'dependency' => array(
array(
'element' => 'icon',
'value' => '',
'operator' => '!=',
),
),
),
array(
'type' => 'colorpickeralpha',
'heading' => esc_attr__( 'Circle Color', 'fusion-builder' ),
'description' => esc_attr__( 'Controls the background color of the circle around the icon.', 'fusion-builder' ),
'param_name' => 'icon_circle_color',
'value' => '',
'default' => $fusion_settings->get( 'separator_circle_bg_color' ),
'group' => esc_attr__( 'Design', 'fusion-builder' ),
'dependency' => array(
array(
'element' => 'icon',
'value' => '',
'operator' => '!=',
),
array(
'element' => 'icon_circle',
'value' => 'no',
'operator' => '!=',
),
),
),
array(
'type' => 'dimension',
'remove_from_atts' => true,
'heading' => esc_attr__( 'Separator Width', 'fusion-builder' ),
'param_name' => 'dimensions_width',
'value' => array(
'width' => '',
),
'description' => esc_attr__( 'In pixels (px or %), ex: 1px, ex: 50%. Leave blank for full width.', 'fusion-builder' ),
'group' => esc_attr__( 'Design', 'fusion-builder' ),
),
array(
'type' => 'radio_button_set',
'heading' => esc_attr__( 'Alignment', 'fusion-builder' ),
'description' => esc_attr__( 'Select the separator alignment; only works when a width is specified.', 'fusion-builder' ),
'param_name' => 'alignment',
'value' => array(
'center' => esc_attr__( 'Center', 'fusion-builder' ),
'left' => esc_attr__( 'Left', 'fusion-builder' ),
'right' => esc_attr__( 'Right', 'fusion-builder' ),
),
'default' => 'center',
'group' => esc_attr__( 'Design', 'fusion-builder' ),
),
array(
'type' => 'checkbox_button_set',
'heading' => esc_attr__( 'Element Visibility', 'fusion-builder' ),
'param_name' => 'hide_on_mobile',
'value' => fusion_builder_visibility_options( 'full' ),
'default' => fusion_builder_default_visibility( 'array' ),
'description' => esc_attr__( 'Choose to show or hide the element on small, medium or large screens. You can choose more than one at a time.', 'fusion-builder' ),
),
array(
'type' => 'textfield',
'heading' => esc_attr__( 'CSS Class', 'fusion-builder' ),
'param_name' => 'class',
'value' => '',
'description' => esc_attr__( 'Add a class to the wrapping HTML element.', 'fusion-builder' ),
),
array(
'type' => 'textfield',
'heading' => esc_attr__( 'CSS ID', 'fusion-builder' ),
'param_name' => 'id',
'value' => '',
'description' => esc_attr__( 'Add an ID to the wrapping HTML element.', 'fusion-builder' ),
),
),
)
);
}
add_action( 'fusion_builder_before_init', 'fusion_element_separator' );
Arte – Hotel della Baia