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

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