PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 5.5.4
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v5.5.4
5.5.4 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 All 79 releases
copy-the-code / includes / elementor / widgets / blockquote / widget.php

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

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