Update elementor pro
This commit is contained in:
@@ -81,24 +81,16 @@ class Style_Schema {
|
||||
}
|
||||
|
||||
private function update_union( Union_Prop_Type $union_prop_type ): Union_Prop_Type {
|
||||
$new_union = Union_Prop_Type::make();
|
||||
$dependencies = $union_prop_type->get_dependencies();
|
||||
$new_union->set_dependencies( $dependencies );
|
||||
|
||||
foreach ( $union_prop_type->get_prop_types() as $prop_type ) {
|
||||
$updated = $this->update( $prop_type );
|
||||
|
||||
if ( $updated instanceof Union_Prop_Type ) {
|
||||
foreach ( $updated->get_prop_types() as $updated_prop_type ) {
|
||||
$new_union->add_prop_type( $updated_prop_type );
|
||||
$union_prop_type->add_prop_type( $updated_prop_type );
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$new_union->add_prop_type( $updated );
|
||||
}
|
||||
|
||||
return $new_union;
|
||||
return $union_prop_type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace ElementorPro\Modules\Variables;
|
||||
|
||||
use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type;
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
|
||||
@@ -48,6 +49,8 @@ class Module extends Module_Base {
|
||||
}
|
||||
|
||||
$this->hooks()->register();
|
||||
|
||||
add_action( 'elementor/editor/before_enqueue_scripts', fn () => $this->enqueue_editor_scripts() );
|
||||
}
|
||||
|
||||
private function is_experiment_active(): bool {
|
||||
@@ -56,4 +59,24 @@ class Module extends Module_Base {
|
||||
&& Plugin::elementor()->experiments->is_feature_active( AtomicWidgetsModule::EXPERIMENT_NAME )
|
||||
&& Plugin::elementor()->experiments->is_feature_active( VariablesModule::EXPERIMENT_NAME );
|
||||
}
|
||||
|
||||
private function get_quota_config( $limit ): array {
|
||||
return [
|
||||
Size_Variable_Prop_Type::get_key() => $limit,
|
||||
];
|
||||
}
|
||||
|
||||
public function enqueue_editor_scripts() {
|
||||
$limit = 100000;
|
||||
|
||||
if ( API::is_license_expired() ) {
|
||||
$limit = 0;
|
||||
}
|
||||
|
||||
wp_add_inline_script(
|
||||
'elementor-common',
|
||||
'window.ElementorVariablesQuotaConfigExtended = ' . wp_json_encode( $this->get_quota_config( $limit ) ) . ';',
|
||||
'before'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// TODO: deprecate in 3.36
|
||||
class Size_Variable_Prop_Type extends String_Prop_Type {
|
||||
public static function get_key(): string {
|
||||
return 'global-size-variable';
|
||||
|
||||
Reference in New Issue
Block a user