本文整理汇总了PHP中et_is_builder_plugin_active函数的典型用法代码示例。如果您正苦于以下问题:PHP et_is_builder_plugin_active函数的具体用法?PHP et_is_builder_plugin_active怎么用?PHP et_is_builder_plugin_active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了et_is_builder_plugin_active函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extra_set_modules_default_values
/**
* 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);
}
示例2: et_builder_load_modules_styles
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)))));
}
}
示例3: et_builder_load_modules_styles
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)))));
}
}
示例4: shortcode_callback
//.........这里部分代码省略.........
$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;
}
示例5: esc_attr
<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(']]>', ']]>', $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(']]>', ']]>', $content);
示例6: shortcode_callback
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;
}
示例7: get_fullwidth_menu
/**
* 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;
}
示例8: et_pb_all_role_options
/**
*
* 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;
}
示例9: set_style
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'];
}
}
示例10: set_style
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'];
}
}
示例11: et_pb_get_aweber_lists
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;
}
示例12: et_pb_get_aweber_account
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;
}
示例13: et_pb_get_options_page_link
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'));
}