Upgarded to 4.17.4
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Main migartion class.
|
||||
* Main migration class.
|
||||
*
|
||||
* @package Divi
|
||||
* @package Divi
|
||||
* @subpackage Builder
|
||||
* @since ?
|
||||
* @since ?
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -14,6 +14,7 @@
|
||||
*/
|
||||
abstract class ET_Builder_Module_Settings_Migration {
|
||||
|
||||
|
||||
/**
|
||||
* Used to exclude names in case of BB.
|
||||
*
|
||||
@ -68,7 +69,7 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $max_version = '4.13.0';
|
||||
public static $max_version = '4.16';
|
||||
|
||||
/**
|
||||
* Array of already migrated data.
|
||||
@ -80,7 +81,7 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
/**
|
||||
* Array of migrations in format( [ 'version' => 'name of migration script' ] ).
|
||||
*
|
||||
* @var array
|
||||
* @var string[]
|
||||
*/
|
||||
public static $migrations = array(
|
||||
'3.0.48' => 'BackgroundUI',
|
||||
@ -107,6 +108,10 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
'3.25.3' => 'ShopOrderByDefault',
|
||||
'3.27.4' => 'TextAlignment',
|
||||
'4.13.0' => 'IconManager',
|
||||
'4.13.1' => 'ContactFormUniqueID',
|
||||
'4.14.0' => 'WooTextOG',
|
||||
'4.15' => 'BackgroundGradientOverlaysImage',
|
||||
'4.16' => 'BackgroundGradientStops',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -158,7 +163,7 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
}
|
||||
|
||||
// For the BB...
|
||||
if ( ! in_array( $old_name, self::$_bb_excluded_name_changes ) ) {
|
||||
if ( ! in_array( $old_name, self::$_bb_excluded_name_changes, true ) ) {
|
||||
self::$migrated['field_name_changes'][ $module_slug ][ $old_name ] = array(
|
||||
'new_name' => $new_name,
|
||||
'version' => $version,
|
||||
@ -189,7 +194,8 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
}
|
||||
|
||||
if ( is_string( $migration ) ) {
|
||||
self::$migrations[ $version ] = $migration = require_once "migration/{$migration}.php";
|
||||
$migration = require_once "migration/{$migration}.php";
|
||||
self::$migrations[ $version ] = $migration;
|
||||
}
|
||||
|
||||
self::$migrations_by_version[ $module_version ][] = $migration;
|
||||
@ -205,14 +211,14 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
}
|
||||
|
||||
public function handle_field_name_migrations( $fields, $module_slug ) {
|
||||
if ( ! in_array( $module_slug, $this->modules ) ) {
|
||||
if ( ! in_array( $module_slug, $this->modules, true ) ) {
|
||||
return $fields;
|
||||
}
|
||||
|
||||
foreach ( $this->fields as $field_name => $field_info ) {
|
||||
foreach ( $field_info['affected_fields'] as $affected_field => $affected_modules ) {
|
||||
|
||||
if ( $affected_field === $field_name || ! in_array( $module_slug, $affected_modules ) ) {
|
||||
if ( $affected_field === $field_name || ! in_array( $module_slug, $affected_modules, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -227,8 +233,8 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
}
|
||||
|
||||
return isset( self::$field_name_migrations[ $module_slug ] )
|
||||
? self::_migrate_field_names( $fields, $module_slug, $this->version )
|
||||
: $fields;
|
||||
? self::_migrate_field_names( $fields, $module_slug, $this->version )
|
||||
: $fields;
|
||||
}
|
||||
|
||||
public static function init() {
|
||||
@ -239,6 +245,22 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
add_filter( 'et_pb_module_content', array( $class, 'maybe_override_content' ), 10, 6 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove added filters.
|
||||
*
|
||||
* Used by WPUnit tests.
|
||||
*
|
||||
* @since 4.16.0
|
||||
* @link https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#shared-setup-between-related-tests
|
||||
*/
|
||||
public static function tear_down() {
|
||||
$class = 'ET_Builder_Module_Settings_Migration';
|
||||
|
||||
remove_filter( 'et_pb_module_processed_fields', array( $class, 'maybe_override_processed_fields' ) );
|
||||
remove_filter( 'et_pb_module_shortcode_attributes', array( $class, 'maybe_override_shortcode_attributes' ) );
|
||||
remove_filter( 'et_pb_module_content', array( $class, 'maybe_override_content' ) );
|
||||
}
|
||||
|
||||
public static function maybe_override_processed_fields( $fields, $module_slug ) {
|
||||
if ( ! $fields ) {
|
||||
return $fields;
|
||||
@ -247,7 +269,7 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
$migrations = self::get_migrations( 'all' );
|
||||
|
||||
foreach ( $migrations as $migration ) {
|
||||
if ( in_array( $module_slug, $migration->modules ) ) {
|
||||
if ( in_array( $module_slug, $migration->modules, true ) ) {
|
||||
$fields = $migration->handle_field_name_migrations( $fields, $module_slug );
|
||||
}
|
||||
}
|
||||
@ -255,6 +277,20 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe override shortcode attributes.
|
||||
*
|
||||
* @param array $attrs Shortcode attributes.
|
||||
* @param array $unprocessed_attrs Attributes that have not yet been processed.
|
||||
* @param string $module_slug Internal system name for the module type.
|
||||
* @param string $module_address Location of the current module on the page.
|
||||
* @param string $content Text/HTML content within the current module.
|
||||
* @param bool $maybe_global_presets_migration Whether to include global presets.
|
||||
*
|
||||
* @since 4.17.1 If a `null` value is returned from `migrate()`, unset the attribute.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function maybe_override_shortcode_attributes( $attrs, $unprocessed_attrs, $module_slug, $module_address, $content = '', $maybe_global_presets_migration = false ) {
|
||||
if ( empty( $attrs['_builder_version'] ) ) {
|
||||
$attrs['_builder_version'] = '3.0.47';
|
||||
@ -283,35 +319,59 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
foreach ( $migrations as $migration ) {
|
||||
$migrated_attrs_count = 0;
|
||||
|
||||
if ( ! in_array( $module_slug, $migration->modules ) ) {
|
||||
if ( ! in_array( $module_slug, $migration->modules, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$migration_fields = $migration->fields;
|
||||
|
||||
// It needs for IconManager's wpunit tests when it is necessary to test the migration of module posts attributes
|
||||
// and migration of global presets within the same test session
|
||||
// ( because migration fields array is depending on self::$_maybe_global_presets_migration variable ).
|
||||
$migration_fields = ( 'ET_Builder_Module_Settings_Migration_IconManager' === get_class( $migration ) ) ? $migration->get_fields() : $migration->fields;
|
||||
$classes_requiring_presets_migration = array(
|
||||
'ET_Builder_Module_Settings_Migration_IconManager',
|
||||
'ET_Builder_Module_Settings_Migration_BackgroundGradientStops',
|
||||
);
|
||||
|
||||
if ( in_array( get_class( $migration ), $classes_requiring_presets_migration, true ) ) {
|
||||
$migration_fields = $migration->get_fields();
|
||||
}
|
||||
|
||||
// Each "migration field" is an object with a field name (key) and field info (property/value pairs).
|
||||
foreach ( $migration_fields as $field_name => $field_info ) {
|
||||
// Each "affected field" is a field name (key) with a list of modules that use that field name.
|
||||
foreach ( $field_info['affected_fields'] as $affected_field => $affected_modules ) {
|
||||
|
||||
if ( ( ! $migration->add_missing_fields && ! isset( $attrs[ $affected_field ] ) ) || ! in_array( $module_slug, $affected_modules ) ) {
|
||||
// Skip [what are we skipping?] if either:
|
||||
// * there is no instruction to add missing fields AND the "affected field" is missing
|
||||
// * this module isn't in the list of matching modules that use the field name.
|
||||
if ( ( ! $migration->add_missing_fields && ! isset( $attrs[ $affected_field ] ) ) || ! in_array( $module_slug, $affected_modules, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the "migration field" name and the "affected field" name are different,
|
||||
// then add the affected field name to the "unprocessed_attrs" list.
|
||||
if ( $affected_field !== $field_name ) {
|
||||
// Field name changed
|
||||
// Field name changed.
|
||||
$unprocessed_attrs[ $field_name ] = $attrs[ $affected_field ];
|
||||
}
|
||||
|
||||
// If a value is set in the "unprocessed_attrs" list for the current field we're
|
||||
// looking at (field_name), then inherit that value as the "before" state.
|
||||
$current_value = isset( $unprocessed_attrs[ $field_name ] ) ? $unprocessed_attrs[ $field_name ] : '';
|
||||
|
||||
$saved_value = isset( $attrs[ $field_name ] ) ? $attrs[ $field_name ] : '';
|
||||
|
||||
$new_value = $migration->migrate( $field_name, $current_value, $module_slug, $saved_value, $affected_field, $attrs, $content, $module_address );
|
||||
|
||||
// If a null value was returned, then we want to unset this attribute.
|
||||
if ( is_null( $new_value ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $new_value !== $saved_value || ( $affected_field !== $field_name && $new_value !== $current_value ) ) {
|
||||
$attrs[ $field_name ] = self::$migrated['value_changes'][ $module_address ][ $field_name ] = $new_value;
|
||||
self::$migrated['value_changes'][ $module_address ][ $field_name ] = $new_value;
|
||||
$attrs[ $field_name ] = $new_value;
|
||||
$migrated_attrs_count++;
|
||||
}
|
||||
}
|
||||
@ -339,7 +399,7 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
foreach ( $migrations as $migration ) {
|
||||
$migrated_content = false;
|
||||
|
||||
if ( ! in_array( $module_slug, $migration->get_content_migration_modules() ) ) {
|
||||
if ( ! in_array( $module_slug, $migration->get_content_migration_modules(), true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -369,7 +429,21 @@ abstract class ET_Builder_Module_Settings_Migration {
|
||||
}
|
||||
|
||||
public static function _should_handle_render( $slug ) {
|
||||
if ( false === strpos( $slug, 'et_pb' ) ) {
|
||||
// Get all module slugs to compare against this slug. This way, we're
|
||||
// not trying to process any and every shortcode, only Divi modules.
|
||||
$all_module_slugs = ET_Builder_Element::get_all_module_slugs();
|
||||
$slug_match = false;
|
||||
|
||||
foreach ( $all_module_slugs as $module_slug ) {
|
||||
if ( $module_slug !== $slug ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$slug_match = $module_slug;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! $slug_match ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,318 @@
|
||||
<?php
|
||||
/**
|
||||
* ET_Builder_Module_Settings_Migration_BackgroundGradientOverlaysImage.
|
||||
*
|
||||
* @package Divi
|
||||
* @subpackage Builder
|
||||
* @since 4.15.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Migrate Background Color Gradient Overlays Image option to 'off' based on condition.
|
||||
*
|
||||
* This migration will check three existing settings, and update as following:
|
||||
*
|
||||
* OLD:
|
||||
* - use_background_color_gradient: on
|
||||
* - background_color_gradient_overlays_image: on
|
||||
* - parallax: on
|
||||
*
|
||||
* NEW:
|
||||
* - background_color_gradient_overlays_image: off
|
||||
*
|
||||
* @package Divi
|
||||
* @subpackage Builder/Migration
|
||||
* @since 4.15.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Background Gradient Overlays Image migrations class.
|
||||
*/
|
||||
class ET_Builder_Module_Settings_Migration_BackgroundGradientOverlaysImage extends ET_Builder_Module_Settings_Migration {
|
||||
|
||||
/**
|
||||
* The Divi release where this migration was introduced.
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @since 4.15.0
|
||||
*/
|
||||
public $version = '4.15';
|
||||
|
||||
/**
|
||||
* Array of modules to inspect for settings to migrate.
|
||||
*
|
||||
* Pass attribute and it will return selected modules only. Default return all affected modules.
|
||||
*
|
||||
* @param string $attr Attribute name.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 4.15.0
|
||||
*/
|
||||
public function get_modules( $attr = '' ) {
|
||||
$modules = array();
|
||||
|
||||
// Background.
|
||||
if ( in_array( $attr, array( '', 'module_bg' ), true ) ) {
|
||||
// Structure Elements.
|
||||
$modules[] = 'et_pb_column_inner';
|
||||
$modules[] = 'et_pb_column_specialty';
|
||||
$modules[] = 'et_pb_column';
|
||||
$modules[] = 'et_pb_section_fullwidth';
|
||||
$modules[] = 'et_pb_section_specialty';
|
||||
$modules[] = 'et_pb_section';
|
||||
$modules[] = 'et_pb_row_inner';
|
||||
$modules[] = 'et_pb_row';
|
||||
// Divi Content Modules.
|
||||
$modules[] = 'et_pb_accordion_item';
|
||||
$modules[] = 'et_pb_accordion';
|
||||
$modules[] = 'et_pb_audio';
|
||||
$modules[] = 'et_pb_blog';
|
||||
$modules[] = 'et_pb_blurb';
|
||||
$modules[] = 'et_pb_circle_counter';
|
||||
$modules[] = 'et_pb_code';
|
||||
$modules[] = 'et_pb_comments';
|
||||
$modules[] = 'et_pb_contact_field';
|
||||
$modules[] = 'et_pb_contact_form';
|
||||
$modules[] = 'et_pb_countdown_timer';
|
||||
$modules[] = 'et_pb_counter';
|
||||
$modules[] = 'et_pb_counters';
|
||||
$modules[] = 'et_pb_cta';
|
||||
$modules[] = 'et_pb_divider';
|
||||
$modules[] = 'et_pb_filterable_portfolio';
|
||||
$modules[] = 'et_pb_gallery';
|
||||
$modules[] = 'et_pb_image';
|
||||
$modules[] = 'et_pb_login';
|
||||
$modules[] = 'et_pb_map';
|
||||
$modules[] = 'et_pb_menu';
|
||||
$modules[] = 'et_pb_number_counter';
|
||||
$modules[] = 'et_pb_portfolio';
|
||||
$modules[] = 'et_pb_post_content';
|
||||
$modules[] = 'et_pb_post_nav';
|
||||
$modules[] = 'et_pb_post_slider';
|
||||
$modules[] = 'et_pb_post_title';
|
||||
$modules[] = 'et_pb_pricing_table';
|
||||
$modules[] = 'et_pb_pricing_tables';
|
||||
$modules[] = 'et_pb_search';
|
||||
$modules[] = 'et_pb_shop';
|
||||
$modules[] = 'et_pb_sidebar';
|
||||
$modules[] = 'et_pb_signup_custom_field';
|
||||
$modules[] = 'et_pb_signup';
|
||||
$modules[] = 'et_pb_slide_fullwidth';
|
||||
$modules[] = 'et_pb_slide';
|
||||
$modules[] = 'et_pb_slider';
|
||||
$modules[] = 'et_pb_social_media_follow';
|
||||
$modules[] = 'et_pb_tab';
|
||||
$modules[] = 'et_pb_tabs';
|
||||
$modules[] = 'et_pb_team_member';
|
||||
$modules[] = 'et_pb_testimonial';
|
||||
$modules[] = 'et_pb_text';
|
||||
$modules[] = 'et_pb_toggle';
|
||||
$modules[] = 'et_pb_video_slider';
|
||||
$modules[] = 'et_pb_video';
|
||||
$modules[] = 'et_pb_fullwidth_code';
|
||||
$modules[] = 'et_pb_fullwidth_header';
|
||||
$modules[] = 'et_pb_fullwidth_image';
|
||||
$modules[] = 'et_pb_fullwidth_map';
|
||||
$modules[] = 'et_pb_fullwidth_menu';
|
||||
$modules[] = 'et_pb_fullwidth_portfolio';
|
||||
$modules[] = 'et_pb_fullwidth_post_content';
|
||||
$modules[] = 'et_pb_fullwidth_post_slider';
|
||||
$modules[] = 'et_pb_fullwidth_post_title';
|
||||
$modules[] = 'et_pb_fullwidth_slider';
|
||||
// WooCommerce Modules.
|
||||
$modules[] = 'et_pb_wc_add_to_cart';
|
||||
$modules[] = 'et_pb_wc_additional_info';
|
||||
$modules[] = 'et_pb_wc_breadcrumb';
|
||||
$modules[] = 'et_pb_wc_cart_notice';
|
||||
$modules[] = 'et_pb_wc_description';
|
||||
$modules[] = 'et_pb_wc_gallery';
|
||||
$modules[] = 'et_pb_wc_images';
|
||||
$modules[] = 'et_pb_wc_meta';
|
||||
$modules[] = 'et_pb_wc_price';
|
||||
$modules[] = 'et_pb_wc_rating';
|
||||
$modules[] = 'et_pb_wc_related_products';
|
||||
$modules[] = 'et_pb_wc_reviews';
|
||||
$modules[] = 'et_pb_wc_stock';
|
||||
$modules[] = 'et_pb_wc_tabs';
|
||||
$modules[] = 'et_pb_wc_title';
|
||||
$modules[] = 'et_pb_wc_upsells';
|
||||
}
|
||||
|
||||
return $modules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fields that are affected by this migration.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 4.15.0
|
||||
*/
|
||||
public function get_fields() {
|
||||
return array(
|
||||
'background_color_gradient_overlays_image' => array(
|
||||
'affected_fields' => array(
|
||||
'background_color_gradient_overlays_image' => $this->get_modules( 'module_bg' ),
|
||||
),
|
||||
),
|
||||
'background_color_gradient_overlays_image_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'background_color_gradient_overlays_image_tablet' => $this->get_modules( 'module_bg' ),
|
||||
),
|
||||
),
|
||||
'background_color_gradient_overlays_image_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'background_color_gradient_overlays_image_phone' => $this->get_modules( 'module_bg' ),
|
||||
),
|
||||
),
|
||||
'background_color_gradient_overlays_image__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'background_color_gradient_overlays_image__hover' => $this->get_modules( 'module_bg' ),
|
||||
),
|
||||
),
|
||||
'background_color_gradient_overlays_image__sticky' => array(
|
||||
'affected_fields' => array(
|
||||
'background_color_gradient_overlays_image__sticky' => $this->get_modules( 'module_bg' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate.
|
||||
*
|
||||
* @param string $to_field_name This migration's target field.
|
||||
* @param string|array $affected_field_value Affected field reference value.
|
||||
* @param string|number $module_slug Current module type.
|
||||
* @param string $to_field_value Migration target's current value.
|
||||
* @param string $affected_field_name Affected field attribute name.
|
||||
* @param array $module_attrs Current module's full attributes.
|
||||
* @param string $module_content Current module's content.
|
||||
* @param string|number $module_address Current module's address.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 4.15.0
|
||||
*/
|
||||
public function migrate(
|
||||
$to_field_name,
|
||||
$affected_field_value,
|
||||
$module_slug,
|
||||
$to_field_value,
|
||||
$affected_field_name,
|
||||
$module_attrs,
|
||||
$module_content,
|
||||
$module_address
|
||||
) {
|
||||
// Early exit if affected field ("Use Gradient" or "Parallax") is not "on".
|
||||
if ( 'on' !== $affected_field_value ) {
|
||||
return $affected_field_value;
|
||||
}
|
||||
|
||||
$default_settings = array(
|
||||
'use_gradient' => 'off',
|
||||
'overlays_image' => ET_Global_Settings::get_value( 'all_background_gradient_overlays_image' ),
|
||||
'parallax' => 'off',
|
||||
);
|
||||
|
||||
$old_values = $default_settings;
|
||||
|
||||
// Collect the old settings.
|
||||
switch ( $affected_field_name ) {
|
||||
// Desktop View.
|
||||
case 'background_color_gradient_overlays_image':
|
||||
if ( ! isset( $module_attrs[ $affected_field_name ] ) ) {
|
||||
return $affected_field_value;
|
||||
} else {
|
||||
$old_values['use_gradient'] = $this->_get_attr_value( 'use_background_color_gradient', $module_attrs );
|
||||
$old_values['overlays_image'] = $this->_get_attr_value( 'background_color_gradient_overlays_image', $module_attrs );
|
||||
$old_values['parallax'] = $this->_get_attr_value( 'parallax', $module_attrs );
|
||||
}
|
||||
break;
|
||||
|
||||
// Tablet View.
|
||||
case 'background_color_gradient_overlays_image_tablet':
|
||||
if ( ! isset( $module_attrs[ $affected_field_name ] ) ) {
|
||||
return $affected_field_value;
|
||||
} else {
|
||||
$old_values['use_gradient'] = $this->_get_attr_value( 'use_background_color_gradient_tablet', $module_attrs );
|
||||
$old_values['overlays_image'] = $this->_get_attr_value( 'background_color_gradient_overlays_image_tablet', $module_attrs );
|
||||
$old_values['parallax'] = $this->_get_attr_value( 'parallax_tablet', $module_attrs );
|
||||
}
|
||||
break;
|
||||
|
||||
// Phone View.
|
||||
case 'background_color_gradient_overlays_image_phone':
|
||||
if ( ! isset( $module_attrs[ $affected_field_name ] ) ) {
|
||||
return $affected_field_value;
|
||||
} else {
|
||||
$old_values['use_gradient'] = $this->_get_attr_value( 'use_background_color_gradient_phone', $module_attrs );
|
||||
$old_values['overlays_image'] = $this->_get_attr_value( 'background_color_gradient_overlays_image_phone', $module_attrs );
|
||||
$old_values['parallax'] = $this->_get_attr_value( 'parallax_phone', $module_attrs );
|
||||
}
|
||||
break;
|
||||
|
||||
// Hover Mode.
|
||||
case 'background_color_gradient_overlays_image__hover':
|
||||
if ( ! isset( $module_attrs[ $affected_field_name ] ) ) {
|
||||
return $affected_field_value;
|
||||
} else {
|
||||
$old_values['use_gradient'] = $this->_get_attr_value( 'use_background_color_gradient__hover', $module_attrs );
|
||||
$old_values['overlays_image'] = $this->_get_attr_value( 'background_color_gradient_overlays_image__hover', $module_attrs );
|
||||
$old_values['parallax'] = $this->_get_attr_value( 'parallax__hover', $module_attrs );
|
||||
}
|
||||
break;
|
||||
|
||||
// Sticky Mode.
|
||||
case 'background_color_gradient_overlays_image__sticky':
|
||||
if ( ! isset( $module_attrs[ $affected_field_name ] ) ) {
|
||||
return $affected_field_value;
|
||||
} else {
|
||||
$old_values['use_gradient'] = $this->_get_attr_value( 'use_background_color_gradient__sticky', $module_attrs );
|
||||
$old_values['overlays_image'] = $this->_get_attr_value( 'background_color_gradient_overlays_image__sticky', $module_attrs );
|
||||
$old_values['parallax'] = $this->_get_attr_value( 'parallax__sticky', $module_attrs );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return $affected_field_value;
|
||||
}
|
||||
|
||||
// If overlays_image aren't defined, pull in global default settings.
|
||||
if ( empty( $old_values['use_gradient'] ) ) {
|
||||
$old_values['use_gradient'] = $default_settings['use_gradient'];
|
||||
}
|
||||
|
||||
if ( empty( $old_values['overlays_image'] ) ) {
|
||||
$old_values['overlays_image'] = $default_settings['overlays_image'];
|
||||
}
|
||||
|
||||
if ( empty( $old_values['parallax'] ) ) {
|
||||
$old_values['parallax'] = $default_settings['parallax'];
|
||||
}
|
||||
|
||||
// New value for overlays_image.
|
||||
return 'on' === $old_values['use_gradient'] && 'on' === $old_values['overlays_image'] && 'on' === $old_values['parallax']
|
||||
? 'off' : $affected_field_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get attributes value by field_name.
|
||||
*
|
||||
* @param string $field_name Field name.
|
||||
* @param array $module_attrs Module's full attributes.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _get_attr_value( $field_name, $module_attrs ) {
|
||||
if ( array_key_exists( $field_name, $module_attrs ) ) {
|
||||
return $module_attrs[ $field_name ];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
return new ET_Builder_Module_Settings_Migration_BackgroundGradientOverlaysImage();
|
File diff suppressed because it is too large
Load Diff
@ -66,14 +66,15 @@ class ET_Builder_Module_Settings_Migration_ColumnOptions extends ET_Builder_Modu
|
||||
'custom_css_main',
|
||||
'custom_css_after',
|
||||
'use_background_color_gradient',
|
||||
'background_color_gradient_stops',
|
||||
'background_color_gradient_type',
|
||||
'background_color_gradient_direction',
|
||||
'background_color_gradient_direction_radial',
|
||||
'background_color_gradient_overlays_image',
|
||||
'background_color_gradient_start',
|
||||
'background_color_gradient_end',
|
||||
'background_color_gradient_start_position',
|
||||
'background_color_gradient_end_position',
|
||||
'background_color_gradient_overlays_image',
|
||||
'background_video_mp4',
|
||||
'background_video_webm',
|
||||
'background_video_width',
|
||||
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* ET_Builder_Module_Settings_Migration_ContactFormUniqueID class file.
|
||||
*
|
||||
* @class ET_Builder_Module_Settings_Migration_ContactFormUniqueID
|
||||
* @package Builder/Module/Settings/Migration
|
||||
*/
|
||||
|
||||
/**
|
||||
* Migration process to fill in missing unique_id attribute on Contact Form module.
|
||||
*
|
||||
* @since 4.13.1
|
||||
*/
|
||||
class ET_Builder_Module_Settings_Migration_ContactFormUniqueID extends ET_Builder_Module_Settings_Migration {
|
||||
|
||||
/**
|
||||
* Migration Version
|
||||
*
|
||||
* @since 4.13.1
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $version = '4.13.1';
|
||||
|
||||
/**
|
||||
* Get the field that need to be migrated.
|
||||
*
|
||||
* Contains array with:
|
||||
* - key as new field
|
||||
* - value consists affected fields as old field and module location
|
||||
*
|
||||
* @since 4.13.1
|
||||
*
|
||||
* @return array New and old fields need to be migrated.
|
||||
*/
|
||||
public function get_fields() {
|
||||
return array(
|
||||
// Unique ID of Contact Form module.
|
||||
'_unique_id' => array(
|
||||
'affected_fields' => array(
|
||||
'_unique_id' => $this->get_modules(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all modules affected.
|
||||
*
|
||||
* @since 4.13.1
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_modules() {
|
||||
return array( 'et_pb_contact_form' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run migrate process.
|
||||
*
|
||||
* @since 4.13.1
|
||||
*
|
||||
* @param string $field_name Field name.
|
||||
* @param string $current_value Current value.
|
||||
* @param string $module_slug Module slug.
|
||||
* @param string $saved_value Saved value.
|
||||
* @param string $saved_field_name Saved field name.
|
||||
* @param string $attrs Module attributes values.
|
||||
* @param string $content Module content.
|
||||
* @param string $module_address Module address.
|
||||
*
|
||||
* @return string New value.
|
||||
*/
|
||||
public function migrate( $field_name, $current_value, $module_slug, $saved_value, $saved_field_name, $attrs, $content, $module_address ) {
|
||||
// Setup unique ID for Contact Form module. Only do this when the current page is
|
||||
// builder and not on the FE because it mays create incorrect unique ID.
|
||||
if ( '_unique_id' === $field_name && function_exists( 'et_fb_is_enabled' ) && et_fb_is_enabled() ) {
|
||||
return ET_Core_Data_Utils::uuid_v4();
|
||||
}
|
||||
|
||||
return $current_value;
|
||||
}
|
||||
}
|
||||
|
||||
return new ET_Builder_Module_Settings_Migration_ContactFormUniqueID();
|
@ -526,7 +526,7 @@ class ET_Builder_Module_Settings_Migration_IconManager extends ET_Builder_Module
|
||||
return '';
|
||||
}
|
||||
|
||||
return et_pb_process_font_icon( $this->_current_value ) . '||divi||' . et_pb_get_normal_font_weight_value();
|
||||
return et_pb_build_extended_font_icon_value( $this->_current_value );
|
||||
}
|
||||
|
||||
/**
|
||||
|
632
includes/builder/module/settings/migration/WooTextOG.php
Normal file
632
includes/builder/module/settings/migration/WooTextOG.php
Normal file
@ -0,0 +1,632 @@
|
||||
<?php
|
||||
/**
|
||||
* Migration: Woo v2 modules
|
||||
*
|
||||
* Contains Woo Notice and Woo Add to cart modules migrations.
|
||||
*
|
||||
* @since 4.14.0
|
||||
* @package Divi
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Text OG Migration Class.
|
||||
*
|
||||
* Migrates Text OG fields to Title OG in Woo Cart Notice.
|
||||
* Migrates Text OG fields to Field Labels OG in Woo Add to Cart.
|
||||
*/
|
||||
class ET_Builder_Module_Settings_Migration_WooTextOG extends ET_Builder_Module_Settings_Migration {
|
||||
|
||||
/**
|
||||
* Gets the modules that needs migration.
|
||||
*
|
||||
* @used-by ET_Builder_Module_Settings_Migration::handle_field_name_migrations()
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function get_modules() {
|
||||
return array(
|
||||
'et_pb_wc_cart_notice',
|
||||
'et_pb_wc_add_to_cart',
|
||||
);
|
||||
}
|
||||
|
||||
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing -- Paresh's PR contains function comment.
|
||||
public function get_fields() {
|
||||
// phpcs:disable WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned -- Invalid warning.
|
||||
// phpcs:disable WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow -- Invalid warning.
|
||||
return array(
|
||||
// Migration 01: Cart Notice.
|
||||
// Text Font, weight & style.
|
||||
'title_font' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Color.
|
||||
'title_text_color' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_color_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_color_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_color_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_color__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_color__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Size.
|
||||
'title_font_size' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_size_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_size_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_size_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_size__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_font_size__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Letter spacing.
|
||||
'title_letter_spacing' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_letter_spacing_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_letter_spacing_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_letter_spacing_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_letter_spacing__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_letter_spacing__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Line height.
|
||||
'title_line_height' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_line_height_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_line_height_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_line_height_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_line_height__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_line_height__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text horizontal shadow.
|
||||
'title_text_shadow_style' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_style' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_horizontal_length' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_horizontal_length_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_horizontal_length_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_horizontal_length_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_horizontal_length__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_horizontal_length__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text vertical shadow.
|
||||
'title_text_shadow_vertical_length' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_vertical_length_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_vertical_length_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_vertical_length_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_vertical_length__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_vertical_length__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Blur strength.
|
||||
'title_text_shadow_blur_strength' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_blur_strength_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_blur_strength_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_body_text_shadow_blur_strength_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_blur_strength__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_blur_strength__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Shadow color.
|
||||
'title_text_shadow_color' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_color_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color_last_edited' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_color_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color_tablet' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_color_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color_phone' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_color__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color__hover_enabled' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
'title_text_shadow_color__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color__hover' => array( 'et_pb_wc_cart_notice' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Migration 01: Add to Cart.
|
||||
// Text Font, weight & style.
|
||||
'field_label_font' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Color.
|
||||
'field_label_text_color' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_color_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_color_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_color_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_color__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_color__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_color__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Size.
|
||||
'field_label_font_size' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_size_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_size_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_size_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_size__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_font_size__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_font_size__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Letter spacing.
|
||||
'field_label_letter_spacing' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_letter_spacing_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_letter_spacing_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_letter_spacing_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_letter_spacing__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_letter_spacing__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_letter_spacing__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Line height.
|
||||
'field_label_line_height' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_line_height_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_line_height_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_line_height_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_line_height__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_line_height__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_line_height__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text horizontal shadow.
|
||||
'field_label_text_shadow_style' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_style' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_horizontal_length' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_horizontal_length_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_horizontal_length_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_horizontal_length_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_horizontal_length__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_horizontal_length__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_horizontal_length__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text vertical shadow.
|
||||
'field_label_text_shadow_vertical_length' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_vertical_length_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_vertical_length_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_vertical_length_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_vertical_length__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_vertical_length__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_vertical_length__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Blur strength.
|
||||
'field_label_text_shadow_blur_strength' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_blur_strength_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_blur_strength_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_body_text_shadow_blur_strength_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_blur_strength__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_blur_strength__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_blur_strength__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Text Shadow color.
|
||||
'field_label_text_shadow_color' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_color_last_edited' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color_last_edited' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_color_tablet' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color_tablet' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_color_phone' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color_phone' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_color__hover_enabled' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color__hover_enabled' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
'field_label_text_shadow_color__hover' => array(
|
||||
'affected_fields' => array(
|
||||
'body_text_shadow_color__hover' => array( 'et_pb_wc_add_to_cart' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
// phpcs:enable WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned -- Invalid warning.
|
||||
// phpcs:enable WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow -- Invalid warning.
|
||||
}
|
||||
|
||||
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing -- Paresh's PR contains function comment.
|
||||
public function migrate(
|
||||
$field_name,
|
||||
$current_value,
|
||||
$module_slug,
|
||||
$saved_value,
|
||||
$saved_field_name,
|
||||
$attrs,
|
||||
$content,
|
||||
$module_address
|
||||
) {
|
||||
// Don't migrate empty value.
|
||||
if ( ! empty( $current_value ) ) {
|
||||
return $current_value;
|
||||
}
|
||||
|
||||
return $saved_value;
|
||||
}
|
||||
}
|
||||
|
||||
return new ET_Builder_Module_Settings_Migration_WooTextOG();
|
Reference in New Issue
Block a user