Beispiel #1
0
/**
 * Setup default values for Extra specific modules. Default values are also define
 * the unit used in advanced design settings
 * @return array
 */
function extra_set_modules_default_values($defaults)
{
    $extra_defaults = array('et_pb_posts-header_font_size' => '16px', 'et_pb_posts-header_font_style' => 'uppercase', 'et_pb_posts-header_text_color' => '', 'et_pb_posts-header_line_height' => '1', 'et_pb_posts-header_letter_spacing' => '1.2px', 'et_pb_posts-subheader_font_size' => '14px', 'et_pb_posts-subheader_font_style' => '', 'et_pb_posts-subheader_text_color' => '', 'et_pb_posts-subheader_line_height' => '1em', 'et_pb_posts-subheader_letter_spacing' => '0px', 'et_pb_posts-main_title_font_size' => '16px', 'et_pb_posts-main_title_font_style' => '', 'et_pb_posts-main_title_text_color' => 'rgba(0,0,0,0.75)', 'et_pb_posts-main_title_line_height' => '1.3em', 'et_pb_posts-main_title_letter_spacing' => '0.5px', 'et_pb_posts-main_meta_font_size' => '12px', 'et_pb_posts-main_meta_font_style' => '', 'et_pb_posts-main_meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_posts-main_meta_line_height' => '1.7em', 'et_pb_posts-main_meta_letter_spacing' => '0px', 'et_pb_posts-main_body_font_size' => '14px', 'et_pb_posts-main_body_font_style' => '', 'et_pb_posts-main_body_text_color' => 'rgba(0, 0, 0, 0.6)', 'et_pb_posts-main_body_line_height' => '1.8em', 'et_pb_posts-main_body_letter_spacing' => '0px', 'et_pb_posts-list_title_font_size' => '14px', 'et_pb_posts-list_title_font_style' => '', 'et_pb_posts-list_title_text_color' => 'rgba(0,0,0,0.75)', 'et_pb_posts-list_title_line_height' => '1.3em', 'et_pb_posts-list_title_letter_spacing' => '0px', 'et_pb_posts-list_meta_font_size' => '12px', 'et_pb_posts-list_meta_font_style' => '', 'et_pb_posts-list_meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_posts-list_meta_line_height' => '1.7em', 'et_pb_posts-list_meta_letter_spacing' => '0px', 'et_pb_posts-remove_drop_shadow' => 'off', 'et_pb_posts-border_radius' => '3px', 'et_pb_tabbed_posts-active_tab_background_color' => '#ffffff', 'et_pb_tabbed_posts-inactive_tab_background_color' => '#f6f9fd', 'et_pb_tabbed_posts-tab_font_size' => '16px', 'et_pb_tabbed_posts-tab_font_style' => '', 'et_pb_tabbed_posts-tab_text_color' => '', 'et_pb_tabbed_posts-tab_line_height' => '1em', 'et_pb_tabbed_posts-tab_letter_spacing' => '1.2px', 'et_pb_tabbed_posts-main_title_font_size' => '16px', 'et_pb_tabbed_posts-main_title_font_style' => '', 'et_pb_tabbed_posts-main_title_text_color' => 'rgba(0,0,0,0.75)', 'et_pb_tabbed_posts-main_title_line_height' => '1.3em', 'et_pb_tabbed_posts-main_title_letter_spacing' => '0.5px', 'et_pb_tabbed_posts-main_meta_font_size' => '12px', 'et_pb_tabbed_posts-main_meta_font_style' => '', 'et_pb_tabbed_posts-main_meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_tabbed_posts-main_meta_line_height' => '1.7em', 'et_pb_tabbed_posts-main_meta_letter_spacing' => '0px', 'et_pb_tabbed_posts-main_body_font_size' => '14px', 'et_pb_tabbed_posts-main_body_font_style' => '', 'et_pb_tabbed_posts-main_body_text_color' => 'rgba(0, 0, 0, 0.6)', 'et_pb_tabbed_posts-main_body_line_height' => '1.8em', 'et_pb_tabbed_posts-main_body_letter_spacing' => '0px', 'et_pb_tabbed_posts-list_title_font_size' => '14px', 'et_pb_tabbed_posts-list_title_font_style' => '', 'et_pb_tabbed_posts-list_title_text_color' => 'rgba(0,0,0,0.75)', 'et_pb_tabbed_posts-list_title_line_height' => '1.3em', 'et_pb_tabbed_posts-list_title_letter_spacing' => '0px', 'et_pb_tabbed_posts-list_meta_font_size' => '12px', 'et_pb_tabbed_posts-list_meta_font_style' => '', 'et_pb_tabbed_posts-list_meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_tabbed_posts-list_meta_line_height' => '1.7em', 'et_pb_tabbed_posts-list_meta_letter_spacing' => '0px', 'et_pb_tabbed_posts-remove_drop_shadow' => 'off', 'et_pb_tabbed_posts-border_radius' => '3px', 'et_pb_posts_carousel-hover_overlay_color' => 'rgba(0, 0, 0, 0.3)', 'et_pb_posts_carousel-hover_overlay_icon_color' => '#FFFFFF', 'et_pb_posts_carousel-hover_overlay_icon' => '\\e050', 'et_pb_posts_carousel-header_font_size' => '16px', 'et_pb_posts_carousel-header_font_style' => 'uppercase', 'et_pb_posts_carousel-header_text_color' => '', 'et_pb_posts_carousel-header_line_height' => '1', 'et_pb_posts_carousel-header_letter_spacing' => '1.2px', 'et_pb_posts_carousel-subheader_font_size' => '14px', 'et_pb_posts_carousel-subheader_font_style' => '', 'et_pb_posts_carousel-subheader_text_color' => '', 'et_pb_posts_carousel-subheader_line_height' => '1em', 'et_pb_posts_carousel-subheader_letter_spacing' => '0px', 'et_pb_posts_carousel-title_font_size' => '14px', 'et_pb_posts_carousel-title_font_style' => '', 'et_pb_posts_carousel-title_text_color' => 'rgba(0,0,0,0.75)', 'et_pb_posts_carousel-title_line_height' => '1.3em', 'et_pb_posts_carousel-title_letter_spacing' => '0.5px', 'et_pb_posts_carousel-meta_font_size' => '12px', 'et_pb_posts_carousel-meta_font_style' => '', 'et_pb_posts_carousel-meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_posts_carousel-meta_line_height' => '1.9em', 'et_pb_posts_carousel-meta_letter_spacing' => '0px', 'et_pb_posts_carousel-remove_drop_shadow' => 'off', 'et_pb_posts_carousel-border_radius' => '3px', 'et_pb_featured_posts_slider-title_font_size' => '20px', 'et_pb_featured_posts_slider-title_font_style' => '', 'et_pb_featured_posts_slider-title_text_color' => '#ffffff', 'et_pb_featured_posts_slider-title_line_height' => '1.3em', 'et_pb_featured_posts_slider-title_letter_spacing' => '0.5px', 'et_pb_featured_posts_slider-meta_font_size' => '12px', 'et_pb_featured_posts_slider-meta_font_style' => '', 'et_pb_featured_posts_slider-meta_text_color' => 'rgba(255, 255, 255, 0.6)', 'et_pb_featured_posts_slider-meta_line_height' => '1.7em', 'et_pb_featured_posts_slider-meta_letter_spacing' => '0px', 'et_pb_featured_posts_slider-slide_caption_background' => 'rgba(0, 0, 0, 0.6)', 'et_pb_featured_posts_slider-remove_drop_shadow' => 'off', 'et_pb_featured_posts_slider-border_radius' => '3px', 'et_pb_posts_blog_feed_standard-header_font_size' => '16px', 'et_pb_posts_blog_feed_standard-header_font_style' => 'uppercase', 'et_pb_posts_blog_feed_standard-header_text_color' => '', 'et_pb_posts_blog_feed_standard-header_line_height' => '1', 'et_pb_posts_blog_feed_standard-header_letter_spacing' => '1.2px', 'et_pb_posts_blog_feed_standard-title_font_size' => '18px', 'et_pb_posts_blog_feed_standard-title_font_style' => '', 'et_pb_posts_blog_feed_standard-title_text_color' => '', 'et_pb_posts_blog_feed_standard-title_letter_spacing' => '0.5px', 'et_pb_posts_blog_feed_standard-title_line_height' => '1.3em', 'et_pb_posts_blog_feed_standard-meta_font_size' => '12px', 'et_pb_posts_blog_feed_standard-meta_font_style' => '', 'et_pb_posts_blog_feed_standard-meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_posts_blog_feed_standard-meta_letter_spacing' => '0px', 'et_pb_posts_blog_feed_standard-meta_line_height' => '1.7em', 'et_pb_posts_blog_feed_standard-body_font_size' => '14px', 'et_pb_posts_blog_feed_standard-body_font_style' => '', 'et_pb_posts_blog_feed_standard-body_text_color' => 'rgba(0, 0, 0, 0.6)', 'et_pb_posts_blog_feed_standard-body_letter_spacing' => '0px', 'et_pb_posts_blog_feed_standard-body_line_height' => '1.7em', 'et_pb_posts_blog_feed_standard-read_more_text_size' => '14px', 'et_pb_posts_blog_feed_standard-read_more_font' => '', 'et_pb_posts_blog_feed_standard-read_more_text_color' => 'rgba(0, 0, 0, 0.6)', 'et_pb_posts_blog_feed_standard-read_more_letter_spacing' => '0px', 'et_pb_posts_blog_feed_standard-read_more_bg_color' => 'rgba(0, 0, 0, 0.1)', 'et_pb_posts_blog_feed_standard-read_more_border_radius' => '3px', 'et_pb_posts_blog_feed_standard-remove_drop_shadow' => 'off', 'et_pb_posts_blog_feed_standard-border_radius' => '3px', 'et_pb_posts_blog_feed_standard-hover_overlay_color' => 'rgba(0, 0, 0, 0.3)', 'et_pb_posts_blog_feed_standard-hover_overlay_icon_color' => '#FFFFFF', 'et_pb_posts_blog_feed_standard-hover_overlay_icon' => '\\e050', 'et_pb_posts_blog_feed_masonry-title_font_size' => '16px', 'et_pb_posts_blog_feed_masonry-title_font_style' => '', 'et_pb_posts_blog_feed_masonry-title_text_color' => 'rgba(0,0,0,0.75)', 'et_pb_posts_blog_feed_masonry-title_letter_spacing' => '0.5px', 'et_pb_posts_blog_feed_masonry-title_line_height' => '1.3em', 'et_pb_posts_blog_feed_masonry-meta_font_size' => '12px', 'et_pb_posts_blog_feed_masonry-meta_font_style' => '', 'et_pb_posts_blog_feed_masonry-meta_text_color' => 'rgba(0, 0, 0, 0.5)', 'et_pb_posts_blog_feed_masonry-meta_letter_spacing' => '0px', 'et_pb_posts_blog_feed_masonry-meta_line_height' => '1.7em', 'et_pb_posts_blog_feed_masonry-body_font_size' => '14px', 'et_pb_posts_blog_feed_masonry-body_font_style' => '', 'et_pb_posts_blog_feed_masonry-body_text_color' => '', 'et_pb_posts_blog_feed_masonry-body_letter_spacing' => '0px', 'et_pb_posts_blog_feed_masonry-body_line_height' => '1.7em', 'et_pb_posts_blog_feed_masonry-read_more_text_size' => '14px', 'et_pb_posts_blog_feed_masonry-read_more_font' => '', 'et_pb_posts_blog_feed_masonry-read_more_text_color' => 'rgba(0, 0, 0, 0.6)', 'et_pb_posts_blog_feed_masonry-read_more_letter_spacing' => '0px', 'et_pb_posts_blog_feed_masonry-read_more_bg_color' => 'rgba(0, 0, 0, 0.1)', 'et_pb_posts_blog_feed_masonry-read_more_border_radius' => '3px', 'et_pb_posts_blog_feed_masonry-remove_drop_shadow' => 'off', 'et_pb_posts_blog_feed_masonry-border_radius' => '3px', 'et_pb_posts_blog_feed_masonry-hover_overlay_color' => 'rgba(0, 0, 0, 0.3)', 'et_pb_posts_blog_feed_masonry-hover_overlay_icon_color' => '#FFFFFF', 'et_pb_posts_blog_feed_masonry-hover_overlay_icon' => '\\e050', 'et_pb_ads-background_color' => '#FFFFFF', 'et_pb_ads-remove_drop_shadow' => 'off', 'et_pb_ads-border_radius' => '3px', 'et_pb_ads-header_font_size' => '16px', 'et_pb_ads-header_font_style' => 'uppercase', 'et_pb_ads-header_text_color' => '', 'et_pb_ads-header_line_height' => '1', 'et_pb_ads-header_letter_spacing' => '1.2px');
    foreach ($extra_defaults as $setting_name => $default_value) {
        $extra_defaults[$setting_name] = array('default' => $default_value);
        $actual_value = !et_is_builder_plugin_active() ? et_get_option($setting_name, '', '', true) : '';
        if ('' !== $actual_value) {
            $extra_defaults[$setting_name]['actual'] = $actual_value;
        }
    }
    return array_merge($defaults, $extra_defaults);
}
Beispiel #2
0
function et_builder_load_modules_styles()
{
    $current_page_id = apply_filters('et_is_ab_testing_active_post_id', get_the_ID());
    wp_register_script('google-maps-api', esc_url(add_query_arg(array('v' => 3, 'sensor' => 'false'), is_ssl() ? 'https://maps-api-ssl.google.com/maps/api/js' : 'http://maps.google.com/maps/api/js')), array(), ET_BUILDER_VERSION, true);
    wp_enqueue_script('divi-fitvids', ET_BUILDER_URI . '/scripts/jquery.fitvids.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('waypoints', ET_BUILDER_URI . '/scripts/waypoints.min.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('magnific-popup', ET_BUILDER_URI . '/scripts/jquery.magnific-popup.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_register_script('hashchange', ET_BUILDER_URI . '/scripts/jquery.hashchange.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_register_script('salvattore', ET_BUILDER_URI . '/scripts/salvattore.min.js', array(), ET_BUILDER_VERSION, true);
    wp_register_script('easypiechart', ET_BUILDER_URI . '/scripts/jquery.easypiechart.js', array('jquery'), ET_BUILDER_VERSION, true);
    if (et_is_builder_plugin_active()) {
        wp_register_script('fittext', ET_BUILDER_URI . '/scripts/jquery.fittext.js', array('jquery'), ET_BUILDER_VERSION, true);
    }
    // Load main styles CSS file only if the Builder plugin is active
    if (et_is_builder_plugin_active()) {
        wp_enqueue_style('et-builder-modules-style', ET_BUILDER_URI . '/styles/frontend-builder-plugin-style.css', array(), ET_BUILDER_VERSION);
    }
    // Load visible.min.js only if AB testing active on current page
    if (et_is_ab_testing_active()) {
        wp_enqueue_script('et-jquery-visible-viewport', ET_BUILDER_URI . '/scripts/ext/jquery.visible.min.js', array('jquery', 'et-builder-modules-script'), ET_BUILDER_VERSION, true);
    }
    wp_enqueue_style('magnific-popup', ET_BUILDER_URI . '/styles/magnific_popup.css', array(), ET_BUILDER_VERSION);
    wp_enqueue_script('et-jquery-touch-mobile', ET_BUILDER_URI . '/scripts/jquery.mobile.custom.min.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('et-builder-modules-script', ET_BUILDER_URI . '/scripts/frontend-builder-scripts.js', array('jquery', 'et-jquery-touch-mobile'), ET_BUILDER_VERSION, true);
    wp_localize_script('et-builder-modules-script', 'et_pb_custom', array('ajaxurl' => admin_url('admin-ajax.php'), 'images_uri' => get_template_directory_uri() . '/images', 'builder_images_uri' => ET_BUILDER_URI . '/images', 'et_frontend_nonce' => wp_create_nonce('et_frontend_nonce'), 'subscription_failed' => esc_html__('Please, check the fields below to make sure you entered the correct information.', 'et_builder'), 'et_ab_log_nonce' => wp_create_nonce('et_ab_testing_log_nonce'), 'fill_message' => esc_html__('Please, fill in the following fields:', 'et_builder'), 'contact_error_message' => esc_html__('Please, fix the following errors:', 'et_builder'), 'invalid' => esc_html__('Invalid email', 'et_builder'), 'captcha' => esc_html__('Captcha', 'et_builder'), 'prev' => esc_html__('Prev', 'et_builder'), 'previous' => esc_html__('Previous', 'et_builder'), 'next' => esc_html__('Next', 'et_builder'), 'wrong_captcha' => esc_html__('You entered the wrong number in captcha.', 'et_builder'), 'is_builder_plugin_used' => et_is_builder_plugin_active(), 'is_divi_theme_used' => function_exists('et_divi_fonts_url'), 'widget_search_selector' => apply_filters('et_pb_widget_search_selector', '.widget_search'), 'is_ab_testing_active' => et_is_ab_testing_active(), 'page_id' => $current_page_id, 'unique_test_id' => get_post_meta($current_page_id, '_et_pb_ab_testing_id', true), 'ab_bounce_rate' => '' !== get_post_meta($current_page_id, '_et_pb_ab_bounce_rate_limit', true) ? get_post_meta($current_page_id, '_et_pb_ab_bounce_rate_limit', true) : 5, 'is_cache_plugin_active' => false === et_pb_detect_cache_plugins() ? 'no' : 'yes', 'is_shortcode_tracking' => get_post_meta($current_page_id, '_et_pb_enable_shortcode_tracking', true)));
    /**
     * Only load this during builder preview screen session
     */
    if (is_et_pb_preview()) {
        // Set fixed protocol for preview URL to prevent cross origin issue
        $preview_scheme = is_ssl() ? 'https' : 'http';
        // Get home url, then parse it
        $preview_origin_component = parse_url(home_url('', $preview_scheme));
        // Rebuild origin URL, strip sub-directory address if there's any (postMessage e.origin doesn't pass sub-directory address)
        $preview_origin = "";
        // Perform check, prevent unnecessary error
        if (isset($preview_origin_component['scheme']) && isset($preview_origin_component['host'])) {
            $preview_origin = "{$preview_origin_component['scheme']}://{$preview_origin_component['host']}";
            // Append port number if different port number is being used
            if (isset($preview_origin_component['port'])) {
                $preview_origin = "{$preview_origin}:{$preview_origin_component['port']}";
            }
        }
        // Enqueue theme's style.css if it hasn't been enqueued (possibly being hardcoded by theme)
        if (!et_builder_has_theme_style_enqueued() && et_is_builder_plugin_active()) {
            wp_enqueue_style('et-builder-theme-style-css', get_stylesheet_uri(), array());
        }
        wp_enqueue_style('et-builder-preview-style', ET_BUILDER_URI . '/styles/preview.css', array(), ET_BUILDER_VERSION);
        wp_enqueue_script('et-builder-preview-script', ET_BUILDER_URI . '/scripts/frontend-builder-preview.js', array('jquery'), ET_BUILDER_VERSION, true);
        wp_localize_script('et-builder-preview-script', 'et_preview_params', array('preview_origin' => esc_url($preview_origin), 'alert_origin_not_matched' => sprintf(esc_html__('Unauthorized access. Preview cannot be accessed outside %1$s.', 'et_builder'), esc_url(home_url('', $preview_scheme)))));
    }
}
 private static function set_values()
 {
     $font_defaults = array('size' => '14', 'color' => '#666666', 'letter_spacing' => '0px', 'line_height' => '1.7em');
     $defaults = array('et_pb_image-animation' => 'left', 'et_pb_gallery-hover_overlay_color' => 'rgba(255,255,255,0.9)', 'et_pb_gallery-title_font_size' => '16', 'et_pb_gallery-title_color' => '#333333', 'et_pb_gallery-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_gallery-title_line_height' => '1em', 'et_pb_gallery-title_font_style' => '', 'et_pb_gallery-caption_font_size' => '14', 'et_pb_gallery-caption_font_style' => '', 'et_pb_gallery-caption_color' => '#f3f3f3', 'et_pb_gallery-caption_line_height' => '18px', 'et_pb_gallery-caption_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_tabs-tab_font_size' => $font_defaults['size'], 'et_pb_tabs-tab_line_height' => $font_defaults['line_height'], 'et_pb_tabs-tab_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_tabs-body_font_size' => $font_defaults['size'], 'et_pb_tabs-body_line_height' => $font_defaults['line_height'], 'et_pb_tabs-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_tabs-title_font_style' => '', 'et_pb_tabs-padding' => '30', 'et_pb_slider-header_font_size' => '46', 'et_pb_slider-header_line_height' => '1em', 'et_pb_slider-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_slider-header_font_style' => '', 'et_pb_slider-body_font_size' => '16', 'et_pb_slider-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_slider-body_line_height' => $font_defaults['line_height'], 'et_pb_slider-body_font_style' => '', 'et_pb_slider-padding' => '16', 'et_pb_slider-header_color' => '#ffffff', 'et_pb_slider-header_line_height' => '1em', 'et_pb_slider-body_color' => '#ffffff', 'et_pb_testimonial-portrait_border_radius' => '90', 'et_pb_testimonial-portrait_width' => '90', 'et_pb_testimonial-portrait_height' => '90', 'et_pb_testimonial-author_name_font_style' => 'bold', 'et_pb_testimonial-author_details_font_style' => 'bold', 'et_pb_testimonial-border_color' => '#ffffff', 'et_pb_testimonial-border_width' => '1px', 'et_pb_testimonial-body_font_size' => $font_defaults['size'], 'et_pb_testimonial-body_line_height' => '1.5em', 'et_pb_testimonial-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_pricing_tables-header_font_size' => '22', 'et_pb_pricing_tables-header_font_style' => '', 'et_pb_pricing_tables-subheader_font_size' => '16', 'et_pb_pricing_tables-subheader_font_style' => '', 'et_pb_pricing_tables-price_font_size' => '80', 'et_pb_pricing_tables-price_font_style' => '', 'et_pb_pricing_tables-header_color' => '#ffffff', 'et_pb_pricing_tables-header_line_height' => '1em', 'et_pb_pricing_tables-subheader_color' => '#ffffff', 'et_pb_pricing_tables-currency_frequency_font_size' => '16px', 'et_pb_pricing_tables-currency_frequency_letter_spacing' => '0px', 'et_pb_pricing_tables-currency_frequency_line_height' => '1.7em', 'et_pb_pricing_tables-price_letter_spacing' => '0px', 'et_pb_pricing_tables-price_color' => '#2EA3F2', 'et_pb_pricing_tables-price_line_height' => '82px', 'et_pb_pricing_tables-body_line_height' => '24px', 'et_pb_fullwidth_post_title-title_font_size' => '26px', 'et_pb_fullwidth_post_title-title_line_height' => '1em', 'et_pb_fullwidth_post_title-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_fullwidth_post_title-meta_font_size' => $font_defaults['size'], 'et_pb_fullwidth_post_title-meta_line_height' => '1em', 'et_pb_fullwidth_post_title-meta_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_fullwidth_post_title-module_bg_color' => 'rgba(255,255,255,0)', 'et_pb_fullwidth_header-scroll_down_icon_size' => '50px', 'et_pb_fullwidth_header-subhead_font_size' => '18px', 'et_pb_fullwidth_header-button_one_font_size' => '20px', 'et_pb_fullwidth_header-button_one_border_radius' => '3px', 'et_pb_fullwidth_header-button_two_font_size' => '20px', 'et_pb_fullwidth_header-button_two_border_radius' => '3px', 'et_pb_post_title-title_font_size' => '26px', 'et_pb_post_title-title_line_height' => '1em', 'et_pb_post_title-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_post_title-meta_font_size' => $font_defaults['size'], 'et_pb_post_title-meta_line_height' => '1em', 'et_pb_post_title-meta_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_post_title-module_bg_color' => 'rgba(255,255,255,0)', 'et_pb_cta-header_font_size' => '26', 'et_pb_cta-header_font_style' => '', 'et_pb_cta-custom_padding' => '40', 'et_pb_cta-header_text_color' => '#333333', 'et_pb_cta-header_line_height' => '1em', 'et_pb_cta-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_cta-body_font_size' => $font_defaults['size'], 'et_pb_cta-body_line_height' => $font_defaults['line_height'], 'et_pb_cta-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_blurb-header_font_size' => '18', 'et_pb_blurb-header_color' => '#333333', 'et_pb_blurb-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_blurb-header_line_height' => '1em', 'et_pb_blurb-body_font_size' => $font_defaults['size'], 'et_pb_blurb-body_color' => '#666666', 'et_pb_blurb-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_blurb-body_line_height' => $font_defaults['line_height'], 'et_pb_text-text_font_size' => $font_defaults['size'], 'et_pb_text-text_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_text-text_line_height' => $font_defaults['line_height'], 'et_pb_text-border_color' => '#ffffff', 'et_pb_text-border_width' => '1px', 'et_pb_slide-header_font_size' => '26px', 'et_pb_slide-header_color' => '#ffffff', 'et_pb_slide-header_line_height' => '1em', 'et_pb_slide-body_font_size' => '16px', 'et_pb_slide-body_color' => '#ffffff', 'et_pb_pricing_table-header_font_size' => '22px', 'et_pb_pricing_table-header_color' => '#ffffff', 'et_pb_pricing_table-header_line_height' => '1em', 'et_pb_pricing_table-subheader_font_size' => '16px', 'et_pb_pricing_table-subheader_color' => '#ffffff', 'et_pb_pricing_table-price_font_size' => '80px', 'et_pb_pricing_table-price_color' => '#2EA3F2', 'et_pb_pricing_table-price_line_height' => '82px', 'et_pb_pricing_table-body_line_height' => '24px', 'et_pb_audio-title_font_size' => '26', 'et_pb_audio-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_audio-title_line_height' => $font_defaults['line_height'], 'et_pb_audio-title_font_style' => '', 'et_pb_audio-caption_font_size' => $font_defaults['size'], 'et_pb_audio-caption_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_audio-caption_line_height' => $font_defaults['line_height'], 'et_pb_audio-caption_font_style' => '', 'et_pb_audio-title_text_color' => '#666666', 'et_pb_signup-header_font_size' => '26', 'et_pb_signup-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_signup-header_line_height' => $font_defaults['line_height'], 'et_pb_signup-body_font_size' => $font_defaults['size'], 'et_pb_signup-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_signup-body_line_height' => $font_defaults['line_height'], 'et_pb_signup-header_font_style' => '', 'et_pb_signup-padding' => '20', 'et_pb_signup-focus_border_color' => '#ffffff', 'et_pb_login-header_font_size' => '26', 'et_pb_login-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_login-header_line_height' => $font_defaults['line_height'], 'et_pb_login-body_font_size' => $font_defaults['size'], 'et_pb_login-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_login-body_line_height' => $font_defaults['line_height'], 'et_pb_login-header_font_style' => '', 'et_pb_login-custom_padding' => '40', 'et_pb_login-focus_border_color' => '#ffffff', 'et_pb_portfolio-hover_overlay_color' => 'rgba(255,255,255,0.9)', 'et_pb_portfolio-title_font_size' => '18', 'et_pb_portfolio-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_portfolio-title_line_height' => $font_defaults['line_height'], 'et_pb_portfolio-title_font_style' => '', 'et_pb_portfolio-caption_font_size' => '14', 'et_pb_portfolio-caption_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_portfolio-caption_line_height' => $font_defaults['line_height'], 'et_pb_portfolio-caption_font_style' => '', 'et_pb_portfolio-title_color' => '#333333', 'et_pb_filterable_portfolio-hover_overlay_color' => 'rgba(255,255,255,0.9)', 'et_pb_filterable_portfolio-title_font_size' => '18', 'et_pb_filterable_portfolio-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_filterable_portfolio-title_line_height' => $font_defaults['line_height'], 'et_pb_filterable_portfolio-title_font_style' => '', 'et_pb_filterable_portfolio-caption_font_size' => '14', 'et_pb_filterable_portfolio-caption_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_filterable_portfolio-caption_line_height' => $font_defaults['line_height'], 'et_pb_filterable_portfolio-caption_font_style' => '', 'et_pb_filterable_portfolio-filter_font_size' => '14', 'et_pb_filterable_portfolio-filter_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_filterable_portfolio-filter_line_height' => $font_defaults['line_height'], 'et_pb_filterable_portfolio-filter_font_style' => '', 'et_pb_filterable_portfolio-title_color' => '#333333', 'et_pb_counters-title_font_size' => '12', 'et_pb_counters-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_counters-title_line_height' => $font_defaults['line_height'], 'et_pb_counters-title_font_style' => '', 'et_pb_counters-percent_font_size' => '12', 'et_pb_counters-percent_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_counters-percent_line_height' => $font_defaults['line_height'], 'et_pb_counters-percent_font_style' => '', 'et_pb_counters-border_radius' => '0', 'et_pb_counters-padding' => '0', 'et_pb_counters-title_color' => '#999999', 'et_pb_counters-percent_color' => '#ffffff', 'et_pb_circle_counter-title_font_size' => '16', 'et_pb_circle_counter-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_circle_counter-title_line_height' => '1em', 'et_pb_circle_counter-title_font_style' => '', 'et_pb_circle_counter-number_font_size' => '46', 'et_pb_circle_counter-number_font_style' => '', 'et_pb_circle_counter-title_color' => '#333333', 'et_pb_circle_counter-number_line_height' => '225px', 'et_pb_circle_counter-number_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_number_counter-title_font_size' => '16', 'et_pb_number_counter-title_line_height' => '1em', 'et_pb_number_counter-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_number_counter-title_font_style' => '', 'et_pb_number_counter-number_font_size' => '72', 'et_pb_number_counter-number_line_height' => '72px', 'et_pb_number_counter-number_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_number_counter-number_font_style' => '', 'et_pb_number_counter-title_color' => '#333333', 'et_pb_accordion-toggle_font_size' => '16', 'et_pb_accordion-toggle_font_style' => '', 'et_pb_accordion-inactive_toggle_font_style' => '', 'et_pb_accordion-toggle_icon_size' => '16', 'et_pb_accordion-custom_padding' => '20', 'et_pb_accordion-toggle_line_height' => '1em', 'et_pb_accordion-toggle_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_accordion-body_font_size' => $font_defaults['size'], 'et_pb_accordion-body_line_height' => $font_defaults['line_height'], 'et_pb_accordion-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_toggle-title_font_size' => '16', 'et_pb_toggle-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_toggle-title_font_style' => '', 'et_pb_toggle-inactive_title_font_style' => '', 'et_pb_toggle-toggle_icon_size' => '16', 'et_pb_toggle-title_color' => '#333333', 'et_pb_toggle-title_line_height' => '1em', 'et_pb_toggle-custom_padding' => '20', 'et_pb_toggle-body_font_size' => $font_defaults['size'], 'et_pb_toggle-body_line_height' => $font_defaults['line_height'], 'et_pb_toggle-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_contact_form-title_font_size' => '26', 'et_pb_contact_form-title_font_style' => '', 'et_pb_contact_form-form_field_font_size' => '14', 'et_pb_contact_form-form_field_font_style' => '', 'et_pb_contact_form-captcha_font_size' => '14', 'et_pb_contact_form-captcha_font_style' => '', 'et_pb_contact_form-padding' => '16', 'et_pb_contact_form-title_color' => '#333333', 'et_pb_contact_form-title_line_height' => '1em', 'et_pb_contact_form-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_contact_form-form_field_color' => '#999999', 'et_pb_contact_form-form_field_line_height' => $font_defaults['line_height'], 'et_pb_contact_form-form_field_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_sidebar-header_font_size' => '18', 'et_pb_sidebar-header_font_style' => '', 'et_pb_sidebar-header_color' => '#333333', 'et_pb_sidebar-header_line_height' => '1em', 'et_pb_sidebar-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_sidebar-remove_border' => 'off', 'et_pb_sidebar-body_font_size' => $font_defaults['size'], 'et_pb_sidebar-body_line_height' => $font_defaults['line_height'], 'et_pb_sidebar-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_divider-show_divider' => 'off', 'et_pb_divider-divider_style' => 'none', 'et_pb_divider-divider_weight' => '1', 'et_pb_divider-height' => '1', 'et_pb_divider-divider_position' => 'none', 'et_pb_team_member-header_font_size' => '18', 'et_pb_team_member-header_font_style' => '', 'et_pb_team_member-subheader_font_size' => '14', 'et_pb_team_member-subheader_font_style' => '', 'et_pb_team_member-social_network_icon_size' => '16', 'et_pb_team_member-header_color' => '#333333', 'et_pb_team_member-header_line_height' => '1em', 'et_pb_team_member-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_team_member-body_font_size' => $font_defaults['size'], 'et_pb_team_member-body_line_height' => $font_defaults['line_height'], 'et_pb_team_member-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_shop-title_font_size' => '16', 'et_pb_shop-title_font_style' => '', 'et_pb_shop-sale_badge_font_size' => '16', 'et_pb_shop-sale_badge_font_style' => '', 'et_pb_shop-price_font_size' => '14', 'et_pb_shop-price_font_style' => '', 'et_pb_shop-sale_price_font_size' => '14', 'et_pb_shop-sale_price_font_style' => '', 'et_pb_shop-title_color' => '#333333', 'et_pb_shop-title_line_height' => '1em', 'et_pb_shop-title_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_shop-price_line_height' => '26px', 'et_pb_shop-price_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_countdown_timer-header_font_size' => '22', 'et_pb_countdown_timer-header_font_style' => '', 'et_pb_countdown_timer-header_color' => '#333333', 'et_pb_countdown_timer-header_line_height' => '1em', 'et_pb_countdown_timer-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_countdown_timer-numbers_font_size' => '64px', 'et_pb_countdown_timer-numbers_line_height' => '64px', 'et_pb_countdown_timer-numbers_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_countdown_timer-label_line_height' => '25px', 'et_pb_countdown_timer-label_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_countdown_timer-label_font_size' => $font_defaults['size'], 'et_pb_social_media_follow-icon_size' => '14', 'et_pb_social_media_follow-button_font_style' => '', 'et_pb_fullwidth_slider-header_font_size' => '46', 'et_pb_fullwidth_slider-header_font_style' => '', 'et_pb_fullwidth_slider-body_font_size' => '16', 'et_pb_fullwidth_slider-body_font_style' => '', 'et_pb_fullwidth_slider-body_line_height' => $font_defaults['line_height'], 'et_pb_fullwidth_slider-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_fullwidth_slider-padding' => '16', 'et_pb_fullwidth_slider-header_color' => '#ffffff', 'et_pb_fullwidth_slider-header_line_height' => '1em', 'et_pb_fullwidth_slider-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_fullwidth_slider-body_color' => '#ffffff', 'et_pb_blog-header_font_size' => '18', 'et_pb_blog-header_font_style' => '', 'et_pb_blog-meta_font_size' => '14', 'et_pb_blog-meta_font_style' => '', 'et_pb_blog-meta_line_height' => $font_defaults['line_height'], 'et_pb_blog-meta_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_blog-header_color' => '#333333', 'et_pb_blog-header_line_height' => '1em', 'et_pb_blog-header_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_blog-body_font_size' => $font_defaults['size'], 'et_pb_blog-body_line_height' => $font_defaults['line_height'], 'et_pb_blog-body_letter_spacing' => $font_defaults['letter_spacing'], 'et_pb_blog_masonry-header_font_size' => '26', 'et_pb_blog_masonry-header_font_style' => '', 'et_pb_blog_masonry-meta_font_size' => '14', 'et_pb_blog_masonry-meta_font_style' => '', 'all_buttons_font_size' => '20', 'all_buttons_border_width' => '2', 'all_buttons_border_radius' => '3', 'all_buttons_spacing' => '0', 'all_buttons_font_style' => '', 'all_buttons_border_radius_hover' => '3', 'all_buttons_spacing_hover' => '0');
     if (!et_is_builder_plugin_active()) {
         $defaults['et_pb_gallery-zoom_icon_color'] = et_get_option('accent_color', '#2EA3F2');
         $defaults['et_pb_portfolio-zoom_icon_color'] = et_get_option('accent_color', '#2EA3F2');
         $defaults['et_pb_filterable_portfolio-zoom_icon_color'] = et_get_option('accent_color', '#2EA3F2');
     }
     // reformat defaults array and add actual values to it
     foreach ($defaults as $setting_name => $default_value) {
         $defaults[$setting_name] = array('default' => $default_value);
         $actual_value = !et_is_builder_plugin_active() ? et_get_option($setting_name, '', '', true) : '';
         if ('' !== $actual_value) {
             $defaults[$setting_name]['actual'] = $actual_value;
         }
     }
     self::$_settings = apply_filters('et_set_default_values', $defaults);
 }
Beispiel #4
0
function et_builder_load_modules_styles()
{
    wp_register_script('google-maps-api', esc_url(add_query_arg(array('v' => 3, 'sensor' => 'false'), is_ssl() ? 'https://maps-api-ssl.google.com/maps/api/js' : 'http://maps.google.com/maps/api/js')), array(), ET_BUILDER_VERSION, true);
    wp_enqueue_script('divi-fitvids', ET_BUILDER_URI . '/scripts/jquery.fitvids.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('waypoints', ET_BUILDER_URI . '/scripts/waypoints.min.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('magnific-popup', ET_BUILDER_URI . '/scripts/jquery.magnific-popup.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_register_script('hashchange', ET_BUILDER_URI . '/scripts/jquery.hashchange.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_register_script('salvattore', ET_BUILDER_URI . '/scripts/salvattore.min.js', array(), ET_BUILDER_VERSION, true);
    wp_register_script('easypiechart', ET_BUILDER_URI . '/scripts/jquery.easypiechart.js', array('jquery'), ET_BUILDER_VERSION, true);
    // Load main styles CSS file only if the Builder plugin is active
    if (et_is_builder_plugin_active()) {
        wp_enqueue_style('et-builder-modules-style', ET_BUILDER_URI . '/styles/frontend-builder-plugin-style.css', array(), ET_BUILDER_VERSION);
    }
    wp_enqueue_script('et-builder-modules-script', ET_BUILDER_URI . '/scripts/frontend-builder-scripts.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_localize_script('et-builder-modules-script', 'et_custom', array('ajaxurl' => admin_url('admin-ajax.php'), 'images_uri' => get_template_directory_uri() . '/images', 'builder_images_uri' => get_template_directory_uri() . '/includes/builder/images', 'et_load_nonce' => wp_create_nonce('et_load_nonce'), 'subscription_failed' => __('Please, check the fields below to make sure you entered the correct information.', 'Divi'), 'fill' => esc_html__('Fill', 'Divi'), 'field' => esc_html__('field', 'Divi'), 'invalid' => esc_html__('Invalid email', 'Divi'), 'captcha' => esc_html__('Captcha', 'Divi'), 'prev' => esc_html__('Prev', 'Divi'), 'previous' => esc_html__('Previous', 'Divi'), 'next' => esc_html__('Next', 'Divi'), 'is_builder_plugin_used' => et_is_builder_plugin_active()));
    /**
     * Only load this during builder preview screen session
     */
    if (is_et_pb_preview()) {
        // Set fixed protocol for preview URL to prevent cross origin issue
        $preview_scheme = is_ssl() ? 'https' : 'http';
        // Get home url, then parse it
        $preview_origin_component = parse_url(home_url('', $preview_scheme));
        // Rebuild origin URL, strip sub-directory address if there's any (postMessage e.origin doesn't pass sub-directory address)
        $preview_origin = "";
        // Perform check, prevent unnecessary error
        if (isset($preview_origin_component['scheme']) && isset($preview_origin_component['host'])) {
            $preview_origin = "{$preview_origin_component['scheme']}://{$preview_origin_component['host']}";
            // Append port number if different port number is being used
            if (isset($preview_origin_component['port'])) {
                $preview_origin = "{$preview_origin}:{$preview_origin_component['port']}";
            }
        }
        wp_enqueue_style('et-builder-preview-style', ET_BUILDER_URI . '/styles/preview.css', array(), ET_BUILDER_VERSION);
        wp_enqueue_script('et-builder-preview-script', ET_BUILDER_URI . '/scripts/frontend-builder-preview.js', array('jquery'), ET_BUILDER_VERSION, true);
        wp_localize_script('et-builder-preview-script', 'et_preview_params', array('preview_origin' => esc_url($preview_origin), 'alert_origin_not_matched' => sprintf(esc_html__('Unauthorized access. Preview cannot be accessed outside %1$s.', 'Divi'), esc_url(home_url('', $preview_scheme)))));
    }
}
    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $background_image = $this->shortcode_atts['background_image'];
        $background_color = $this->shortcode_atts['background_color'];
        $background_video_mp4 = $this->shortcode_atts['background_video_mp4'];
        $background_video_webm = $this->shortcode_atts['background_video_webm'];
        $background_video_width = $this->shortcode_atts['background_video_width'];
        $background_video_height = $this->shortcode_atts['background_video_height'];
        $allow_player_pause = $this->shortcode_atts['allow_player_pause'];
        $inner_shadow = $this->shortcode_atts['inner_shadow'];
        $parallax = $this->shortcode_atts['parallax'];
        $parallax_method = $this->shortcode_atts['parallax_method'];
        $fullwidth = $this->shortcode_atts['fullwidth'];
        $specialty = $this->shortcode_atts['specialty'];
        $transparent_background = $this->shortcode_atts['transparent_background'];
        $custom_padding = $this->shortcode_atts['custom_padding'];
        $custom_padding_tablet = $this->shortcode_atts['custom_padding_tablet'];
        $custom_padding_phone = $this->shortcode_atts['custom_padding_phone'];
        $padding_mobile = $this->shortcode_atts['padding_mobile'];
        $background_color_1 = $this->shortcode_atts['background_color_1'];
        $background_color_2 = $this->shortcode_atts['background_color_2'];
        $background_color_3 = $this->shortcode_atts['background_color_3'];
        $bg_img_1 = $this->shortcode_atts['bg_img_1'];
        $bg_img_2 = $this->shortcode_atts['bg_img_2'];
        $bg_img_3 = $this->shortcode_atts['bg_img_3'];
        $padding_top_1 = $this->shortcode_atts['padding_top_1'];
        $padding_right_1 = $this->shortcode_atts['padding_right_1'];
        $padding_bottom_1 = $this->shortcode_atts['padding_bottom_1'];
        $padding_left_1 = $this->shortcode_atts['padding_left_1'];
        $padding_top_2 = $this->shortcode_atts['padding_top_2'];
        $padding_right_2 = $this->shortcode_atts['padding_right_2'];
        $padding_bottom_2 = $this->shortcode_atts['padding_bottom_2'];
        $padding_left_2 = $this->shortcode_atts['padding_left_2'];
        $padding_top_3 = $this->shortcode_atts['padding_top_3'];
        $padding_right_3 = $this->shortcode_atts['padding_right_3'];
        $padding_bottom_3 = $this->shortcode_atts['padding_bottom_3'];
        $padding_left_3 = $this->shortcode_atts['padding_left_3'];
        $padding_1_tablet = $this->shortcode_atts['padding_1_tablet'];
        $padding_2_tablet = $this->shortcode_atts['padding_2_tablet'];
        $padding_3_tablet = $this->shortcode_atts['padding_3_tablet'];
        $padding_1_phone = $this->shortcode_atts['padding_1_phone'];
        $padding_2_phone = $this->shortcode_atts['padding_2_phone'];
        $padding_3_phone = $this->shortcode_atts['padding_3_phone'];
        $gutter_width = $this->shortcode_atts['gutter_width'];
        $use_custom_width = $this->shortcode_atts['use_custom_width'];
        $custom_width_px = $this->shortcode_atts['custom_width_px'];
        $custom_width_percent = $this->shortcode_atts['custom_width_percent'];
        $width_unit = $this->shortcode_atts['width_unit'];
        $make_equal = $this->shortcode_atts['make_equal'];
        $make_fullwidth = $this->shortcode_atts['make_fullwidth'];
        $global_module = $this->shortcode_atts['global_module'];
        $use_custom_gutter = $this->shortcode_atts['use_custom_gutter'];
        $module_id_1 = $this->shortcode_atts['module_id_1'];
        $module_id_2 = $this->shortcode_atts['module_id_2'];
        $module_id_3 = $this->shortcode_atts['module_id_3'];
        $module_class_1 = $this->shortcode_atts['module_class_1'];
        $module_class_2 = $this->shortcode_atts['module_class_2'];
        $module_class_3 = $this->shortcode_atts['module_class_3'];
        $custom_css_before_1 = $this->shortcode_atts['custom_css_before_1'];
        $custom_css_before_2 = $this->shortcode_atts['custom_css_before_2'];
        $custom_css_before_3 = $this->shortcode_atts['custom_css_before_3'];
        $custom_css_main_1 = $this->shortcode_atts['custom_css_main_1'];
        $custom_css_main_2 = $this->shortcode_atts['custom_css_main_2'];
        $custom_css_main_3 = $this->shortcode_atts['custom_css_main_3'];
        $custom_css_after_1 = $this->shortcode_atts['custom_css_after_1'];
        $custom_css_after_2 = $this->shortcode_atts['custom_css_after_2'];
        $custom_css_after_3 = $this->shortcode_atts['custom_css_after_3'];
        if ('' !== $global_module) {
            $global_content = et_pb_load_global_module($global_module);
            if ('' !== $global_content) {
                return do_shortcode($global_content);
            }
        }
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $gutter_class = '';
        $padding_mobile_values = array('tablet' => explode('|', $custom_padding_tablet), 'phone' => explode('|', $custom_padding_phone));
        if ('on' === $specialty) {
            global $et_pb_column_backgrounds, $et_pb_column_paddings, $et_pb_columns_counter, $et_pb_column_css, $et_pb_column_paddings_mobile;
            $module_class .= 'on' === $make_equal ? ' et_pb_equal_columns' : '';
            if ('on' === $use_custom_gutter && '' !== $gutter_width) {
                $gutter_width = '0' === $gutter_width ? '1' : $gutter_width;
                // set the gutter to 1 if 0 entered by user
                $gutter_class .= ' et_pb_gutters' . $gutter_width;
            }
            $et_pb_columns_counter = 0;
            $et_pb_column_backgrounds = array(array($background_color_1, $bg_img_1), array($background_color_2, $bg_img_2), array($background_color_3, $bg_img_3));
            $et_pb_column_paddings = array(array('padding-top' => $padding_top_1, 'padding-right' => $padding_right_1, 'padding-bottom' => $padding_bottom_1, 'padding-left' => $padding_left_1), array('padding-top' => $padding_top_2, 'padding-right' => $padding_right_2, 'padding-bottom' => $padding_bottom_2, 'padding-left' => $padding_left_2), array('padding-top' => $padding_top_3, 'padding-right' => $padding_right_3, 'padding-bottom' => $padding_bottom_3, 'padding-left' => $padding_left_3));
            $et_pb_column_paddings_mobile = array(array('tablet' => explode('|', $padding_1_tablet), 'phone' => explode('|', $padding_1_phone)), array('tablet' => explode('|', $padding_2_tablet), 'phone' => explode('|', $padding_2_phone)), array('tablet' => explode('|', $padding_3_tablet), 'phone' => explode('|', $padding_3_phone)));
            if ('on' === $make_fullwidth && 'off' === $use_custom_width) {
                $module_class .= ' et_pb_specialty_fullwidth';
            }
            if ('on' === $use_custom_width) {
                ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% > .et_pb_row', 'declaration' => sprintf('max-width:%1$s !important;', 'on' === $width_unit ? esc_attr($custom_width_px) : esc_attr($custom_width_percent))));
            }
            $et_pb_column_css = array('css_class' => array($module_class_1, $module_class_2, $module_class_3), 'css_id' => array($module_id_1, $module_id_2, $module_id_3), 'custom_css_before' => array($custom_css_before_1, $custom_css_before_2, $custom_css_before_3), 'custom_css_main' => array($custom_css_main_1, $custom_css_main_2, $custom_css_main_3), 'custom_css_after' => array($custom_css_after_1, $custom_css_after_2, $custom_css_after_3));
        }
        $background_video = '';
        if ('' !== $background_video_mp4 || '' !== $background_video_webm) {
            $background_video = sprintf('<div class="et_pb_section_video_bg%2$s">
					%1$s
				</div>', do_shortcode(sprintf('
					<video loop="loop" %3$s%4$s>
						%1$s
						%2$s
					</video>', '' !== $background_video_mp4 ? sprintf('<source type="video/mp4" src="%s" />', esc_attr($background_video_mp4)) : '', '' !== $background_video_webm ? sprintf('<source type="video/webm" src="%s" />', esc_attr($background_video_webm)) : '', '' !== $background_video_width ? sprintf(' width="%s"', esc_attr(intval($background_video_width))) : '', '' !== $background_video_height ? sprintf(' height="%s"', esc_attr(intval($background_video_height))) : '')), 'on' === $allow_player_pause ? ' et_pb_allow_player_pause' : '');
            wp_enqueue_style('wp-mediaelement');
            wp_enqueue_script('wp-mediaelement');
        }
        // set the correct default value for $transparent_background option if plugin activated.
        if (et_is_builder_plugin_active() && 'default' === $transparent_background) {
            $transparent_background = '' !== $background_color ? 'off' : 'on';
        } elseif ('default' === $transparent_background) {
            $transparent_background = 'off';
        }
        if ('' !== $background_color && 'off' === $transparent_background) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_section', 'declaration' => sprintf('background-color:%s !important;', esc_attr($background_color))));
        }
        if ('' !== $background_image && 'on' !== $parallax) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('background-image:url(%s);', esc_attr($background_image))));
        }
        $padding_values = explode('|', $custom_padding);
        if (!empty($padding_values)) {
            // old version of sections supports only top and bottom padding, so we need to handle it along with the full padding in the recent version
            if (2 === count($padding_values)) {
                $padding_settings = array('top' => isset($padding_values[0]) ? $padding_values[0] : '', 'bottom' => isset($padding_values[1]) ? $padding_values[1] : '');
            } else {
                $padding_settings = array('top' => isset($padding_values[0]) ? $padding_values[0] : '', 'right' => isset($padding_values[1]) ? $padding_values[1] : '', 'bottom' => isset($padding_values[2]) ? $padding_values[2] : '', 'left' => isset($padding_values[3]) ? $padding_values[3] : '');
            }
            foreach ($padding_settings as $padding_side => $value) {
                if ('' !== $value) {
                    $element_style = array('selector' => '%%order_class%%.et_pb_section', 'declaration' => sprintf('padding-%1$s: %2$s;', esc_html($padding_side), esc_html($value)));
                    if ('on' !== $padding_mobile) {
                        $element_style['media_query'] = ET_Builder_Element::get_media_query('min_width_981');
                    }
                    ET_Builder_Element::set_style($function_name, $element_style);
                }
            }
        }
        if (!empty($padding_mobile_values['tablet']) || !empty($padding_values['phone'])) {
            $padding_mobile_values_processed = array();
            foreach (array('tablet', 'phone') as $device) {
                if (empty($padding_mobile_values[$device])) {
                    continue;
                }
                $padding_mobile_values_processed[$device] = array('padding-top' => isset($padding_mobile_values[$device][0]) ? $padding_mobile_values[$device][0] : '', 'padding-right' => isset($padding_mobile_values[$device][1]) ? $padding_mobile_values[$device][1] : '', 'padding-bottom' => isset($padding_mobile_values[$device][2]) ? $padding_mobile_values[$device][2] : '', 'padding-left' => isset($padding_mobile_values[$device][3]) ? $padding_mobile_values[$device][3] : '');
            }
            if (!empty($padding_mobile_values_processed)) {
                et_pb_generate_responsive_css($padding_mobile_values_processed, '%%order_class%%.et_pb_section', '', $function_name);
            }
        }
        if ('' !== $background_video_mp4 || '' !== $background_video_webm || '' !== $background_color && 'off' === $transparent_background || '' !== $background_image) {
            $module_class .= ' et_pb_with_background';
        }
        $output = sprintf('<div%7$s class="et_pb_section%3$s%4$s%5$s%6$s%8$s%12$s%13$s">
				%11$s
				%9$s
					%2$s
					%1$s
				%10$s
			</div> <!-- .et_pb_section -->', do_shortcode(et_pb_fix_shortcodes($content)), $background_video, '' !== $background_video ? ' et_pb_section_video et_pb_preload' : '', 'off' !== $inner_shadow && !('' !== $background_image && 'on' === $parallax && 'off' === $parallax_method) ? ' et_pb_inner_shadow' : '', 'on' === $parallax ? ' et_pb_section_parallax' : '', 'off' !== $fullwidth ? ' et_pb_fullwidth_section' : '', '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '', 'on' === $specialty ? sprintf('<div class="et_pb_row%1$s">', $gutter_class) : '', 'on' === $specialty ? '</div> <!-- .et_pb_row -->' : '', '' !== $background_image && 'on' === $parallax ? sprintf('<div class="et_parallax_bg%2$s%3$s" style="background-image: url(%1$s);"></div>', esc_attr($background_image), 'off' === $parallax_method ? ' et_pb_parallax_css' : '', 'off' !== $inner_shadow && 'off' === $parallax_method ? ' et_pb_inner_shadow' : '') : '', 'on' === $specialty ? ' et_section_specialty' : ' et_section_regular', 'on' === $transparent_background ? ' et_section_transparent' : '');
        return $output;
    }
					<div class="<?php 
echo esc_attr(apply_filters('et_pb_preview_wrap_class', 'entry-content post-content entry content'));
?>
">

					<?php 
if (isset($_POST['shortcode'])) {
    if (!isset($_POST['et_pb_preview_nonce']) || !wp_verify_nonce($_POST['et_pb_preview_nonce'], 'et_pb_preview_nonce')) {
        // Auth nonce
        printf('<p class="et-pb-preview-message">%1$s</p>', esc_html__('Authentication failed. You cannot preview this item.', 'et_builder'));
    } elseif (!current_user_can('edit_posts')) {
        // Auth user
        printf('<p class="et-pb-preview-message">%1$s</p>', esc_html__('Authentication failed. You have no permission to preview this item.', 'et_builder'));
    } else {
        // process content for builder plugin
        if (et_is_builder_plugin_active()) {
            $content = do_shortcode(wp_unslash($_POST['shortcode']));
            $content = str_replace(']]>', ']]&gt;', $content);
            $outer_class = apply_filters('et_builder_outer_content_class', array('et_builder_outer_content'));
            $outer_classes = implode(' ', $outer_class);
            $outer_id = apply_filters("et_builder_outer_content_id", "et_builder_outer_content");
            $inner_class = apply_filters('et_builder_inner_content_class', array('et_builder_inner_content'));
            $inner_classes = implode(' ', $inner_class);
            $content = sprintf('<div class="%2$s" id="%4$s">
											<div class="%3$s">
												%1$s
											</div>
										</div>', $content, esc_attr($outer_classes), esc_attr($inner_classes), esc_attr($outer_id));
        } else {
            $content = apply_filters('the_content', wp_unslash($_POST['shortcode']));
            $content = str_replace(']]>', ']]&gt;', $content);
Beispiel #7
0
    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $background_color = $this->shortcode_atts['background_color'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $text_orientation = $this->shortcode_atts['text_orientation'];
        $menu_id = $this->shortcode_atts['menu_id'];
        $submenu_direction = $this->shortcode_atts['submenu_direction'];
        $fullwidth_menu = $this->shortcode_atts['fullwidth_menu'] === 'on' ? ' et_pb_fullwidth_menu_fullwidth' : '';
        $active_link_color = $this->shortcode_atts['active_link_color'];
        $dropdown_menu_bg_color = $this->shortcode_atts['dropdown_menu_bg_color'];
        $dropdown_menu_line_color = $this->shortcode_atts['dropdown_menu_line_color'];
        $dropdown_menu_text_color = $this->shortcode_atts['dropdown_menu_text_color'];
        $dropdown_menu_animation = $this->shortcode_atts['dropdown_menu_animation'];
        $mobile_menu_bg_color = $this->shortcode_atts['mobile_menu_bg_color'];
        $mobile_menu_text_color = $this->shortcode_atts['mobile_menu_text_color'];
        if (is_rtl() && 'left' === $text_orientation) {
            $text_orientation = 'right';
        }
        $style = '';
        if ('' !== $background_color) {
            $style .= sprintf(' style="background-color: %s;"', esc_attr($background_color));
        }
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation} et_dropdown_animation_{$dropdown_menu_animation}{$fullwidth_menu}";
        $menu = '<nav class="fullwidth-menu-nav">';
        $menuClass = 'fullwidth-menu nav';
        if (!et_is_builder_plugin_active() && 'on' == et_get_option('divi_disable_toptier')) {
            $menuClass .= ' et_disable_top_tier';
        }
        $menuClass .= '' !== $submenu_direction ? sprintf(' %s', esc_attr($submenu_direction)) : '';
        $primaryNav = '';
        $menu_args = array('theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => '', 'echo' => false);
        if ('' !== $menu_id) {
            $menu_args['menu'] = (int) $menu_id;
        }
        $primaryNav = wp_nav_menu(apply_filters('et_fullwidth_menu_args', $menu_args));
        if ('' == $primaryNav) {
            $menu .= sprintf('<ul class="%1$s">
					%2$s
				</ul>', esc_attr($menuClass), !et_is_builder_plugin_active() && 'on' === et_get_option('divi_home_link') ? sprintf('<li%1$s><a href="%2$s">%3$s</a></li>', is_home() ? ' class="current_page_item"' : '', esc_url(home_url('/')), esc_html_e('Home', 'et_builder')) : '');
            ob_start();
            // @todo: check if Fullwidth Menu module works fine with no menu selected in settings
            if (et_is_builder_plugin_active()) {
                wp_page_menu();
            } else {
                show_page_menu($menuClass, false, false);
                show_categories_menu($menuClass, false);
            }
            $menu .= ob_get_contents();
            ob_end_clean();
        } else {
            $menu .= $primaryNav;
        }
        $menu .= '</nav>';
        if ('' !== $active_link_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu ul li a:active', 'declaration' => sprintf('color: %1$s !important;', esc_html($active_link_color))));
        }
        if ('' !== $dropdown_menu_bg_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .nav li ul', 'declaration' => sprintf('background-color: %1$s !important;', esc_html($dropdown_menu_bg_color))));
        }
        if ('' !== $dropdown_menu_line_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .nav li ul', 'declaration' => sprintf('border-color: %1$s;', esc_html($dropdown_menu_line_color))));
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .et_mobile_menu', 'declaration' => sprintf('border-color: %1$s;', esc_html($dropdown_menu_line_color))));
        }
        if ('' !== $dropdown_menu_text_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .nav li ul a', 'declaration' => sprintf('color: %1$s !important;', esc_html($dropdown_menu_text_color))));
        }
        if ('' !== $mobile_menu_bg_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .et_mobile_menu, %%order_class%%.et_pb_fullwidth_menu .et_mobile_menu ul', 'declaration' => sprintf('background-color: %1$s !important;', esc_html($mobile_menu_bg_color))));
        }
        if ('' !== $mobile_menu_text_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_fullwidth_menu .et_mobile_menu a', 'declaration' => sprintf('color: %1$s !important;', esc_html($mobile_menu_text_color))));
        }
        $output = sprintf('<div%4$s class="et_pb_fullwidth_menu%3$s%5$s"%2$s%6$s>
				<div class="et_pb_row clearfix">
					%1$s
					<div class="et_mobile_nav_menu">
						<a href="#" class="mobile_nav closed">
							<span class="mobile_menu_bar"></span>
						</a>
					</div>
				</div>
			</div>', $menu, $style, esc_attr($class), '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '', '' !== $style ? sprintf(' data-bg_color=%1$s', esc_attr($background_color)) : '');
        return $output;
    }
Beispiel #8
0
    /**
     * Get fullwidth menu markup for fullwidth menu module
     *
     * @return string of fullwidth menu markup
     */
    static function get_fullwidth_menu($args = array())
    {
        $defaults = array('submenu_direction' => '', 'menu_id' => '');
        // modify the menu item to include the required data
        add_filter('wp_setup_nav_menu_item', array('ET_Builder_Module_Fullwidth_Menu', 'modify_fullwidth_menu_item'));
        $args = wp_parse_args($args, $defaults);
        $menu = '<nav class="fullwidth-menu-nav">';
        $menuClass = 'fullwidth-menu nav';
        if (!et_is_builder_plugin_active() && 'on' == et_get_option('divi_disable_toptier')) {
            $menuClass .= ' et_disable_top_tier';
        }
        $menuClass .= '' !== $args['submenu_direction'] ? sprintf(' %s', esc_attr($args['submenu_direction'])) : '';
        $primaryNav = '';
        $menu_args = array('theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => '', 'echo' => false);
        if ('' !== $args['menu_id']) {
            $menu_args['menu'] = (int) $args['menu_id'];
        }
        $primaryNav = wp_nav_menu(apply_filters('et_fullwidth_menu_args', $menu_args));
        if ('' == $primaryNav) {
            $menu .= sprintf('<ul class="%1$s">
					%2$s', esc_attr($menuClass), !et_is_builder_plugin_active() && 'on' === et_get_option('divi_home_link') ? sprintf('<li%1$s><a href="%2$s">%3$s</a></li>', is_home() ? ' class="current_page_item"' : '', esc_url(home_url('/')), esc_html__('Home', 'et_builder')) : '');
            ob_start();
            // @todo: check if Fullwidth Menu module works fine with no menu selected in settings
            if (et_is_builder_plugin_active()) {
                wp_page_menu();
            } else {
                show_page_menu($menuClass, false, false);
                show_categories_menu($menuClass, false);
            }
            $menu .= ob_get_contents();
            $menu .= '</ul>';
            ob_end_clean();
        } else {
            $menu .= $primaryNav;
        }
        $menu .= '</nav>';
        remove_filter('wp_setup_nav_menu_item', array('ET_Builder_Module_Fullwidth_Menu', 'modify_fullwidth_menu_item'));
        return $menu;
    }
Beispiel #9
0
/**
 *
 * Generates array of all Role options
 *
 */
function et_pb_all_role_options()
{
    // get all the modules and build array of capabilities for them
    $all_modules_array = json_decode(ET_Builder_Element::get_modules_js_array('page'), true);
    $module_capabilies = array();
    foreach ($all_modules_array as $module => $module_details) {
        if (!in_array($module_details['label'], array('et_pb_section', 'et_pb_row', 'et_pb_row_inner', 'et_pb_column'))) {
            $module_capabilies[$module_details['label']] = array('name' => sanitize_text_field($module_details['title']), 'default' => 'on');
        }
    }
    // we need to display some options only when theme activated
    $theme_only_options = !et_is_builder_plugin_active() ? array('theme_customizer' => array('name' => esc_html__('Theme Customizer', 'et_builder'), 'default' => 'on', 'applicability' => array('administrator')), 'module_customizer' => array('name' => esc_html__('Module Customizer', 'et_builder'), 'default' => 'on', 'applicability' => array('administrator'))) : array();
    $all_role_options = array('general_capabilities' => array('section_title' => '', 'options' => array('theme_options' => array('name' => et_is_builder_plugin_active() ? esc_html__('Plugin Options', 'et_builder') : esc_html__('Theme Options', 'et_builder'), 'default' => 'on', 'applicability' => array('administrator')), 'divi_library' => array('name' => esc_html__('Divi Library', 'et_builder'), 'default' => 'on'), 'page_options' => array('name' => esc_html__('Page Options', 'et_builder'), 'default' => 'on'))), 'builder_capabilities' => array('section_title' => esc_html__('Builder Interface', 'et_builder'), 'options' => array('add_module' => array('name' => esc_html__('Add/Delete Item', 'et_builder'), 'default' => 'on'), 'edit_module' => array('name' => esc_html__('Edit Item', 'et_builder'), 'default' => 'on'), 'move_module' => array('name' => esc_html__('Move Item', 'et_builder'), 'default' => 'on'), 'disable_module' => array('name' => esc_html__('Disable Item', 'et_builder'), 'default' => 'on'), 'lock_module' => array('name' => esc_html__('Lock Item', 'et_builder'), 'default' => 'on'), 'divi_builder_control' => array('name' => esc_html__('Toggle Divi Builder', 'et_builder'), 'default' => 'on'), 'load_layout' => array('name' => esc_html__('Load Layout', 'et_builder'), 'default' => 'on'))), 'library_capabilities' => array('section_title' => esc_html__('Library Settings', 'et_builder'), 'options' => array('save_library' => array('name' => esc_html__('Save To Library', 'et_builder'), 'default' => 'on'), 'add_library' => array('name' => esc_html__('Add From Library', 'et_builder'), 'default' => 'on'), 'edit_global_library' => array('name' => esc_html__('Edit Global Items', 'et_builder'), 'default' => 'on'))), 'module_tabs' => array('section_title' => esc_html__('Settings Tabs', 'et_builder'), 'options' => array('general_settings' => array('name' => esc_html__('General Settings', 'et_builder'), 'default' => 'on'), 'advanced_settings' => array('name' => esc_html__('Advanced Settings', 'et_builder'), 'default' => 'on'), 'custom_css_settings' => array('name' => esc_html__('Custom CSS', 'et_builder'), 'default' => 'on'))), 'general_module_capabilities' => array('section_title' => esc_html__('Settings Types', 'et_builder'), 'options' => array('edit_colors' => array('name' => esc_html__('Edit Colors', 'et_builder'), 'default' => 'on'), 'edit_content' => array('name' => esc_html__('Edit Content', 'et_builder'), 'default' => 'on'), 'edit_fonts' => array('name' => esc_html__('Edit Fonts', 'et_builder'), 'default' => 'on'), 'edit_buttons' => array('name' => esc_html__('Edit Buttons', 'et_builder'), 'default' => 'on'), 'edit_layout' => array('name' => esc_html__('Edit Layout', 'et_builder'), 'default' => 'on'), 'edit_configuration' => array('name' => esc_html__('Edit Configuration', 'et_builder'), 'default' => 'on'))), 'module_capabilies' => array('section_title' => esc_html__('Module Use', 'et_builder'), 'options' => $module_capabilies));
    $all_role_options['general_capabilities']['options'] = array_merge($all_role_options['general_capabilities']['options'], $theme_only_options);
    return $all_role_options;
}
 static function set_style($function_name, $style)
 {
     $order_class_name = self::get_module_order_class($function_name);
     $selector = str_replace('%%order_class%%', ".{$order_class_name}", $style['selector']);
     $selector = str_replace('%order_class%', ".{$order_class_name}", $selector);
     // Prepend .et_divi_builder class before all CSS rules in the Divi Builder plugin
     if (et_is_builder_plugin_active()) {
         $selector = ".et_divi_builder #et_builder_outer_content {$selector}";
     }
     $declaration = $style['declaration'];
     // New lines are saved as || in CSS Custom settings, remove them
     $declaration = preg_replace('/(\\|\\|)/i', '', $declaration);
     $media_query = isset($style['media_query']) ? $style['media_query'] : 'general';
     if (isset(self::$styles[$media_query][$selector]['declaration'])) {
         self::$styles[$media_query][$selector]['declaration'] = sprintf('%1$s %2$s', self::$styles[$media_query][$selector]['declaration'], $declaration);
     } else {
         self::$styles[$media_query][$selector]['declaration'] = $declaration;
     }
     if (isset($style['priority'])) {
         self::$styles[$media_query][$selector]['priority'] = (int) $style['priority'];
     }
 }
 static function set_style($function_name, $style)
 {
     // do not process all the styles if FB enabled. Only those for modules without fb support
     if (et_fb_is_enabled() && !in_array($function_name, self::get_fb_unsupported_modules())) {
         return;
     }
     $order_class_name = self::get_module_order_class($function_name);
     // Prepend .et_divi_builder class before all CSS rules in the Divi Builder plugin
     if (et_is_builder_plugin_active()) {
         $order_class_name = "et_divi_builder #et_builder_outer_content .{$order_class_name}";
     }
     $selector = str_replace('%%order_class%%', ".{$order_class_name}", $style['selector']);
     $selector = str_replace('%order_class%', ".{$order_class_name}", $selector);
     $selector = apply_filters('et_pb_set_style_selector', $selector, $function_name);
     $declaration = $style['declaration'];
     // New lines are saved as || in CSS Custom settings, remove them
     $declaration = preg_replace('/(\\|\\|)/i', '', $declaration);
     $media_query = isset($style['media_query']) ? $style['media_query'] : 'general';
     if (isset(self::$styles[$media_query][$selector]['declaration'])) {
         self::$styles[$media_query][$selector]['declaration'] = sprintf('%1$s %2$s', self::$styles[$media_query][$selector]['declaration'], $declaration);
     } else {
         self::$styles[$media_query][$selector]['declaration'] = $declaration;
     }
     if (isset($style['priority'])) {
         self::$styles[$media_query][$selector]['priority'] = (int) $style['priority'];
     }
 }
Beispiel #12
0
 function et_pb_get_aweber_lists($regenerate_aweber_list = 'off')
 {
     $lists = array();
     $account = et_pb_get_aweber_account();
     if (!et_is_builder_plugin_active()) {
         $regenerate_aweber_list = et_get_option('divi_regenerate_aweber_lists', 'false');
     }
     if (!$account) {
         return false;
     }
     if ('on' === $regenerate_aweber_list || false === ($et_pb_aweber_lists = get_transient('et_pb_aweber_lists'))) {
         if (!class_exists('AWeberAPI')) {
             require_once ET_BUILDER_DIR . 'subscription/aweber/aweber_api.php';
         }
         $aweber_lists = $account->lists;
         if (isset($aweber_lists)) {
             foreach ($aweber_lists as $list) {
                 $lists[$list->id] = $list->name;
             }
         }
         set_transient('et_pb_aweber_lists', $lists, 60 * 60 * 24);
     } else {
         $lists = $et_pb_aweber_lists;
     }
     return $lists;
 }
 function et_pb_get_aweber_account()
 {
     if (!class_exists('AWeberAPI')) {
         require_once ET_BUILDER_DIR . 'subscription/aweber/aweber_api.php';
     }
     if (et_is_builder_plugin_active()) {
         $aweber_api_option = get_option('et_pb_builder_options');
         $consumer_key = isset($aweber_api_option['aweber_consumer_key']) ? $aweber_api_option['aweber_consumer_key'] : '';
         $consumer_secret = isset($aweber_api_option['aweber_consumer_secret']) ? $aweber_api_option['aweber_consumer_secret'] : '';
         $access_key = isset($aweber_api_option['aweber_access_key']) ? $aweber_api_option['aweber_access_key'] : '';
         $access_secret = isset($aweber_api_option['aweber_access_secret']) ? $aweber_api_option['aweber_access_secret'] : '';
     } else {
         $consumer_key = et_get_option('divi_aweber_consumer_key');
         $consumer_secret = et_get_option('divi_aweber_consumer_secret');
         $access_key = et_get_option('divi_aweber_access_key');
         $access_secret = et_get_option('divi_aweber_access_secret');
     }
     if (!empty($consumer_key) && !empty($consumer_secret) && !empty($access_key) && !empty($access_secret)) {
         try {
             // Aweber requires curl extension to be enabled
             if (!function_exists('curl_init')) {
                 return false;
             }
             $aweber = new AWeberAPI($consumer_key, $consumer_secret);
             if (!$aweber) {
                 return false;
             }
             $account = $aweber->getAccount($access_key, $access_secret);
         } catch (Exception $exc) {
             return false;
         }
     } else {
         return false;
     }
     return $account;
 }
Beispiel #14
0
function et_pb_get_options_page_link()
{
    if (et_is_builder_plugin_active()) {
        return admin_url('admin.php?page=et_divi_options#tab_et_dashboard_tab_content_api_main');
    }
    return apply_filters('et_pb_theme_options_link', admin_url('admin.php?page=et_divi_options'));
}