upgraded to 4.14
This commit is contained in:
@ -92,6 +92,7 @@ class ET_Builder_Global_Presets_Settings {
|
||||
// phpcs:enable
|
||||
|
||||
add_action( 'et_builder_ready', array( $this, 'migrate_custom_defaults' ), 100 );
|
||||
add_action( 'et_builder_ready', array( $this, 'apply_attribute_migrations' ), 101 );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -395,10 +396,23 @@ class ET_Builder_Global_Presets_Settings {
|
||||
et_update_option( self::CUSTOM_DEFAULTS_MIGRATED_FLAG, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply attribute migrations.
|
||||
*
|
||||
* @since 4.14.0
|
||||
*/
|
||||
public function apply_attribute_migrations() {
|
||||
foreach ( $this->_settings as $module => $preset_structure ) {
|
||||
foreach ( $preset_structure->presets as $preset_id => $preset ) {
|
||||
self::migrate_settings_as_module_attributes( $preset, $module );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuring and running migration of global presets via "et_pb_module_shortcode_attributes".
|
||||
*
|
||||
* @since ?
|
||||
* @since 4.14.0
|
||||
*
|
||||
* @param object $preset Global preset object.
|
||||
* @param string $module_slug Module slug.
|
||||
@ -444,15 +458,16 @@ class ET_Builder_Global_Presets_Settings {
|
||||
|
||||
/**
|
||||
* Converts module type (slug).
|
||||
*
|
||||
* Used to separate Global Presets settings for modules sharing the same slug but having different meaning
|
||||
* For example: Regular, Fullwidth and Specialty section types
|
||||
*
|
||||
* @since 4.5.0
|
||||
*
|
||||
* @param string $type - The module type (slug).
|
||||
* @param array $attrs - The module attributes.
|
||||
* @param string $type The module type (slug).
|
||||
* @param array $attrs The module attributes.
|
||||
*
|
||||
* @return string - The converted module type (slug)
|
||||
* @return string The converted module type (slug)
|
||||
*/
|
||||
public function maybe_convert_module_type( $type, $attrs ) {
|
||||
if ( isset( self::$_module_types_conversion_map[ $type ] ) ) {
|
||||
@ -531,7 +546,7 @@ class ET_Builder_Global_Presets_Settings {
|
||||
*
|
||||
* Returns FALSE when the value is an Object or an array.
|
||||
*
|
||||
* @since ?? Included PHPDoc description.
|
||||
* @since 4.13.0 Included PHPDoc description.
|
||||
* @since 4.5.0
|
||||
*
|
||||
* @param $value - The Global Presets setting value
|
||||
|
Reference in New Issue
Block a user