PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 3.2.1
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v3.2.1
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.2.1, at classes/elementor/widgets/blockquote/widget.php

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