You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix duplicate Elementor promotion control registration #550
Code Snippets 3.10.2 can register the same Elementor promotion control twice while loading the Elementor editor. Elementor then reports:
Function Elementor\Controls_Manager::add_control_to_stack was called incorrectly. Cannot redeclare control with same name "code_snippets_promotion_notice_elementor_pro".
The notice occurs with Code Snippets active even when all individual snippets are disabled, and disappears when Code Snippets is deactivated.
Root cause
Plugin::load_plugin() instantiates Promotion_Manager twice on admin requests:
Each Promotion_Manager creates an Elementor_Editor, which registers another elementor/init callback. Both instances then attach callbacks that add the same code_snippets_promotion_notice_elementor_pro control.
The duplicate initialization is present in the 3.10.2 release and remains present on core and core-beta.
Expected behavior
Promotion_Manager is initialized once per request.
The Elementor Core and Elementor Pro promotion controls are each registered once.
Opening the Elementor editor does not produce a duplicate-control notice.
Acceptance criteria
Remove the duplicate Promotion_Manager initialization.
Verify Elementor and Elementor Pro editor loading with Code Snippets active.
Add regression coverage that prevents the promotion integration from being initialized twice.
Activity