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/module/field
File: Border.php
$important = '';
[500] Fix | Delete
$hover = et_pb_hover_options();
[501] Fix | Delete
$is_desktop = 'desktop' === $device;
[502] Fix | Delete
$device_suffix = ! $is_desktop ? "_{$device}" : '';
[503] Fix | Delete
[504] Fix | Delete
self::$_is_default = array();
[505] Fix | Delete
[506] Fix | Delete
[507] Fix | Delete
[508] Fix | Delete
if ( self::$_->array_get( $advanced_fields, "border{$suffix}.css.important", false ) ) {
[509] Fix | Delete
if ( 'plugin_only' === self::$_->array_get( $advanced_fields, "border{$suffix}.css.important", '' ) ) {
[510] Fix | Delete
$important = et_builder_has_limitation( 'force_use_global_important' ) ? '!important' : '';
[511] Fix | Delete
} else {
[512] Fix | Delete
$important = '!important';
[513] Fix | Delete
}
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
// Get border settings based on main border_style field on option template.
[517] Fix | Delete
// This used to refer to module's advanced_fields property but for performance reason
[518] Fix | Delete
// it is now fetched from option template field's instead.
[519] Fix | Delete
// Rebuilt field on option template is cached on property so it is safe to get it on demand.
[520] Fix | Delete
$border_advanced_setting = self::$_->array_get( $advanced_fields, "border{$suffix}", array() );
[521] Fix | Delete
$border_template_id = ET_Builder_Module_Fields_Factory::get( 'Border' )->get_fields( $border_advanced_setting, true );
[522] Fix | Delete
$border_fields = $this->template->is_enabled() ? $this->template->rebuild_field_template( $border_template_id ) : array();
[523] Fix | Delete
[524] Fix | Delete
// Border Style settings
[525] Fix | Delete
$settings = self::$_->array_get( $border_fields, "border_styles{$suffix}", array() );
[526] Fix | Delete
[527] Fix | Delete
if ( ! isset( $settings['composite_structure'] ) || ! is_array( $settings['composite_structure'] ) ) {
[528] Fix | Delete
return $style;
[529] Fix | Delete
}
[530] Fix | Delete
[531] Fix | Delete
$styles = array();
[532] Fix | Delete
$properties = array( 'width', 'style', 'color' );
[533] Fix | Delete
$border_edges = array( 'top', 'right', 'bottom', 'left' );
[534] Fix | Delete
[535] Fix | Delete
// Individual edge tabs get their default values from the all edges tab. If a value in
[536] Fix | Delete
// the all edges tab has been changed from the default, that value will be used as the
[537] Fix | Delete
// default for the individual edge tabs, otherwise the all edges default value is used.
[538] Fix | Delete
$value_suffix = true === $is_hover ? et_pb_hover_options()->get_suffix() : '';
[539] Fix | Delete
[540] Fix | Delete
foreach ( $border_edges as $edge ) {
[541] Fix | Delete
$edge = "{$edge}";
[542] Fix | Delete
[543] Fix | Delete
foreach ( $properties as $property ) {
[544] Fix | Delete
// Set key to get all edges and edge value based on current active device.
[545] Fix | Delete
$all_edges_key = "border_{$property}_all{$suffix}";
[546] Fix | Delete
$all_edges_key_device = "border_{$property}_all{$suffix}{$device_suffix}";
[547] Fix | Delete
$edge_key = "border_{$property}_{$edge}{$suffix}";
[548] Fix | Delete
$edge_key_device = "border_{$property}_{$edge}{$suffix}{$device_suffix}";
[549] Fix | Delete
[550] Fix | Delete
$is_all_edges_responsive = et_pb_responsive_options()->is_responsive_enabled( $attrs, $all_edges_key );
[551] Fix | Delete
$is_edge_responsive = et_pb_responsive_options()->is_responsive_enabled( $attrs, $edge_key );
[552] Fix | Delete
$all_edges_desktop_value = et_pb_responsive_options()->get_any_value( $attrs, $all_edges_key );
[553] Fix | Delete
$edge_desktop_value = et_pb_responsive_options()->get_any_value( $attrs, $edge_key );
[554] Fix | Delete
[555] Fix | Delete
// Don't output styles for default values unless the default value is actually
[556] Fix | Delete
// a custom value from the all edges tab.
[557] Fix | Delete
$value = false;
[558] Fix | Delete
if ( $is_hover ) {
[559] Fix | Delete
$default_hover_value = $hover->is_enabled( $edge_key, $attrs ) ? $edge_desktop_value : false;
[560] Fix | Delete
$value = $hover->get_value( $edge_key, $attrs, $default_hover_value );
[561] Fix | Delete
} else if ( ! $is_desktop ) {
[562] Fix | Delete
$value = $is_edge_responsive ? et_pb_responsive_options()->get_any_value( $attrs, $edge_key_device, '', true ) : et_pb_responsive_options()->get_any_value( $attrs, $edge_key );
[563] Fix | Delete
} else if ( $is_desktop ) {
[564] Fix | Delete
$value = $edge_desktop_value;
[565] Fix | Delete
}
[566] Fix | Delete
[567] Fix | Delete
if ( ! $value ) {
[568] Fix | Delete
// If specific edge value doesn't exist, get from all active device.
[569] Fix | Delete
$value = false;
[570] Fix | Delete
if ( $is_hover ) {
[571] Fix | Delete
$default_hover_value = $hover->is_enabled( $all_edges_key, $attrs ) ? $all_edges_desktop_value : false;
[572] Fix | Delete
$value = $hover->get_value( $all_edges_key, $attrs, $default_hover_value );
[573] Fix | Delete
} else if ( $is_desktop || ( ! $is_desktop && $is_all_edges_responsive ) ) {
[574] Fix | Delete
$value = et_pb_responsive_options()->get_any_value( $attrs, $all_edges_key_device );
[575] Fix | Delete
}
[576] Fix | Delete
[577] Fix | Delete
if ( ! $value ) {
[578] Fix | Delete
self::$_is_default[] = "{$edge_key}{$value_suffix}";
[579] Fix | Delete
self::$_is_default[] = "{$all_edges_key}{$value_suffix}";
[580] Fix | Delete
[581] Fix | Delete
continue;
[582] Fix | Delete
}
[583] Fix | Delete
}
[584] Fix | Delete
[585] Fix | Delete
// Don't output wrongly migrated border-color value
[586] Fix | Delete
if ( 'color' === $property && 'off' === $value ) {
[587] Fix | Delete
continue;
[588] Fix | Delete
}
[589] Fix | Delete
[590] Fix | Delete
if ( ! isset( $styles[ $property ] ) ) {
[591] Fix | Delete
$styles[ $property ] = array();
[592] Fix | Delete
}
[593] Fix | Delete
[594] Fix | Delete
// Sanitize value
[595] Fix | Delete
if ( 'width' === $property ) {
[596] Fix | Delete
$value = et_builder_process_range_value( $value );
[597] Fix | Delete
}
[598] Fix | Delete
[599] Fix | Delete
$styles[ $property ][ $edge ] = esc_html( $value );
[600] Fix | Delete
}
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
foreach ( $styles as $prop => $edges ) {
[604] Fix | Delete
$all_values = array_values( $edges );
[605] Fix | Delete
$all_edges = 4 === count( $all_values );
[606] Fix | Delete
[607] Fix | Delete
if ( $all_edges && 1 === count( array_unique( $all_values ) ) ) {
[608] Fix | Delete
// All edges have the same value, so let's combine them into a single prop.
[609] Fix | Delete
$style .= "border-{$prop}:{$all_values[0]}{$important};";
[610] Fix | Delete
[611] Fix | Delete
} else if ( $all_edges && $edges['top'] === $edges['bottom'] && $edges['left'] === $edges['right'] ) {
[612] Fix | Delete
// Let's combine them into a single prop.
[613] Fix | Delete
$style .= "border-{$prop}:{$edges['top']} {$edges['left']}{$important};";
[614] Fix | Delete
[615] Fix | Delete
} else if ( $all_edges ) {
[616] Fix | Delete
// You know the drill.
[617] Fix | Delete
$style .= "border-{$prop}:{$edges['top']} {$edges['right']} {$edges['bottom']} {$edges['left']}{$important};";
[618] Fix | Delete
[619] Fix | Delete
} else {
[620] Fix | Delete
// We're not going to mess with the other shorthand variants, so separate styles it is!
[621] Fix | Delete
foreach ( $edges as $edge => $value ) {
[622] Fix | Delete
$style .= "border-{$edge}-{$prop}:{$value}{$important};";
[623] Fix | Delete
}
[624] Fix | Delete
}
[625] Fix | Delete
}
[626] Fix | Delete
[627] Fix | Delete
return $style;
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
/**
[631] Fix | Delete
* Whether or not the provided module needs the border reset CSS class.
[632] Fix | Delete
*
[633] Fix | Delete
* @param string $module_slug
[634] Fix | Delete
* @param array $attrs
[635] Fix | Delete
*
[636] Fix | Delete
* @return bool
[637] Fix | Delete
*/
[638] Fix | Delete
public function needs_border_reset_class( $module_slug, $attrs ) {
[639] Fix | Delete
if ( in_array( $module_slug, self::$_no_border_reset ) ) {
[640] Fix | Delete
return false;
[641] Fix | Delete
}
[642] Fix | Delete
[643] Fix | Delete
foreach ( $attrs as $attr => $value ) {
[644] Fix | Delete
if ( ! $value || 0 === strpos( $attr, 'border_radii' ) ) {
[645] Fix | Delete
continue;
[646] Fix | Delete
}
[647] Fix | Delete
[648] Fix | Delete
// don't use 2 === substr_count( $attr, '_' ) because in some cases border option may have 3 underscores ( in case we have several border options in module ).
[649] Fix | Delete
// It's enough to make sure we have more than 1 underscores.
[650] Fix | Delete
$is_new_border_attr = 0 === strpos( $attr, 'border_' ) && substr_count( $attr, '_' ) > 1;
[651] Fix | Delete
[652] Fix | Delete
if ( $is_new_border_attr && ! in_array( $attr, self::$_is_default ) ) {
[653] Fix | Delete
return true;
[654] Fix | Delete
}
[655] Fix | Delete
}
[656] Fix | Delete
[657] Fix | Delete
return false;
[658] Fix | Delete
}
[659] Fix | Delete
[660] Fix | Delete
/**
[661] Fix | Delete
* Add border reset class using filter. Obsolete method and only applied to old 3rd party modules without `modules_classname()` method
[662] Fix | Delete
*
[663] Fix | Delete
* @param string $output
[664] Fix | Delete
* @param string $module_slug
[665] Fix | Delete
*
[666] Fix | Delete
* @return string
[667] Fix | Delete
*/
[668] Fix | Delete
public function add_border_reset_class( $output, $module_slug ) {
[669] Fix | Delete
if ( in_array( $module_slug, ET_Builder_Element::$uses_module_classname ) ) {
[670] Fix | Delete
return $output;
[671] Fix | Delete
}
[672] Fix | Delete
[673] Fix | Delete
remove_filter( "{$module_slug}_shortcode_output", array( $this, 'add_border_reset_class' ), 10 );
[674] Fix | Delete
[675] Fix | Delete
return preg_replace( "/class=\"(.*?{$module_slug}_\d+.*?)\"/", 'class="$1 et_pb_with_border"', $output, 1 );
[676] Fix | Delete
}
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
return new ET_Builder_Module_Field_Border();
[680] Fix | Delete
[681] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function