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
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/module/settings/migratio...
File: Animation.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
class ET_Builder_Module_Settings_Migration_Animation extends ET_Builder_Module_Settings_Migration {
[3] Fix | Delete
[4] Fix | Delete
public $version = '3.0.72';
[5] Fix | Delete
[6] Fix | Delete
public function get_fields() {
[7] Fix | Delete
return array(
[8] Fix | Delete
'animation_style' => array(
[9] Fix | Delete
'affected_fields' => array(
[10] Fix | Delete
'animation' => $this->get_modules( 'image' ),
[11] Fix | Delete
),
[12] Fix | Delete
'map' => array(
[13] Fix | Delete
'off' => 'none',
[14] Fix | Delete
'fade_in' => 'fade',
[15] Fix | Delete
),
[16] Fix | Delete
),
[17] Fix | Delete
'animation_duration' => array(
[18] Fix | Delete
'affected_fields' => array(
[19] Fix | Delete
'animation' => $this->get_modules( 'image' ),
[20] Fix | Delete
),
[21] Fix | Delete
),
[22] Fix | Delete
'animation_intensity_slide' => array(
[23] Fix | Delete
'affected_fields' => array(
[24] Fix | Delete
'animation' => $this->get_modules( 'image' ),
[25] Fix | Delete
),
[26] Fix | Delete
),
[27] Fix | Delete
'animation_direction' => array(
[28] Fix | Delete
'affected_fields' => array(
[29] Fix | Delete
'animation' => $this->get_modules( 'image' ),
[30] Fix | Delete
),
[31] Fix | Delete
'map' => array(
[32] Fix | Delete
'off' => '',
[33] Fix | Delete
'fade_in' => 'center',
[34] Fix | Delete
'' => 'left',
[35] Fix | Delete
),
[36] Fix | Delete
),
[37] Fix | Delete
);
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
public function get_modules( $group = '' ) {
[41] Fix | Delete
$modules = array();
[42] Fix | Delete
[43] Fix | Delete
if ( in_array( $group, array( '', 'image' ) ) ) {
[44] Fix | Delete
$modules[] = 'et_pb_image';
[45] Fix | Delete
$modules[] = 'et_pb_fullwidth_image';
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
return $modules;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
public function migrate( $field_name, $current_value, $module_slug, $saved_value, $saved_field_name, $attrs, $content, $module_address ) {
[52] Fix | Delete
// Image & Fullwidth Image modules migration setting
[53] Fix | Delete
if ( in_array( $module_slug, $this->get_modules( 'image' ) ) ) {
[54] Fix | Delete
[55] Fix | Delete
// Migrate 'animation' attribute value to new animation UI attributes.
[56] Fix | Delete
// The following migration setting is basically default value for image module's legacy animation setting
[57] Fix | Delete
if ( 'animation' === $saved_field_name ) {
[58] Fix | Delete
[59] Fix | Delete
// Image module specific override
[60] Fix | Delete
if ( 'et_pb_image' === $module_slug ) {
[61] Fix | Delete
// Overwrite default animation if global setting is modified via customizer
[62] Fix | Delete
$global_animation_direction = ET_Global_Settings::get_value( 'et_pb_image-animation' );
[63] Fix | Delete
$default_animation = $global_animation_direction && '' !== $global_animation_direction ? $global_animation_direction : 'left';
[64] Fix | Delete
[65] Fix | Delete
if ( '' === $current_value ) {
[66] Fix | Delete
$current_value = $default_animation;
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
// Animation is set to off on legacy animation setting
[71] Fix | Delete
$is_animation_off = 'off' === $current_value;
[72] Fix | Delete
[73] Fix | Delete
// Set animation duration to 500ms
[74] Fix | Delete
if ( 'animation_duration' === $field_name && ! $is_animation_off ) {
[75] Fix | Delete
return '500ms';
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
// Set animation intensity to 10%
[79] Fix | Delete
if ( 'animation_intensity_slide' === $field_name && ! $is_animation_off ) {
[80] Fix | Delete
return '10%';
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
// Map animation style to provided configuration, otherwise it is 'slide' style
[84] Fix | Delete
if ( 'animation_style' === $field_name ) {
[85] Fix | Delete
return isset( $this->fields['animation_style']['map'][ $current_value ] ) ? $this->fields['animation_style']['map'][ $current_value ] : 'slide';
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
// Map animation direction to provided configuration, otherwise keep current value
[89] Fix | Delete
if ( 'animation_direction' === $field_name ) {
[90] Fix | Delete
return isset( $this->fields['animation_direction']['map'][ $current_value ] ) ? $this->fields['animation_direction']['map'][ $current_value ] : $current_value;
[91] Fix | Delete
}
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
return $saved_value;
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
return new ET_Builder_Module_Settings_Migration_Animation();
[100] Fix | Delete
[101] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function