diff --git a/src/php/Integration/Promotions/Elementor_Pro.php b/src/php/Integration/Promotions/Elementor_Pro.php deleted file mode 100644 index cf46e68b..00000000 --- a/src/php/Integration/Promotions/Elementor_Pro.php +++ /dev/null @@ -1,117 +0,0 @@ -is_custom_code_screen() ) { - return; - } - ?> -
- id, [ 'edit-elementor_snippet', 'elementor_snippet' ], true ); - } - - /** - * Promotion on the Custom CSS section, inside the Elementor Editor. - * - * @return void - */ - public function promotion_in_custom_css_section() { - add_action( 'elementor/element/common/section_custom_css/before_section_end', [ $this, 'add_promotion_to_custom_css_section' ], 10, 2 ); - } - - /** - * Register promotion section after the Custom CSS section. - * - * @param Widget_Base|Element_Base $element The Elementor element. - */ - public function add_promotion_to_custom_css_section( $element ) { - $element->add_control( - 'code_snippets_promotion_notice', - [ - 'type' => Controls_Manager::NOTICE, - 'notice_type' => 'info', - 'dismissible' => true, - 'heading' => esc_html__( 'Manage your custom styles', 'code-snippets' ), - 'content' => $this->get_promotion_content(), - ] - ); - } - - /** - * Get the promotion content with appropriate link. - * - * @return string - */ - private function get_promotion_content(): string { - $message = esc_html__( 'Code Snippets Pro provides a powerful and user-friendly alternative to Elementor Custom Code, with cloud sync, conditional logic, and advanced features.', 'code-snippets' ); - - if ( code_snippets()->licensing->is_licensed() ) { - $link_text = esc_html__( 'Manage CSS snippets', 'code-snippets' ); - $url = add_query_arg( 'type', 'css', code_snippets()->get_menu_url( 'manage' ) ); - } else { - $link_text = esc_html__( 'Learn More', 'code-snippets' ); - $url = 'https://codesnippets.pro/pricing/?utm_source=elementor&utm_medium=banner&utm_campaign=elementor-addon-custom-code'; - } - - return sprintf( '%sget_promotion_heading() ); ?>
+get_promotion_message() ); ?>
+print_promotion_buttons(); ?>
++ get_promotion_heading() ); ?> +
++ get_promotion_message() ); ?> +
++ get_promotion_buttons(); + + foreach ( $buttons as $button ) { + $url = isset( $button['url'] ) ? esc_url( $button['url'] ) : ''; + $text = isset( $button['text'] ) ? esc_html( $button['text'] ) : ''; + $class = isset( $button['class'] ) ? esc_attr( $button['class'] ) : 'button'; + $target = isset( $button['target'] ) ? esc_attr( $button['target'] ) : ''; + + printf( + '%s ', + $url, + $class, + $target ? ' target="' . $target . '"' : '', + $text + ); + } + ?> +
+