Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module/settings/migratio...
File: HoverOptions.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Settings_Migration_HoverOptions extends ET_Builder_Module_Settings_Migration {
[2] Fix | Delete
public $version = '3.16';
[3] Fix | Delete
[4] Fix | Delete
public function get_modules( $group = '' ) {
[5] Fix | Delete
$button = array(
[6] Fix | Delete
'et_pb_button',
[7] Fix | Delete
'et_pb_comments',
[8] Fix | Delete
'et_pb_contact_field',
[9] Fix | Delete
'et_pb_cta',
[10] Fix | Delete
'et_pb_fullwidth_post_slider',
[11] Fix | Delete
'et_pb_fullwidth_slider',
[12] Fix | Delete
'et_pb_login',
[13] Fix | Delete
'et_pb_post_slider',
[14] Fix | Delete
'et_pb_pricing_tables',
[15] Fix | Delete
'et_pb_pricing_table',
[16] Fix | Delete
'et_pb_search',
[17] Fix | Delete
'et_pb_signup',
[18] Fix | Delete
'et_pb_slider',
[19] Fix | Delete
'et_pb_slide',
[20] Fix | Delete
);
[21] Fix | Delete
[22] Fix | Delete
$buttons = array( 'et_pb_fullwidth_header' );
[23] Fix | Delete
switch ( $group ) {
[24] Fix | Delete
case 'button':
[25] Fix | Delete
return $button;
[26] Fix | Delete
case $buttons:
[27] Fix | Delete
return $buttons;
[28] Fix | Delete
default:
[29] Fix | Delete
return array_merge( $buttons, $button );
[30] Fix | Delete
}
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
public function get_fields() {
[34] Fix | Delete
$fields = array(
[35] Fix | Delete
'text_size',
[36] Fix | Delete
'text_color',
[37] Fix | Delete
'text_color',
[38] Fix | Delete
'border_width',
[39] Fix | Delete
'border_color',
[40] Fix | Delete
'border_radius',
[41] Fix | Delete
'letter_spacing',
[42] Fix | Delete
'bg_color',
[43] Fix | Delete
);
[44] Fix | Delete
[45] Fix | Delete
$return = array();
[46] Fix | Delete
$hover = et_pb_hover_options();
[47] Fix | Delete
[48] Fix | Delete
foreach ( $fields as $field ) {
[49] Fix | Delete
$return[ $hover->get_hover_enabled_field( "button_{$field}" ) ] = array(
[50] Fix | Delete
'affected_fields' => array(
[51] Fix | Delete
"button_{$field}_hover" => $this->get_modules( 'button' ),
[52] Fix | Delete
),
[53] Fix | Delete
);
[54] Fix | Delete
$return[ $hover->get_hover_field( "button_{$field}" ) ] = array(
[55] Fix | Delete
'affected_fields' => array(
[56] Fix | Delete
"button_{$field}_hover" => $this->get_modules( 'button' ),
[57] Fix | Delete
),
[58] Fix | Delete
);
[59] Fix | Delete
$return[ $hover->get_hover_enabled_field( "button_one_{$field}" ) ] = array(
[60] Fix | Delete
'affected_fields' => array(
[61] Fix | Delete
"button_one_{$field}_hover" => $this->get_modules( 'buttons' ),
[62] Fix | Delete
),
[63] Fix | Delete
);
[64] Fix | Delete
$return[ $hover->get_hover_field( "button_one_{$field}" ) ] = array(
[65] Fix | Delete
'affected_fields' => array(
[66] Fix | Delete
"button_one_{$field}_hover" => $this->get_modules( 'buttons' ),
[67] Fix | Delete
),
[68] Fix | Delete
);
[69] Fix | Delete
$return[ $hover->get_hover_enabled_field( "button_two_{$field}" ) ] = array(
[70] Fix | Delete
'affected_fields' => array(
[71] Fix | Delete
"button_two_{$field}_hover" => $this->get_modules( 'buttons' ),
[72] Fix | Delete
),
[73] Fix | Delete
);
[74] Fix | Delete
$return[ $hover->get_hover_field( "button_two_{$field}" ) ] = array(
[75] Fix | Delete
'affected_fields' => array(
[76] Fix | Delete
"button_two_{$field}_hover" => $this->get_modules( 'buttons' ),
[77] Fix | Delete
),
[78] Fix | Delete
);
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
return $return;
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
public function migrate( $field_name, $current_value, $module_slug, $saved_value, $saved_field_name, $attrs, $content, $module_address ) {
[85] Fix | Delete
if ( $field_name == et_pb_hover_options()->get_hover_field( $field_name ) ) {
[86] Fix | Delete
return strlen( $current_value ) ? $current_value : null;
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
return strlen( $current_value ) ? 'on' : 'off';
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
return new ET_Builder_Module_Settings_Migration_HoverOptions();
[94] Fix | Delete
[95] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function