本文整理汇总了PHP中et_builder_process_range_value函数的典型用法代码示例。如果您正苦于以下问题:PHP et_builder_process_range_value函数的具体用法?PHP et_builder_process_range_value怎么用?PHP et_builder_process_range_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了et_builder_process_range_value函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
/**
* Cached $wp_filter so it can be restored at the end of the callback.
* This is needed because this callback uses the_content filter / calls a function
* which uses the_content filter. WordPress doesn't support nested filter
*/
global $wp_filter;
$wp_filter_cache = $wp_filter;
$module_id = $this->shortcode_atts['module_id'];
$module_class = $this->shortcode_atts['module_class'];
$show_arrows = $this->shortcode_atts['show_arrows'];
$show_pagination = $this->shortcode_atts['show_pagination'];
$parallax = $this->shortcode_atts['parallax'];
$parallax_method = $this->shortcode_atts['parallax_method'];
$auto = $this->shortcode_atts['auto'];
$auto_speed = $this->shortcode_atts['auto_speed'];
$auto_ignore_hover = $this->shortcode_atts['auto_ignore_hover'];
$top_padding = $this->shortcode_atts['top_padding'];
$body_font_size = $this->shortcode_atts['body_font_size'];
$bottom_padding = $this->shortcode_atts['bottom_padding'];
$remove_inner_shadow = $this->shortcode_atts['remove_inner_shadow'];
$hide_content_on_mobile = $this->shortcode_atts['hide_content_on_mobile'];
$hide_cta_on_mobile = $this->shortcode_atts['hide_cta_on_mobile'];
$show_image_video_mobile = $this->shortcode_atts['show_image_video_mobile'];
$background_position = $this->shortcode_atts['background_position'];
$background_size = $this->shortcode_atts['background_size'];
$posts_number = $this->shortcode_atts['posts_number'];
$include_categories = $this->shortcode_atts['include_categories'];
$show_more_button = $this->shortcode_atts['show_more_button'];
$more_text = $this->shortcode_atts['more_text'];
$content_source = $this->shortcode_atts['content_source'];
$background_color = $this->shortcode_atts['background_color'];
$show_image = $this->shortcode_atts['show_image'];
$image_placement = $this->shortcode_atts['image_placement'];
$background_image = $this->shortcode_atts['background_image'];
$background_layout = $this->shortcode_atts['background_layout'];
$use_bg_overlay = $this->shortcode_atts['use_bg_overlay'];
$bg_overlay_color = $this->shortcode_atts['bg_overlay_color'];
$use_text_overlay = $this->shortcode_atts['use_text_overlay'];
$text_overlay_color = $this->shortcode_atts['text_overlay_color'];
$orderby = $this->shortcode_atts['orderby'];
$show_meta = $this->shortcode_atts['show_meta'];
$button_custom = $this->shortcode_atts['custom_button'];
$custom_icon = $this->shortcode_atts['button_icon'];
$use_manual_excerpt = $this->shortcode_atts['use_manual_excerpt'];
$excerpt_length = $this->shortcode_atts['excerpt_length'];
$text_border_radius = $this->shortcode_atts['text_border_radius'];
$dot_nav_custom_color = $this->shortcode_atts['dot_nav_custom_color'];
$arrows_custom_color = $this->shortcode_atts['arrows_custom_color'];
$top_padding_tablet = $this->shortcode_atts['top_padding_tablet'];
$top_padding_phone = $this->shortcode_atts['top_padding_phone'];
$bottom_padding_tablet = $this->shortcode_atts['bottom_padding_tablet'];
$bottom_padding_phone = $this->shortcode_atts['bottom_padding_phone'];
$module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
$hide_on_mobile_class = self::HIDE_ON_MOBILE;
if ('' !== $top_padding || '' !== $top_padding_tablet || '' !== $top_padding_phone) {
$padding_values = array('desktop' => $top_padding, 'tablet' => $top_padding_tablet, 'phone' => $top_padding_phone);
et_pb_generate_responsive_css($padding_values, '%%order_class%% .et_pb_slide_description', 'padding-top', $function_name);
}
if ('' !== $bottom_padding || '' !== $bottom_padding_tablet || '' !== $bottom_padding_phone) {
$padding_values = array('desktop' => $bottom_padding, 'tablet' => $bottom_padding_tablet, 'phone' => $bottom_padding_phone);
et_pb_generate_responsive_css($padding_values, '%%order_class%% .et_pb_slide_description', 'padding-bottom', $function_name);
}
if ('' !== $bottom_padding || '' !== $top_padding) {
ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide_description', 'declaration' => 'padding-right: 0; padding-left: 0;'));
}
if ('default' !== $background_position && 'off' === $parallax) {
$processed_position = str_replace('_', ' ', $background_position);
ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf('background-position: %1$s;', esc_html($processed_position))));
}
if ('default' !== $background_size && 'off' === $parallax) {
ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf('-moz-background-size: %1$s;
-webkit-background-size: %1$s;
background-size: %1$s;', esc_html($background_size))));
if ('initial' === $background_size) {
ET_Builder_Module::set_style($function_name, array('selector' => 'body.ie %%order_class%% .et_pb_slide', 'declaration' => sprintf('-moz-background-size: %1$s;
-webkit-background-size: %1$s;
background-size: %1$s;', 'auto')));
}
}
if ('' !== $background_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_post_slider', 'declaration' => sprintf('background-color: %1$s;', esc_html($background_color))));
}
if ('' !== $background_image) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%, %%order_class%%.et_pb_bg_layout_dark, %%order_class%%.et_pb_bg_layout_light', 'declaration' => sprintf('background-image: url(%1$s);', esc_url($background_image))));
}
if ('on' === $use_bg_overlay && '' !== $bg_overlay_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide .et_pb_slide_overlay_container', 'declaration' => sprintf('background-color: %1$s;', esc_html($bg_overlay_color))));
}
if ('on' === $use_text_overlay && '' !== $text_overlay_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide .et_pb_slide_title, %%order_class%% .et_pb_slide .et_pb_slide_content', 'declaration' => sprintf('background-color: %1$s;', esc_html($text_overlay_color))));
}
if ('' !== $text_border_radius) {
$border_radius_value = et_builder_process_range_value($text_border_radius);
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_slider_with_text_overlay h2.et_pb_slide_title', 'declaration' => sprintf('-webkit-border-top-left-radius: %1$s;
-webkit-border-top-right-radius: %1$s;
-moz-border-radius-topleft: %1$s;
-moz-border-radius-topright: %1$s;
border-top-left-radius: %1$s;
//.........这里部分代码省略.........
开发者ID:pacificano,项目名称:pacificano,代码行数:101,代码来源:main-modules.php
示例2: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
$type = $this->shortcode_atts['type'];
$specialty_columns = $this->shortcode_atts['specialty_columns'];
$saved_specialty_column_type = $this->shortcode_atts['saved_specialty_column_type'];
global $et_specialty_column_type, $et_pb_column_backgrounds, $et_pb_column_paddings, $et_pb_column_inner_backgrounds, $et_pb_column_inner_paddings, $et_pb_columns_counter, $et_pb_columns_inner_counter, $keep_column_padding_mobile, $et_pb_column_parallax, $et_pb_column_css, $et_pb_column_inner_css, $et_pb_column_paddings_mobile;
if ('et_pb_column_inner' !== $function_name) {
$et_specialty_column_type = $type;
$array_index = $et_pb_columns_counter;
$backgrounds_array = $et_pb_column_backgrounds;
$paddings_array = $et_pb_column_paddings;
$paddings_mobile_array = $et_pb_column_paddings_mobile;
$column_css_array = $et_pb_column_css;
$et_pb_columns_counter++;
} else {
$array_index = $et_pb_columns_inner_counter;
$backgrounds_array = $et_pb_column_inner_backgrounds;
$paddings_array = $et_pb_column_inner_paddings;
$column_css_array = $et_pb_column_inner_css;
$et_pb_columns_inner_counter++;
$paddings_mobile_array = isset($et_pb_column_inner_paddings_mobile);
}
$background_color = isset($backgrounds_array[$array_index][0]) ? $backgrounds_array[$array_index][0] : '';
$background_img = isset($backgrounds_array[$array_index][1]) ? $backgrounds_array[$array_index][1] : '';
$padding_values = isset($paddings_array[$array_index]) ? $paddings_array[$array_index] : array();
$padding_mobile_values = isset($paddings_mobile_array[$array_index]) ? $paddings_mobile_array[$array_index] : array();
$parallax_method = isset($et_pb_column_parallax[$array_index][0]) && 'on' === $et_pb_column_parallax[$array_index][0] ? $et_pb_column_parallax[$array_index][1] : '';
$custom_css_class = isset($column_css_array['css_class'][$array_index]) ? ' ' . $column_css_array['css_class'][$array_index] : '';
$custom_css_id = isset($column_css_array['css_id'][$array_index]) ? $column_css_array['css_id'][$array_index] : '';
$custom_css_before = isset($column_css_array['custom_css_before'][$array_index]) ? $column_css_array['custom_css_before'][$array_index] : '';
$custom_css_main = isset($column_css_array['custom_css_main'][$array_index]) ? $column_css_array['custom_css_main'][$array_index] : '';
$custom_css_after = isset($column_css_array['custom_css_after'][$array_index]) ? $column_css_array['custom_css_after'][$array_index] : '';
if ('' !== $background_color && 'rgba(0,0,0,0)' !== $background_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('background-color:%s;', esc_attr($background_color))));
}
if ('' !== $background_img && '' === $parallax_method) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('background-image:url(%s);', esc_attr($background_img))));
}
if (!empty($padding_values)) {
foreach ($padding_values as $position => $value) {
if ('' !== $value) {
$element_style = array('selector' => '%%order_class%%', 'declaration' => sprintf('%1$s:%2$s;', esc_html($position), esc_html(et_builder_process_range_value($value))));
if ('on' !== $keep_column_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, '.et_pb_row > .et_pb_column%%order_class%%', '', $function_name);
}
}
if ('' !== $custom_css_before) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%:before', 'declaration' => trim($custom_css_before)));
}
if ('' !== $custom_css_main) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => trim($custom_css_main)));
}
if ('' !== $custom_css_after) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%:after', 'declaration' => trim($custom_css_after)));
}
if ('et_pb_column_inner' === $function_name) {
if ('1_1' === $type) {
$type = '4_4';
}
$et_specialty_column_type = '' !== $saved_specialty_column_type ? $saved_specialty_column_type : $et_specialty_column_type;
switch ($et_specialty_column_type) {
case '1_2':
if ('1_2' === $type) {
$type = '1_4';
}
break;
case '2_3':
if ('1_2' === $type) {
$type = '1_3';
}
break;
case '3_4':
if ('1_2' === $type) {
$type = '3_8';
} else {
if ('1_3' === $type) {
$type = '1_4';
}
}
break;
}
}
$inner_class = 'et_pb_column_inner' === $function_name ? ' et_pb_column_inner' : '';
$class = 'et_pb_column_' . $type . $inner_class . $custom_css_class;
$class = ET_Builder_Element::add_module_order_class($class, $function_name);
//.........这里部分代码省略.........
开发者ID:pacificano,项目名称:pacificano,代码行数:101,代码来源:main-structure-elements.php
示例3: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
$module_id = $this->shortcode_atts['module_id'];
$module_class = $this->shortcode_atts['module_class'];
$max_width = $this->shortcode_atts['max_width'];
$module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
$this->shortcode_content = et_builder_replace_code_content_entities($this->shortcode_content);
if ('' !== $max_width) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('max-width: %1$s;', esc_html(et_builder_process_range_value($max_width)))));
}
$output = sprintf('<div%2$s class="et_pb_code et_pb_module%3$s">
%1$s
</div> <!-- .et_pb_code -->', $this->shortcode_content, '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
return $output;
}
开发者ID:acchs,项目名称:test,代码行数:15,代码来源:main-modules.php
示例4: process_advanced_button_options
function process_advanced_button_options($function_name)
{
if (!isset($this->advanced_options['button'])) {
return;
}
foreach ($this->advanced_options['button'] as $option_name => $option_settings) {
$button_custom = $this->shortcode_atts["custom_{$option_name}"];
$button_text_size = $this->shortcode_atts["{$option_name}_text_size"];
$button_text_color = $this->shortcode_atts["{$option_name}_text_color"];
$button_bg_color = $this->shortcode_atts["{$option_name}_bg_color"];
$button_border_width = $this->shortcode_atts["{$option_name}_border_width"];
$button_border_color = $this->shortcode_atts["{$option_name}_border_color"];
$button_border_radius = $this->shortcode_atts["{$option_name}_border_radius"];
$button_font = $this->shortcode_atts["{$option_name}_font"];
$button_letter_spacing = $this->shortcode_atts["{$option_name}_letter_spacing"];
$button_use_icon = $this->shortcode_atts["{$option_name}_use_icon"];
$button_icon = $this->shortcode_atts["{$option_name}_icon"];
$button_icon_color = $this->shortcode_atts["{$option_name}_icon_color"];
$button_icon_placement = $this->shortcode_atts["{$option_name}_icon_placement"];
$button_on_hover = $this->shortcode_atts["{$option_name}_on_hover"];
$button_text_color_hover = $this->shortcode_atts["{$option_name}_text_color_hover"];
$button_bg_color_hover = $this->shortcode_atts["{$option_name}_bg_color_hover"];
$button_border_color_hover = $this->shortcode_atts["{$option_name}_border_color_hover"];
$button_border_radius_hover = $this->shortcode_atts["{$option_name}_border_radius_hover"];
$button_letter_spacing_hover = $this->shortcode_atts["{$option_name}_letter_spacing_hover"];
if ('on' === $button_custom) {
$button_text_size = '' === $button_text_size || 'px' === $button_text_size ? '20px' : $button_text_size;
$button_text_size = '' !== $button_text_size && false === strpos($button_text_size, 'px') ? $button_text_size . 'px' : $button_text_size;
$css_element = !empty($option_settings['css']['main']) ? $option_settings['css']['main'] : $this->main_css_element . ' .et_pb_button';
$main_element_styles = sprintf('%1$s
%2$s
%3$s
%4$s
%5$s
%6$s
%7$s
%8$s
%9$s', '' !== $button_text_color ? sprintf('color:%1$s;', $button_text_color) : '', '' !== $button_bg_color ? sprintf('background:%1$s;', $button_bg_color) : '', '' !== $button_border_width && 'px' !== $button_border_width ? sprintf('border-width:%1$s !important;', et_builder_process_range_value($button_border_width)) : '', '' !== $button_border_color ? sprintf('border-color:%1$s;', $button_border_color) : '', '' !== $button_border_radius && 'px' !== $button_border_radius ? sprintf('border-radius:%1$s;', et_builder_process_range_value($button_border_radius)) : '', '' !== $button_letter_spacing && 'px' !== $button_letter_spacing ? sprintf('letter-spacing:%1$s;', et_builder_process_range_value($button_letter_spacing)) : '', '' !== $button_text_size && 'px' !== $button_text_size ? sprintf('font-size:%1$s;', et_builder_process_range_value($button_text_size)) : '', '' !== $button_font ? et_builder_set_element_font($button_font, true) : '', 'off' === $button_on_hover ? sprintf('padding-left:%1$s; padding-right: %2$s;', 'left' === $button_icon_placement ? '2em' : '0.7em', 'left' === $button_icon_placement ? '0.7em' : '2em') : '');
self::set_style($function_name, array('selector' => 'body #page-container ' . $css_element, 'declaration' => rtrim($main_element_styles)));
$main_element_styles_hover = sprintf('%1$s
%2$s
%3$s
%4$s
%5$s
%6$s', '' !== $button_text_color_hover ? sprintf('color:%1$s !important;', $button_text_color_hover) : '', '' !== $button_bg_color_hover ? sprintf('background:%1$s !important;', $button_bg_color_hover) : '', '' !== $button_border_color_hover ? sprintf('border-color:%1$s !important;', $button_border_color_hover) : '', '' !== $button_border_radius_hover ? sprintf('border-radius:%1$s;', et_builder_process_range_value($button_border_radius_hover)) : '', '' !== $button_letter_spacing_hover ? sprintf('letter-spacing:%1$spx;', $button_letter_spacing_hover) : '', 'off' === $button_on_hover ? '' : sprintf('padding-left:%1$s; padding-right: %2$s;', 'left' === $button_icon_placement ? '2em' : '0.7em', 'left' === $button_icon_placement ? '0.7em' : '2em'));
self::set_style($function_name, array('selector' => 'body #page-container ' . $css_element . ':hover', 'declaration' => rtrim($main_element_styles_hover)));
if ('off' === $button_use_icon) {
$main_element_styles_after = 'display:none !important;';
$no_icon_styles = 'padding: 0.3em 1em !important;';
self::set_style($function_name, array('selector' => 'body #page-container ' . $css_element . ',' . $css_element . ':hover', 'declaration' => rtrim($no_icon_styles)));
} else {
$button_icon_code = '' !== $button_icon ? str_replace(';', '', str_replace('&#x', '', html_entity_decode(et_pb_process_font_icon($button_icon)))) : '';
$int_font_size = intval(str_replace('px', '', $button_text_size));
if ('' !== $button_text_size) {
$button_icon_size = '35' !== $button_icon_code ? $button_text_size : $int_font_size * 1.6 . 'px';
}
$main_element_styles_after = sprintf('%1$s
%2$s
%3$s
%4$s
%5$s
%6$s
%7$s', '' !== $button_icon_color ? sprintf('color:%1$s;', $button_icon_color) : '', '' !== $button_icon_code ? sprintf('line-height:%1$s;', '35' !== $button_icon_code ? '1.7em' : '1em') : '', '' !== $button_icon_code ? sprintf('font-size:%1$s !important;', $button_icon_size) : '', sprintf('opacity:%1$s;', 'on' === $button_on_hover ? '0' : '1'), 'off' !== $button_on_hover && '' !== $button_icon_code ? sprintf('margin-left:%1$s;left:%2$s;', 'left' === $button_icon_placement ? '0' : '-1em', 'left' === $button_icon_placement ? '1em' : 'auto') : '', 'off' === $button_on_hover ? sprintf('margin-left:%1$s;left:%2$s;', 'left' === $button_icon_placement ? '0' : '.3em', 'left' === $button_icon_placement ? '0.15em' : 'auto') : '', 'on' === $button_use_icon ? 'display: inline-block;' : '');
$hover_after_styles = sprintf('%1$s
%2$s
%3$s', '' !== $button_icon_code ? sprintf('margin-left:%1$s;', '35' !== $button_icon_code ? '.3em' : '0') : '', '' !== $button_icon_code ? sprintf('left:%1$s;margin-left:%2$s;', 'left' === $button_icon_placement ? '0.15em' : 'auto', '35' !== $button_icon_code ? '.3em' : '0') : '', 'on' === $button_on_hover ? 'opacity: 1;' : '');
self::set_style($function_name, array('selector' => 'body #page-container ' . $css_element . ':hover:after', 'declaration' => rtrim($hover_after_styles)));
if ('' === $button_icon) {
$default_icons_size = $int_font_size * 1.6 . 'px';
$custom_icon_size = $button_text_size;
self::set_style($function_name, array('selector' => 'body #page-container ' . $css_element . ':after', 'declaration' => sprintf('font-size:%1$s;', $default_icons_size)));
self::set_style($function_name, array('selector' => 'body.et_button_custom_icon #page-container ' . $css_element . ':after', 'declaration' => sprintf('font-size:%1$s;', $custom_icon_size)));
}
}
self::set_style($function_name, array('selector' => 'body #page-container ' . $css_element . ':after', 'declaration' => rtrim($main_element_styles_after)));
}
}
}
开发者ID:acchs,项目名称:test,代码行数:78,代码来源:class-et-builder-element.php
示例5: et_builder_get_element_style_css
function et_builder_get_element_style_css($value, $property = 'margin', $use_important = false)
{
$style = '';
$values = explode('|', $value);
if (!empty($values)) {
$element_style = '';
$i = 0;
$values = array_map('trim', $values);
$positions = array('top', 'right', 'bottom', 'left');
foreach ($values as $element_style_value) {
if ('' !== $element_style_value) {
$element_style .= sprintf('%3$s-%1$s: %2$s%4$s; ', esc_attr($positions[$i]), esc_attr(et_builder_process_range_value($element_style_value)), esc_attr($property), $use_important ? ' !important' : '');
}
$i++;
}
$style .= rtrim($element_style);
}
return $style;
}
开发者ID:iinspiration,项目名称:theme,代码行数:19,代码来源:functions.php
示例6: process_advanced_border_options
function process_advanced_border_options($function_name)
{
if (!isset($this->advanced_options['border'])) {
return;
}
$style = '';
$settings = $this->advanced_options['border'];
$use_border_color = $this->shortcode_atts['use_border_color'];
$border_color = $this->shortcode_atts['border_color'];
$border_width = $this->shortcode_atts['border_width'];
$border_style = $this->shortcode_atts['border_style'];
if ('on' === $use_border_color) {
$border_declaration_html = sprintf('%1$s %3$s %2$s', esc_attr(et_builder_process_range_value($border_width)), esc_attr($border_color), esc_attr($border_style));
$style .= "border: {$border_declaration_html}; ";
}
if ('' !== $style) {
$css_element = !empty($settings['css']['main']) ? $settings['css']['main'] : $this->main_css_element;
self::set_style($function_name, array('selector' => $css_element, 'declaration' => rtrim($style), 'priority' => $this->_style_priority));
if (!empty($border_declaration_html) && isset($settings['additional_elements']) && is_array($settings['additional_elements'])) {
foreach ($settings['additional_elements'] as $selector => $border_type) {
$style = '';
if (!is_array($border_type)) {
continue;
}
foreach ($border_type as $direction) {
$style .= sprintf('border-%1$s: %2$s; ', 'all' !== $border_type ? esc_html($direction) : '', $border_declaration_html);
}
self::set_style($function_name, array('selector' => $selector, 'declaration' => rtrim($style), 'priority' => $this->_style_priority));
}
}
}
}
开发者ID:Lumbe,项目名称:dev_servus,代码行数:32,代码来源:class-et-builder-element.php
示例7: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
$type = $this->shortcode_atts['type'];
$specialty_columns = $this->shortcode_atts['specialty_columns'];
$saved_specialty_column_type = $this->shortcode_atts['saved_specialty_column_type'];
global $et_specialty_column_type, $et_pb_column_backgrounds, $et_pb_column_paddings, $et_pb_column_inner_backgrounds, $et_pb_column_inner_paddings, $et_pb_columns_counter, $et_pb_columns_inner_counter;
if ('et_pb_column_inner' !== $function_name) {
$et_specialty_column_type = $type;
$array_index = $et_pb_columns_counter;
$backgrounds_array = $et_pb_column_backgrounds;
$paddings_array = $et_pb_column_paddings;
$et_pb_columns_counter++;
} else {
$array_index = $et_pb_columns_inner_counter;
$backgrounds_array = $et_pb_column_inner_backgrounds;
$paddings_array = $et_pb_column_inner_paddings;
$et_pb_columns_inner_counter++;
}
$background_color = isset($backgrounds_array[$array_index][0]) ? $backgrounds_array[$array_index][0] : '';
$background_img = isset($backgrounds_array[$array_index][1]) ? $backgrounds_array[$array_index][1] : '';
$padding_values = isset($paddings_array[$array_index]) ? $paddings_array[$array_index] : array();
if ('' !== $background_color && 'rgba(0,0,0,0)' !== $background_color) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('background-color:%s;', esc_attr($background_color))));
}
if ('' !== $background_img) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('background-image:url(%s);', esc_attr($background_img))));
}
if (!empty($padding_values)) {
foreach ($padding_values as $position => $value) {
if ('' !== $value) {
ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%', 'declaration' => sprintf('%1$s:%2$s;', esc_html($position), esc_html(et_builder_process_range_value($value)))));
}
}
}
if ('et_pb_column_inner' === $function_name) {
$et_specialty_column_type = '' !== $saved_specialty_column_type ? $saved_specialty_column_type : $et_specialty_column_type;
switch ($et_specialty_column_type) {
case '1_2':
if ('1_2' === $type) {
$type = '1_4';
}
break;
case '2_3':
if ('1_2' === $type) {
$type = '1_3';
}
break;
case '3_4':
if ('1_2' === $type) {
$type = '3_8';
} else {
if ('1_3' === $type) {
$type = '1_4';
}
}
break;
}
}
$inner_class = 'et_pb_column_inner' === $function_name ? ' et_pb_column_inner' : '';
$class = 'et_pb_column_' . $type . $inner_class;
$inner_content = do_shortcode(et_pb_fix_shortcodes($content));
$class .= '' == trim($inner_content) ? ' et_pb_column_empty' : '';
$class = ET_Builder_Element::add_module_order_class($class, $function_name);
$class .= 'et_pb_column_inner' !== $function_name && '' !== $specialty_columns ? ' et_pb_specialty_column' : '';
$output = sprintf('<div class="et_pb_column %1$s">
%2$s
</div> <!-- .et_pb_column -->', esc_attr($class), $inner_content);
return $output;
}
开发者ID:Lumbe,项目名称:dev_servus,代码行数:69,代码来源:main-structure-elements.php
示例8: et_pb_generate_responsive_css
function et_pb_generate_responsive_css($values_array, $css_selector, $css_property, $function_name, $additional_css = '')
{
if (!empty($values_array)) {
foreach ($values_array as $device => $current_value) {
if ('' === $current_value) {
continue;
}
$declaration = '';
// value can be provided as a string or array in following format - array( 'property_1' => 'value_1', 'property_2' => 'property_2', ... , 'property_n' => 'value_n' )
if (is_array($current_value) && !empty($current_value)) {
foreach ($current_value as $this_property => $this_value) {
if ('' === $this_value) {
continue;
}
$declaration .= sprintf('%1$s: %2$s%3$s', $this_property, esc_html(et_builder_process_range_value($this_value)), '' !== $additional_css ? $additional_css : ';');
}
} else {
$declaration = sprintf('%1$s: %2$s%3$s', $css_property, esc_html(et_builder_process_range_value($current_value)), '' !== $additional_css ? $additional_css : ';');
}
if ('' === $declaration) {
continue;
}
$style = array('selector' => $css_selector, 'declaration' => $declaration);
if ('desktop' !== $device) {
$current_media_query = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
$style['media_query'] = ET_Builder_Element::get_media_query($current_media_query);
}
ET_Builder_Element::set_style($function_name, $style);
}
}
}
开发者ID:smoobs,项目名称:gft,代码行数:31,代码来源:functions.php
示例9: shortcode_callback
function shortcode_callback($atts, $content = null, $function_name)
{
$this->shortcode_atts['ads'] = self::$ads_data;
self::$ads_data = array();
// reset
$border_style = $this->get_border_style_output();
if (!empty($border_style)) {
$this->shortcode_atts['border_style'] = $border_style;
$this->shortcode_atts['border_class'] = 'bordered';
} else {
$this->shortcode_atts['border_style'] = '';
$this->shortcode_atts['border_class'] = '';
}
$this->shortcode_atts['header_text_color'] = $this->shortcode_atts['header_text_color'];
$this->shortcode_atts['module_class'] = ET_Builder_Element::add_module_order_class($this->shortcode_atts['module_class'], $this->slug);
// Adding styling classes to module
if (!empty($this->shortcode_atts['remove_drop_shadow']) && 'on' === $this->shortcode_atts['remove_drop_shadow']) {
$this->shortcode_atts['module_class'] = $this->shortcode_atts['module_class'] . ' et_pb_no_drop_shadow';
}
// Print styling for general options
if (isset($this->shortcode_atts['border_radius']) && '' !== $this->shortcode_atts['border_radius']) {
ET_Builder_Module::set_style($this->slug, array('selector' => '%%order_class%%.et_pb_extra_module', 'declaration' => sprintf('-moz-border-radius: %1$s;
-webkit-border-radius: %1$s;
border-radius: %1$s;', esc_html($this->shortcode_atts['border_radius']))));
}
if (isset($this->shortcode_atts['max_width']) && '' !== $this->shortcode_atts['max_width']) {
ET_Builder_Module::set_style($this->slug, array('selector' => '%%order_class%%', 'declaration' => sprintf('max-width: %1$s;', esc_html(et_builder_process_range_value($this->shortcode_atts['max_width'])))));
}
}
开发者ID:rthburke,项目名称:fltHub,代码行数:29,代码来源:modules.php
注:本文中的et_builder_process_range_value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论