| @@ -811,13 +811,23 @@ | ||
| 811 | 811 | |
| 812 | 812 | unset( $args['devices'] ); |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | + $control_to_check = $args; | |
| 816 | + | |
| 817 | + if ( ! empty( $options['overwrite'] ) ) { | |
| 818 | + $existing_control = Plugin::$instance->controls_manager->get_control_from_stack( $this->get_unique_name(), $id ); | |
| 819 | + | |
| 820 | + if ( ! is_wp_error( $existing_control ) ) { | |
| 821 | + $control_to_check = $existing_control; | |
| 822 | + } | |
| 823 | + } | |
| 824 | + | |
| 815 | 825 | $responsive_duplication_mode = Plugin::$instance->breakpoints->get_responsive_control_duplication_mode(); |
| 816 | 826 | $additional_breakpoints_active = Plugin::$instance->experiments->is_feature_active( 'additional_custom_breakpoints' ); |
| 817 | - $control_is_dynamic = ! empty( $args['dynamic']['active'] ); | |
| 818 | - $is_frontend_available = ! empty( $args['frontend_available'] ); | |
| 819 | - $has_prefix_class = ! empty( $args['prefix_class'] ); | |
| 827 | + $control_is_dynamic = ! empty( $control_to_check['dynamic']['active'] ); | |
| 828 | + $is_frontend_available = ! empty( $control_to_check['frontend_available'] ); | |
| 829 | + $has_prefix_class = ! empty( $control_to_check['prefix_class'] ); | |
| 820 | 830 | |
| 821 | 831 | // If the new responsive controls experiment is active, create only one control - duplicates per device will |
| 822 | 832 | // be created in JS in the Editor. |
| 823 | 833 | if ( |