Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder
File: class-et-builder-element.php
if ( $is_border_default && method_exists( $this, '_add_additional_border_fields' ) ) {
[12500] Fix | Delete
$border = self::$_->array_get( $this->advanced_fields, 'border', array() );
[12501] Fix | Delete
}
[12502] Fix | Delete
[12503] Fix | Delete
// Do not add overflow:hidden for some modules.
[12504] Fix | Delete
$no_overflow_module = array(
[12505] Fix | Delete
'et_pb_social_media_follow',
[12506] Fix | Delete
'et_pb_social_media_follow_network',
[12507] Fix | Delete
'et_pb_menu',
[12508] Fix | Delete
'et_pb_fullwidth_menu',
[12509] Fix | Delete
);
[12510] Fix | Delete
[12511] Fix | Delete
$overflow = ! in_array( $function_name, $no_overflow_module );
[12512] Fix | Delete
$overflow_x = ! in_array( self::$_->array_get( $this->props, 'overflow-x' ), array( '', 'hidden' ) );
[12513] Fix | Delete
$overflow_y = ! in_array( self::$_->array_get( $this->props, 'overflow-y' ), array( '', 'hidden' ) );
[12514] Fix | Delete
[12515] Fix | Delete
// Remove "overflow: hidden" if both overflow-x and overflow-y are not empty or not set to "hidden"
[12516] Fix | Delete
// Add "overflow-y: hidden" if overflow-x is not empty or not set to "hidden" (or vice versa)
[12517] Fix | Delete
if ( $overflow_x && $overflow_y ) {
[12518] Fix | Delete
$overflow = false;
[12519] Fix | Delete
} else if ( $overflow_x ) {
[12520] Fix | Delete
$overflow = 'overflow-y';
[12521] Fix | Delete
} else if ( $overflow_y ) {
[12522] Fix | Delete
$overflow = 'overflow-x';
[12523] Fix | Delete
}
[12524] Fix | Delete
[12525] Fix | Delete
// Render border radii for all devices.
[12526] Fix | Delete
foreach( et_pb_responsive_options()->get_modes() as $device ) {
[12527] Fix | Delete
$border_radii_attrs = array(
[12528] Fix | Delete
'selector' => self::$_->array_get( $border, 'css.main.border_radii', $this->main_css_element ),
[12529] Fix | Delete
'declaration' => $border_field->get_radii_style( $this->props, $this->advanced_fields, $suffix, $overflow, false, $device ),
[12530] Fix | Delete
'priority' => $this->_style_priority,
[12531] Fix | Delete
);
[12532] Fix | Delete
[12533] Fix | Delete
// Set media query attribute for non-desktop.
[12534] Fix | Delete
if ( 'desktop' !== $device ) {
[12535] Fix | Delete
$media_query = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
[12536] Fix | Delete
$border_radii_attrs['media_query'] = ET_Builder_Element::get_media_query( $media_query );
[12537] Fix | Delete
}
[12538] Fix | Delete
[12539] Fix | Delete
self::set_style( $function_name, $border_radii_attrs );
[12540] Fix | Delete
}
[12541] Fix | Delete
[12542] Fix | Delete
if ( et_builder_is_hover_enabled( "border_radii$suffix", $this->props ) ) {
[12543] Fix | Delete
$main = self::$_->array_get( $border, 'css.hover', $this->main_css_element );
[12544] Fix | Delete
$main = self::$data_utils->array_get( $border, 'css.main.border_radii', $main );
[12545] Fix | Delete
$main = 'default' !== $border_name ? et_pb_hover_options()->add_hover_to_selectors( $main ) : et_pb_hover_options()->add_hover_to_order_class( $main );
[12546] Fix | Delete
$selector = self::$data_utils->array_get( $border, 'css.main.border_radii_hover', $main );
[12547] Fix | Delete
[12548] Fix | Delete
self::set_style( $function_name, array(
[12549] Fix | Delete
'selector' => $selector,
[12550] Fix | Delete
'declaration' => $border_field->get_radii_style( $this->props, $this->advanced_fields, $suffix, $overflow, true ),
[12551] Fix | Delete
'priority' => $this->_style_priority,
[12552] Fix | Delete
) );
[12553] Fix | Delete
}
[12554] Fix | Delete
[12555] Fix | Delete
// Render border styles for all devices.
[12556] Fix | Delete
foreach( et_pb_responsive_options()->get_modes() as $device ) {
[12557] Fix | Delete
$border_styles_attrs = array(
[12558] Fix | Delete
'selector' => self::$_->array_get( $border, 'css.main.border_styles', $this->main_css_element ),
[12559] Fix | Delete
'declaration' => $border_field->get_borders_style( $this->props, $this->advanced_fields, $suffix, false, $device ),
[12560] Fix | Delete
'priority' => $this->_style_priority,
[12561] Fix | Delete
);
[12562] Fix | Delete
[12563] Fix | Delete
// Set media query attribute for non-desktop.
[12564] Fix | Delete
if ( 'desktop' !== $device ) {
[12565] Fix | Delete
$media_query = 'tablet' === $device ? 'max_width_980' : 'max_width_767';
[12566] Fix | Delete
$border_styles_attrs['media_query'] = ET_Builder_Element::get_media_query( $media_query );
[12567] Fix | Delete
}
[12568] Fix | Delete
[12569] Fix | Delete
self::set_style( $function_name, $border_styles_attrs );
[12570] Fix | Delete
}
[12571] Fix | Delete
[12572] Fix | Delete
$main = self::$_->array_get( $border, 'css.hover', $this->main_css_element );
[12573] Fix | Delete
$main = self::$data_utils->array_get( $border, 'css.main.border_styles', $main );
[12574] Fix | Delete
$main = 'default' !== $border_name ? et_pb_hover_options()->add_hover_to_selectors( $main ) : et_pb_hover_options()->add_hover_to_order_class( $main );
[12575] Fix | Delete
[12576] Fix | Delete
$selector = self::$data_utils->array_get( $border, 'css.main.border_styles_hover', $main );
[12577] Fix | Delete
[12578] Fix | Delete
self::set_style( $function_name, array(
[12579] Fix | Delete
'selector' => $selector,
[12580] Fix | Delete
'declaration' => $border_field->get_borders_style( $this->props, $this->advanced_fields, $suffix, true ),
[12581] Fix | Delete
'priority' => $this->_style_priority,
[12582] Fix | Delete
) );
[12583] Fix | Delete
}
[12584] Fix | Delete
}
[12585] Fix | Delete
[12586] Fix | Delete
if ( ! $et_fb_processing_shortcode_object && $border_field->needs_border_reset_class( $function_name, $this->props ) ) {
[12587] Fix | Delete
// Try to apply old method for plugins without vb support
[12588] Fix | Delete
if ( 'on' !== $this->vb_support ) {
[12589] Fix | Delete
add_filter( "{$function_name}_shortcode_output", array( $border_field, 'add_border_reset_class' ), 10, 2 );
[12590] Fix | Delete
}
[12591] Fix | Delete
[12592] Fix | Delete
$this->add_classname( 'et_pb_with_border' );
[12593] Fix | Delete
}
[12594] Fix | Delete
[12595] Fix | Delete
if ( method_exists( $this, 'process_advanced_border_options' ) ) {
[12596] Fix | Delete
// Backwards Compatibility
[12597] Fix | Delete
// Call it after processing default fields because it's additional processing and is not replacement.
[12598] Fix | Delete
$this->process_advanced_border_options( $function_name );
[12599] Fix | Delete
}
[12600] Fix | Delete
}
[12601] Fix | Delete
[12602] Fix | Delete
function get_position_locations() {
[12603] Fix | Delete
return $this->position_locations;
[12604] Fix | Delete
}
[12605] Fix | Delete
[12606] Fix | Delete
function set_position_locations( $locations ) {
[12607] Fix | Delete
$this->position_locations = $locations;
[12608] Fix | Delete
}
[12609] Fix | Delete
[12610] Fix | Delete
function process_transform( $function_name ) {
[12611] Fix | Delete
$transform = self::$_->array_get( $this->advanced_fields, 'transform', array() );
[12612] Fix | Delete
[12613] Fix | Delete
if ( false === $transform || ! is_array( $transform ) ) {
[12614] Fix | Delete
return;
[12615] Fix | Delete
}
[12616] Fix | Delete
[12617] Fix | Delete
$selector = self::$_->array_get( $transform, 'css.main', '%%order_class%%' );
[12618] Fix | Delete
$important = self::$_->array_get( $transform, 'css.important', false );
[12619] Fix | Delete
$hover = et_pb_hover_options();
[12620] Fix | Delete
$isHoverEnabled = $hover->is_enabled( 'transform_styles', $this->props );
[12621] Fix | Delete
$isResponsiveEnabled = isset( $this->props['transform_styles_last_edited'] )
[12622] Fix | Delete
&& et_pb_get_responsive_status( $this->props['transform_styles_last_edited'] );
[12623] Fix | Delete
$responsiveDirection = isset( $this->props['animation_direction_last_edited'] )
[12624] Fix | Delete
&& et_pb_get_responsive_status( $this->props['animation_direction_last_edited'] );
[12625] Fix | Delete
$animationType = self::$_->array_get( $this->props, 'animation_style', 'none' );
[12626] Fix | Delete
[12627] Fix | Delete
/** @var $class ET_Builder_Module_Field_Transform */
[12628] Fix | Delete
$class = ET_Builder_Module_Fields_Factory::get( 'Transform' );
[12629] Fix | Delete
$class->set_props( $this->props + array( 'transforms_important' => $important ) );
[12630] Fix | Delete
[12631] Fix | Delete
$position_locations = $this->get_position_locations();
[12632] Fix | Delete
$views = array( 'desktop' );
[12633] Fix | Delete
if ( $isHoverEnabled || isset( $position_locations['hover'] ) ) {
[12634] Fix | Delete
array_push( $views, 'hover' );
[12635] Fix | Delete
}
[12636] Fix | Delete
if ( $isResponsiveEnabled || ( 'none' !== $animationType && $responsiveDirection )
[12637] Fix | Delete
|| ( isset( $position_locations['hover'] ) || isset( $position_locations['phone'] ) ) ) {
[12638] Fix | Delete
array_push( $views, 'tablet', 'phone' );
[12639] Fix | Delete
}
[12640] Fix | Delete
foreach ( $views as $view ) {
[12641] Fix | Delete
$viewSelector = $selector;
[12642] Fix | Delete
$device = $view;
[12643] Fix | Delete
if ( ! $isResponsiveEnabled && in_array( $view, array( 'phone', 'tablet' ) ) || ( 'hover' === $view && ! $isHoverEnabled ) ) {
[12644] Fix | Delete
$device = 'desktop';
[12645] Fix | Delete
}
[12646] Fix | Delete
$elements = $class->get_elements( $device );
[12647] Fix | Delete
$media_query = array();
[12648] Fix | Delete
[12649] Fix | Delete
if ( 'hover' === $view ) {
[12650] Fix | Delete
$viewSelector = $selector . ':hover';
[12651] Fix | Delete
} elseif ( 'tablet' === $view ) {
[12652] Fix | Delete
$media_query = array(
[12653] Fix | Delete
'media_query' => self::get_media_query( 'max_width_980' ),
[12654] Fix | Delete
);
[12655] Fix | Delete
} elseif ( 'phone' === $view ) {
[12656] Fix | Delete
$media_query = array(
[12657] Fix | Delete
'media_query' => self::get_media_query( 'max_width_767' ),
[12658] Fix | Delete
);
[12659] Fix | Delete
}
[12660] Fix | Delete
[12661] Fix | Delete
if ( isset( $position_locations[ $view ] ) ) {
[12662] Fix | Delete
$default_strpos = strpos( $position_locations[ $view ], '_is_default' );
[12663] Fix | Delete
$location = $position_locations[ $view ];
[12664] Fix | Delete
if ( $default_strpos !== false ) {
[12665] Fix | Delete
$location = substr( $position_locations[ $view ], 0, $default_strpos );
[12666] Fix | Delete
}
[12667] Fix | Delete
if ( ! isset( $elements['transform']['translateX'] ) ) {
[12668] Fix | Delete
if ( in_array( $location, array( 'top_center', 'bottom_center', 'center_center' ) ) ) {
[12669] Fix | Delete
$elements['transform']['translateX'] = '-50%';
[12670] Fix | Delete
} elseif ( $view !== 'desktop' ) {
[12671] Fix | Delete
$elements['transform']['translateX'] = '0px';
[12672] Fix | Delete
}
[12673] Fix | Delete
}
[12674] Fix | Delete
if ( ! isset( $elements['transform']['translateY'] ) ) {
[12675] Fix | Delete
if ( in_array( $location, array( 'center_left', 'center_right', 'center_center' ) ) ) {
[12676] Fix | Delete
$elements['transform']['translateY'] = '-50%';
[12677] Fix | Delete
} elseif ( $view !== 'desktop' ) {
[12678] Fix | Delete
$elements['transform']['translateY'] = '0px';
[12679] Fix | Delete
}
[12680] Fix | Delete
}
[12681] Fix | Delete
}
[12682] Fix | Delete
[12683] Fix | Delete
if ( ! empty( $elements['transform'] ) || ! empty( $elements['origin'] ) ) {
[12684] Fix | Delete
[12685] Fix | Delete
if ( 'hover' !== $view && ! empty( $animationType ) && 'none' !== $animationType && 'fade' !== $animationType ) {
[12686] Fix | Delete
[12687] Fix | Delete
$transformedAnimation = $class->transformedAnimation( $animationType, $elements, $function_name, $device );
[12688] Fix | Delete
[12689] Fix | Delete
if ( ! empty( $transformedAnimation ) ) {
[12690] Fix | Delete
self::set_style( $function_name, $transformedAnimation['keyframe'] + $media_query );
[12691] Fix | Delete
self::set_style( $function_name, $transformedAnimation['animationRules'] + $media_query );
[12692] Fix | Delete
self::set_style( $function_name,
[12693] Fix | Delete
array(
[12694] Fix | Delete
'selector' => $viewSelector,
[12695] Fix | Delete
'declaration' => $transformedAnimation['declaration'],
[12696] Fix | Delete
'priority' => $this->_style_priority,
[12697] Fix | Delete
) + $media_query );
[12698] Fix | Delete
}
[12699] Fix | Delete
[12700] Fix | Delete
} else {
[12701] Fix | Delete
$declaration = '';
[12702] Fix | Delete
if ( ! empty( $elements['transform'] ) ) {
[12703] Fix | Delete
$declaration .= $class->getTransformDeclaration( $elements['transform'], $view );
[12704] Fix | Delete
}
[12705] Fix | Delete
[12706] Fix | Delete
if ( ! empty( $elements['origin'] ) ) {
[12707] Fix | Delete
if ( $important ) {
[12708] Fix | Delete
array_push( $elements['origin'], '!important' );
[12709] Fix | Delete
}
[12710] Fix | Delete
$declaration .= sprintf( "transform-origin:%s;", implode( ' ', $elements['origin'] ) );
[12711] Fix | Delete
}
[12712] Fix | Delete
[12713] Fix | Delete
self::set_style( $function_name,
[12714] Fix | Delete
array(
[12715] Fix | Delete
'selector' => $viewSelector,
[12716] Fix | Delete
'declaration' => $declaration,
[12717] Fix | Delete
'priority' => $this->_style_priority,
[12718] Fix | Delete
) + $media_query );
[12719] Fix | Delete
}
[12720] Fix | Delete
}
[12721] Fix | Delete
}
[12722] Fix | Delete
}
[12723] Fix | Delete
[12724] Fix | Delete
function process_position( $function_name ) {
[12725] Fix | Delete
/** @var $position_class ET_Builder_Module_Field_Position */
[12726] Fix | Delete
$position_class = ET_Builder_Module_Fields_Factory::get( 'Position' );
[12727] Fix | Delete
$position_class->set_module( $this );
[12728] Fix | Delete
$position_class->process( $function_name );
[12729] Fix | Delete
[12730] Fix | Delete
// Expose position settings on layout block preview so necesary adjustment can be applied
[12731] Fix | Delete
if ( ET_GB_Block_Layout::is_layout_block_preview() ) {
[12732] Fix | Delete
$layout_block_settings = $position_class->get_layout_block_settings( $function_name );
[12733] Fix | Delete
[12734] Fix | Delete
if ( is_array( $layout_block_settings ) && ! empty( $layout_block_settings ) ) {
[12735] Fix | Delete
self::$layout_block_assistive_settings['position'][] = array(
[12736] Fix | Delete
'selector' => '.' . self::get_module_order_class( $function_name ),
[12737] Fix | Delete
'settings' => $layout_block_settings,
[12738] Fix | Delete
);
[12739] Fix | Delete
}
[12740] Fix | Delete
}
[12741] Fix | Delete
}
[12742] Fix | Delete
[12743] Fix | Delete
/**
[12744] Fix | Delete
* Adds Filter styles to the page custom css code
[12745] Fix | Delete
*
[12746] Fix | Delete
* Wrapper for `generate_css_filters` used for module defaults
[12747] Fix | Delete
*/
[12748] Fix | Delete
function process_advanced_filter_options( $function_name ) {
[12749] Fix | Delete
// Disable if module doesn't set advanced_fields property and has no VB support
[12750] Fix | Delete
if ( ! $this->has_vb_support() && ! $this->has_advanced_fields ) {
[12751] Fix | Delete
return;
[12752] Fix | Delete
}
[12753] Fix | Delete
[12754] Fix | Delete
// Module has to explicitly set false to disable filters options
[12755] Fix | Delete
if ( false === self::$_->array_get( $this->advanced_fields, 'filters', false ) ) {
[12756] Fix | Delete
return;
[12757] Fix | Delete
}
[12758] Fix | Delete
[12759] Fix | Delete
return $this->generate_css_filters( $function_name );
[12760] Fix | Delete
}
[12761] Fix | Delete
[12762] Fix | Delete
function process_max_width_options( $function_name ) {
[12763] Fix | Delete
// Disable if module doesn't set advanced_fields property and has no VB support
[12764] Fix | Delete
if ( ! $this->has_vb_support() && ! $this->has_advanced_fields ) {
[12765] Fix | Delete
return;
[12766] Fix | Delete
}
[12767] Fix | Delete
[12768] Fix | Delete
if ( ! is_array( self::$_->array_get( $this->advanced_fields, 'max_width', false ) ) ) {
[12769] Fix | Delete
return;
[12770] Fix | Delete
}
[12771] Fix | Delete
[12772] Fix | Delete
$max_width = self::$_->array_get( $this->advanced_fields, 'max_width', array() );
[12773] Fix | Delete
$fields = array_merge( array('' => $max_width), self::$_->array_get( $max_width, 'extra', array() ) );
[12774] Fix | Delete
[12775] Fix | Delete
[12776] Fix | Delete
foreach ( $fields as $prefix => $field ) {
[12777] Fix | Delete
$is_customized = ! self::$_->array_get( $field, 'use_max_width', true ) && ! self::$_->array_get( $field, 'use_width', true );
[12778] Fix | Delete
$hover = et_pb_hover_options();
[12779] Fix | Delete
[12780] Fix | Delete
if ( 'et_pb_section' === $this->slug && 'inner' === $prefix && 'on' !== $this->prop( 'specialty' ) ) {
[12781] Fix | Delete
// https://github.com/elegantthemes/Divi/issues/14445
[12782] Fix | Delete
// This is a hot fix due to the fact that in near future
[12783] Fix | Delete
// modules will be processed and rendered in VB
[12784] Fix | Delete
// The real solution requires handling modules fields dependencies in FE
[12785] Fix | Delete
// As section inner sizing depends on section `speciality`
[12786] Fix | Delete
continue;
[12787] Fix | Delete
}
[12788] Fix | Delete
[12789] Fix | Delete
// Max width
[12790] Fix | Delete
foreach ( array( 'width', 'max_width' ) as $key ) {
[12791] Fix | Delete
if ( ! self::$_->array_get( $field, "use_$key", true ) ) {
[12792] Fix | Delete
continue;
[12793] Fix | Delete
}
[12794] Fix | Delete
[12795] Fix | Delete
$slug = et_builder_add_prefix( $prefix, $key );
[12796] Fix | Delete
$css_prop = $this->field_to_css_prop( $key );
[12797] Fix | Delete
$option = self::$_->array_get( $this->fields_unprocessed, $slug, array() );
[12798] Fix | Delete
[12799] Fix | Delete
$width_options_css = self::$_->array_get($field, 'css', array());
[12800] Fix | Delete
$default_selector = self::$_->array_get( $width_options_css, 'main', '%%order_class%%' );
[12801] Fix | Delete
$selector = self::$_->array_get( $width_options_css, $key, $default_selector );
[12802] Fix | Delete
[12803] Fix | Delete
$desktop_default = self::$_->array_get( $option, 'default' );
[12804] Fix | Delete
$default = $desktop_default;
[12805] Fix | Delete
$width = $this->prop( $slug, $default );
[12806] Fix | Delete
[12807] Fix | Delete
$default_tablet = self::$_->array_get( $option, 'default_tablet', $width );
[12808] Fix | Delete
$width_tablet = $this->prop( "{$slug}_tablet", $default_tablet );
[12809] Fix | Delete
[12810] Fix | Delete
$default_phone = self::$_->array_get( $option, 'default_phone', $width_tablet );
[12811] Fix | Delete
$width_phone = $this->prop( "{$slug}_phone", $default_phone );
[12812] Fix | Delete
$width_hover = $hover->get_value( $slug, $this->props, '' );
[12813] Fix | Delete
[12814] Fix | Delete
$width_last_edited = $this->prop( "{$slug}_last_edited", '' );
[12815] Fix | Delete
$width_responsive_active = et_pb_get_responsive_status( $width_last_edited );
[12816] Fix | Delete
[12817] Fix | Delete
$width = $width === $default ? '' : $width;
[12818] Fix | Delete
$width_tablet = $width_tablet === $default_tablet ? '' : $width_tablet;
[12819] Fix | Delete
$width_phone = $width_phone === $default_phone ? '' : $width_phone;
[12820] Fix | Delete
[12821] Fix | Delete
if ( '' !== $width_tablet || '' !== $width_phone || '' !== $width ) {
[12822] Fix | Delete
$additional_css = $this->get_max_width_additional_css();
[12823] Fix | Delete
$width_attrs = array( $slug );
[12824] Fix | Delete
[12825] Fix | Delete
// Append !important tag
[12826] Fix | Delete
if ( isset( $width_options_css['important'] ) ) {
[12827] Fix | Delete
$additional_css = ' !important;';
[12828] Fix | Delete
}
[12829] Fix | Delete
[12830] Fix | Delete
if ( $width_responsive_active ) {
[12831] Fix | Delete
$width_values = array(
[12832] Fix | Delete
'desktop_only' => $width,
[12833] Fix | Delete
'tablet' => $width_tablet,
[12834] Fix | Delete
'phone' => $width_phone,
[12835] Fix | Delete
);
[12836] Fix | Delete
[12837] Fix | Delete
$width_attrs = array_merge( $width_attrs, array( "{$slug}_tablet", "{$slug}_phone" ) );
[12838] Fix | Delete
} else {
[12839] Fix | Delete
$width_values = array(
[12840] Fix | Delete
'desktop' => $width,
[12841] Fix | Delete
);
[12842] Fix | Delete
}
[12843] Fix | Delete
[12844] Fix | Delete
// Update $is_max_width_customized if one of max_width* value is modified
[12845] Fix | Delete
foreach ( $width_attrs as $width_attr ) {
[12846] Fix | Delete
if ( $is_customized ) {
[12847] Fix | Delete
break;
[12848] Fix | Delete
}
[12849] Fix | Delete
[12850] Fix | Delete
if ( ! in_array( self::$_->array_get($this->props, $width_attr ), array( '', $default ) ) ) {
[12851] Fix | Delete
$is_customized = true;
[12852] Fix | Delete
}
[12853] Fix | Delete
}
[12854] Fix | Delete
[12855] Fix | Delete
et_pb_generate_responsive_css(
[12856] Fix | Delete
$width_values,
[12857] Fix | Delete
$selector,
[12858] Fix | Delete
$css_prop,
[12859] Fix | Delete
$function_name,
[12860] Fix | Delete
$additional_css
[12861] Fix | Delete
);
[12862] Fix | Delete
} else if ( '' !== $default && '100%' !== $default && ! in_array( $default, array( 'auto', 'none' ) ) ) {
[12863] Fix | Delete
$is_customized = true;
[12864] Fix | Delete
}
[12865] Fix | Delete
[12866] Fix | Delete
// Hover styles
[12867] Fix | Delete
if ( '' !== $width_hover ) {
[12868] Fix | Delete
// Apply 100% max-width if there is only hover max-width set so that transition works.
[12869] Fix | Delete
$selector = isset( $width_options_css['main'] ) ? $width_options_css['main'] : '%%order_class%%';
[12870] Fix | Delete
$is_customized = true;
[12871] Fix | Delete
[12872] Fix | Delete
if ( '' === $width ) {
[12873] Fix | Delete
$hover_width = $desktop_default ? $desktop_default : '100%';
[12874] Fix | Delete
$hover_base = array(
[12875] Fix | Delete
'selector' => $selector,
[12876] Fix | Delete
'declaration' => esc_html( "$css_prop: $hover_width;" ),
[12877] Fix | Delete
);
[12878] Fix | Delete
[12879] Fix | Delete
ET_Builder_Element::set_style( $function_name, $hover_base );
[12880] Fix | Delete
}
[12881] Fix | Delete
[12882] Fix | Delete
$selector_hover = et_pb_hover_options()->add_hover_to_order_class( $selector );
[12883] Fix | Delete
$additional_css = $this->get_max_width_additional_css();
[12884] Fix | Delete
[12885] Fix | Delete
$hover_style = array(
[12886] Fix | Delete
'selector' => $selector_hover,
[12887] Fix | Delete
'declaration' => esc_html( "$css_prop: {$width_hover}{$additional_css};" )
[12888] Fix | Delete
);
[12889] Fix | Delete
[12890] Fix | Delete
ET_Builder_Element::set_style( $function_name, $hover_style );
[12891] Fix | Delete
}
[12892] Fix | Delete
}
[12893] Fix | Delete
[12894] Fix | Delete
// Module Alignment
[12895] Fix | Delete
if ( self::$_->array_get( $field, 'use_module_alignment', true ) ) {
[12896] Fix | Delete
$module_alignment_styles = array(
[12897] Fix | Delete
'left' => 'margin-left: 0px !important; margin-right: auto !important;',
[12898] Fix | Delete
'center' => 'margin-left: auto !important; margin-right: auto !important;',
[12899] Fix | Delete
'right' => 'margin-left: auto !important; margin-right: 0px !important;',
[12900] Fix | Delete
);
[12901] Fix | Delete
[12902] Fix | Delete
$slug = et_builder_add_prefix( $prefix, 'module_alignment' );
[12903] Fix | Delete
$module_alignment = $this->prop( $slug, '' );
[12904] Fix | Delete
[12905] Fix | Delete
if ( $is_customized && isset( $module_alignment_styles[ $module_alignment ] ) ) {
[12906] Fix | Delete
$default_selector = self::$_->array_get( $field, 'css.main', '%%order_class%%.et_pb_module' );
[12907] Fix | Delete
$selector = self::$_->array_get( $field, 'css.module_alignment', $default_selector );
[12908] Fix | Delete
[12909] Fix | Delete
self::set_style( $function_name, array(
[12910] Fix | Delete
'selector' => $selector,
[12911] Fix | Delete
'declaration' => $module_alignment_styles[ $module_alignment ],
[12912] Fix | Delete
'priority' => 20,
[12913] Fix | Delete
) );
[12914] Fix | Delete
}
[12915] Fix | Delete
[12916] Fix | Delete
$is_module_alignment_responsive = et_pb_responsive_options()->is_responsive_enabled( $this->props, $slug );
[12917] Fix | Delete
[12918] Fix | Delete
$module_alignment_tablet = $this->prop( "{$slug}_tablet", '' );
[12919] Fix | Delete
if ( $is_customized && isset( $module_alignment_styles[ $module_alignment_tablet ] ) && $is_module_alignment_responsive ) {
[12920] Fix | Delete
$default_selector = self::$_->array_get( $field, 'css.main', '%%order_class%%.et_pb_module' );
[12921] Fix | Delete
$selector = self::$_->array_get( $field, 'css.module_alignment', $default_selector );
[12922] Fix | Delete
[12923] Fix | Delete
self::set_style( $function_name, array(
[12924] Fix | Delete
'selector' => $selector,
[12925] Fix | Delete
'declaration' => $module_alignment_styles[ $module_alignment_tablet ],
[12926] Fix | Delete
'priority' => 20,
[12927] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
[12928] Fix | Delete
) );
[12929] Fix | Delete
}
[12930] Fix | Delete
[12931] Fix | Delete
$module_alignment_phone = $this->prop( "{$slug}_phone", '' );
[12932] Fix | Delete
if ( $is_customized && isset( $module_alignment_styles[ $module_alignment_phone ] ) && $is_module_alignment_responsive ) {
[12933] Fix | Delete
$default_selector = self::$_->array_get( $field, 'css.main', '%%order_class%%.et_pb_module' );
[12934] Fix | Delete
$selector = self::$_->array_get( $field, 'css.module_alignment', $default_selector );
[12935] Fix | Delete
[12936] Fix | Delete
self::set_style( $function_name, array(
[12937] Fix | Delete
'selector' => $selector,
[12938] Fix | Delete
'declaration' => $module_alignment_styles[ $module_alignment_phone ],
[12939] Fix | Delete
'priority' => 20,
[12940] Fix | Delete
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
[12941] Fix | Delete
) );
[12942] Fix | Delete
}
[12943] Fix | Delete
}
[12944] Fix | Delete
}
[12945] Fix | Delete
}
[12946] Fix | Delete
[12947] Fix | Delete
function process_scroll_effects( $function_name ) {
[12948] Fix | Delete
$advanced_fields = self::$_->array_get( $this->advanced_fields, 'scroll_effects', array( 'default' => array() ) );
[12949] Fix | Delete
[12950] Fix | Delete
if ( ! $advanced_fields ) {
[12951] Fix | Delete
return;
[12952] Fix | Delete
}
[12953] Fix | Delete
[12954] Fix | Delete
// Accordion Module reuses the Toggle Module and its child are not marked as child on FE, so check this specific case.
[12955] Fix | Delete
$is_child_element = 'child' === $this->type || 'et_pb_accordion_item' === $function_name;
[12956] Fix | Delete
$options = $this->get_scroll_effects_options();
[12957] Fix | Delete
$motion = ET_Builder_Module_Helper_Motion::instance();
[12958] Fix | Delete
$responsive = et_pb_responsive_options();
[12959] Fix | Delete
$devices = array(
[12960] Fix | Delete
$responsive::DESKTOP,
[12961] Fix | Delete
$responsive::TABLET,
[12962] Fix | Delete
$responsive::PHONE,
[12963] Fix | Delete
);
[12964] Fix | Delete
[12965] Fix | Delete
// Reset saved parent effects to not apply them on subsequent modules.
[12966] Fix | Delete
if ( !$is_child_element ) {
[12967] Fix | Delete
self::$parent_motion_effects = array();
[12968] Fix | Delete
}
[12969] Fix | Delete
[12970] Fix | Delete
foreach ( $options as $id => $option ) {
[12971] Fix | Delete
$is_effect_enabled = 'on' === $this->prop( $id . '_enable' );
[12972] Fix | Delete
$is_inherit_parent = $is_child_element && !empty( self::$parent_motion_effects ) && isset( self::$parent_motion_effects[ $id ] );
[12973] Fix | Delete
[12974] Fix | Delete
if ( !$is_effect_enabled && !$is_inherit_parent ) {
[12975] Fix | Delete
continue;
[12976] Fix | Delete
}
[12977] Fix | Delete
[12978] Fix | Delete
$default = $option['default'];
[12979] Fix | Delete
[12980] Fix | Delete
foreach ( $devices as $device ) {
[12981] Fix | Delete
if ( ! $is_effect_enabled ) {
[12982] Fix | Delete
$item = self::$parent_motion_effects[ $id ];
[12983] Fix | Delete
$item['id'] = '.' . self::get_module_order_class( $function_name );
[12984] Fix | Delete
$item['module_type'] = esc_html( $function_name );
[12985] Fix | Delete
} else {
[12986] Fix | Delete
$field = $responsive->get_field( $id, $device );
[12987] Fix | Delete
$default_value = $responsive->get_default_value( $this->props, $field, $default );
[12988] Fix | Delete
$saved_value = $this->prop( $field, $default_value );
[12989] Fix | Delete
$value = $motion->getValue( $saved_value, $default_value );
[12990] Fix | Delete
$grid_motion = $this->prop( 'enable_grid_motion', 'off' );
[12991] Fix | Delete
$trigger_start = $this->prop( 'motion_trigger_start', 'middle' );
[12992] Fix | Delete
$trigger_end = $this->prop( 'motion_trigger_end', 'middle' );
[12993] Fix | Delete
$grid_modules = array('et_pb_gallery', 'et_pb_portfolio', 'et_pb_fullwidth_portfolio', 'et_pb_filterable_portfolio', 'et_pb_shop', 'et_pb_blog');
[12994] Fix | Delete
[12995] Fix | Delete
$item = array(
[12996] Fix | Delete
'id' => '.' . self::get_module_order_class( $function_name ),
[12997] Fix | Delete
'start' => $motion->getStartLimit( $value ),
[12998] Fix | Delete
'midStart' => $motion->getStartMiddle( $value ),
[12999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function