PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.1
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.1
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / includes / Editors / Elementor / Widget / PrintButton.php

PrintButton.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.1, at includes/Editors/Elementor/Widget/PrintButton.php

83 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Editors\Elementor\Widget;
4
5 use WPDeveloper\BetterDocs\Editors\Elementor\BaseWidget;
6 use Elementor\Controls_Manager;
7
8
9
10 class PrintButton extends BaseWidget {
11
12 public function get_name() {
13 return 'betterdocs-print-button';
14 }
15
16 public function get_title() {
17 return __( 'Print Button', 'betterdocs' );
18 }
19
20 public function get_categories() {
21 return [ 'betterdocs-elements-single' ];
22 }
23
24 public function get_keywords() {
25 return [ 'betterdocs-elements', 'print', 'docs', 'betterdocs' ];
26 }
27
28 public function get_icon() {
29 return 'betterdocs-icon-printer';
30 }
31
32 protected function register_controls() {
33 $this->start_controls_section(
34 'print_button_section',
35 [
36 'label' => __( 'Icon', 'betterdocs' ),
37 'tab' => Controls_Manager::TAB_STYLE,
38 ]
39 );
40
41 $this->add_responsive_control(
42 'print_button_size',
43 [
44 'label' => __( 'Size', 'betterdocs' ),
45 'type' => Controls_Manager::SLIDER,
46 'size_units' => [ 'px', '%', 'em' ],
47 'range' => [
48 '%' => [
49 'max' => 100,
50 'step' => 1
51 ]
52 ],
53 'selectors' => [
54 '{{WRAPPER}} .betterdocs-print-pdf-2 .betterdocs-print-btn-2 svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
55 ]
56 ]
57 );
58
59 $this->add_control(
60 'print_button_background_color',
61 [
62 'label' => esc_html__( 'Background Color', 'betterdocs' ),
63 'type' => Controls_Manager::COLOR,
64 'selectors' => [
65 '{{WRAPPER}} .betterdocs-print-pdf-2 .betterdocs-print-btn-2 svg' => 'background-color: {{VALUE}};'
66 ]
67 ]
68 );
69
70 $this->end_controls_section();
71 }
72
73 public function view_params() {
74 return [
75 'enable' => true
76 ];
77 }
78
79 public function render_callback() {
80 $this->views( 'templates/parts/print-icon-2' );
81 }
82 }
83