PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 3.7.0
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v3.7.0
5.5.3 3.1.0 3.2.0 3.2.1 3.3.0 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.6.0 3.7.0 3.8.0 3.8.1 3.8.2 3.8.3 4.0.0 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 All 78 releases
copy-the-code / classes / elementor / widgets / blockquote / widget.php

widget.php in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 3.7.0, at classes/elementor/widgets/blockquote/widget.php

195 lines 4.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Elementor Blockquote Block
5 *
6 * @package Copy the Code
7 * @since 3.1.0
8 */
9 namespace CopyTheCode\Elementor\Block;
10
11 use CopyTheCode\Helpers ;
12 use Elementor\Widget_Base ;
13 use Elementor\Controls_Manager ;
14 /**
15 * Blockquote Block
16 *
17 * @since 3.1.0
18 */
19 class Blockquote extends Widget_Base
20 {
21 /**
22 * Constructor
23 *
24 * @param array $data
25 * @param array $args
26 *
27 * @since 3.1.0
28 */
29 public function __construct( $data = array(), $args = null )
30 {
31 parent::__construct( $data, $args );
32 // Core.
33 wp_enqueue_style(
34 'ctc-blocks-core',
35 COPY_THE_CODE_URI . 'classes/blocks/assets/css/style.css',
36 [],
37 COPY_THE_CODE_VER,
38 'all'
39 );
40 wp_enqueue_script(
41 'ctc-clipboard',
42 COPY_THE_CODE_URI . 'assets/js/clipboard.js',
43 [ 'jquery' ],
44 COPY_THE_CODE_VER,
45 true
46 );
47 wp_enqueue_script(
48 'ctc-blocks-core',
49 COPY_THE_CODE_URI . 'classes/blocks/assets/js/core.js',
50 [ 'ctc-clipboard' ],
51 COPY_THE_CODE_VER,
52 true
53 );
54 // Block.
55 wp_enqueue_style(
56 'ctc-el-blockquote',
57 COPY_THE_CODE_URI . 'classes/elementor/widgets/blockquote/style.css',
58 [ 'ctc-blocks-core' ],
59 COPY_THE_CODE_VER,
60 'all'
61 );
62 }
63
64 /**
65 * Get script dependencies
66 */
67 public function get_script_depends()
68 {
69 return [ 'ctc-el-blockquote' ];
70 }
71
72 /**
73 * Get style dependencies
74 */
75 public function get_style_depends()
76 {
77 return [ 'ctc-clipboard', 'ctc-blocks-core' ];
78 }
79
80 /**
81 * Get name
82 */
83 public function get_name()
84 {
85 return 'ctc_blockquote';
86 }
87
88 /**
89 * Get title
90 */
91 public function get_title()
92 {
93 return esc_html__( 'Blockquote', 'copy-the-code' );
94 }
95
96 /**
97 * Get icon
98 */
99 public function get_icon()
100 {
101 return 'eicon-blockquote';
102 }
103
104 /**
105 * Get categories
106 */
107 public function get_categories()
108 {
109 return [ 'copy-the-code' ];
110 }
111
112 /**
113 * Get keywords
114 */
115 public function get_keywords()
116 {
117 return Helpers::get_keywords( [ 'blockquote', 'quote' ] );
118 }
119
120 /**
121 * Render
122 */
123 public function render()
124 {
125 $blockquote = $this->get_settings_for_display( 'blockquote' );
126 $author = $this->get_settings_for_display( 'author' );
127 $with_icon = ( 'yes' === $this->get_settings_for_display( 'show_icon' ) ? 'with-icon' : '' );
128 ?>
129 <div class="ctc-block ctc-blockquote">
130 <div class="ctc-block-content">
131 <div class="ctc-blockquote-box">
132 <div class="ctc-blockquote-message"><?php
133 echo wp_kses_post( $blockquote ) ;
134 ?></div>
135 <div class="ctc-blockquote-author"><?php
136 echo esc_html( $author ) ;
137 ?></div>
138 </div>
139 </div>
140 <div class="ctc-block-actions">
141 <?php
142 Helpers::render_copy_button( $this );
143 ?>
144 </div>
145 <?php
146 Helpers::render_copy_content( $this );
147 ?>
148 </div>
149 <?php
150 }
151
152 /**
153 * Register controls
154 */
155 protected function _register_controls()
156 {
157 // Copy Content Section.
158 Helpers::register_copy_content_section( $this, [
159 'default' => '"Top improve is to change; to be perfect is to change often."
160
161 — WINSTON CHURCHILL',
162 ] );
163 /**
164 * Group: Blockquote Section
165 */
166 $this->start_controls_section( 'blockquote_section', [
167 'label' => esc_html__( 'Blockquote', 'copy-the-code' ),
168 ] );
169 $this->add_control( 'blockquote', [
170 'label' => esc_html__( 'Blockquote', 'copy-the-code' ),
171 'type' => Controls_Manager::TEXTAREA,
172 'default' => '"Top improve is to change; to be perfect is to change often."',
173 'rows' => 10,
174 ] );
175 $this->add_control( 'author', [
176 'label' => esc_html__( 'Author', 'copy-the-code' ),
177 'type' => Controls_Manager::TEXT,
178 'default' => '— WINSTON CHURCHILL',
179 ] );
180 $this->end_controls_section();
181 // Copy Button Section.
182 Helpers::register_copy_button_section( $this, [
183 'button_text' => esc_html__( 'Copy Blockquote', 'copy-the-code' ),
184 ] );
185 Helpers::register_pro_sections( $this, [
186 'Quote Box',
187 'Message Box',
188 'Quote',
189 'Author'
190 ] );
191 // Copy Button Style Section.
192 Helpers::register_copy_button_style_section( $this );
193 }
194
195 }