PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 4.0.5
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v4.0.5
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 / class-blocks.php

class-blocks.php in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 4.0.5, at classes/elementor/class-blocks.php

157 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor Blocks
4 *
5 * @package Copy the Code
6 * @since 3.1.0
7 */
8
9 namespace CopyTheCode\Elementor;
10
11 use CopyTheCode\Elementor\Block\Email\Sample as EmailSample;
12 use CopyTheCode\Elementor\Block\Email\Address as EmailAddress;
13 use CopyTheCode\Elementor\Block\PhoneNumber;
14 use CopyTheCode\Elementor\Block\CopyButton;
15 use CopyTheCode\Elementor\Block\CopyIcon;
16 use CopyTheCode\Elementor\Block\Blockquote;
17 use CopyTheCode\Elementor\Block\CodeSnippet;
18 use CopyTheCode\Elementor\Block\Message;
19 use CopyTheCode\Elementor\Block\Deal;
20 use CopyTheCode\Elementor\Block\Coupon;
21 use CopyTheCode\Elementor\Block\AI\Prompt\Generator as AIPromptGenerator;
22 use CopyTheCode\Elementor\Block\Wish;
23 use CopyTheCode\Elementor\Block\Shayari;
24 use CopyTheCode\Elementor\Block\SMS;
25 use CopyTheCode\Elementor\Block\Table;
26 use CopyTheCode\Elementor\Block\ContactInformation;
27
28 /**
29 * Blocks
30 *
31 * @since 3.1.0
32 */
33 class Blocks {
34
35 /**
36 * Constructor
37 */
38 public function __construct() {
39 if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
40 return;
41 }
42
43 add_action( 'elementor/widgets/register', [ $this, 'register_widgets' ] );
44 add_action( 'elementor/elements/categories_registered', [ $this, 'register_category' ] );
45 }
46
47 /**
48 * Register category
49 *
50 * @param object $elements_manager
51 *
52 * @since 3.1.0
53 */
54 public function register_category( $elements_manager ) {
55 $elements_manager->add_category(
56 'copy-the-code',
57 [
58 'title' => esc_html__( 'Copy Anything to Clipboard', 'copy-the-code' ),
59 'icon' => 'fa fa-code',
60 ]
61 );
62 }
63
64 /**
65 * Register widgets
66 *
67 * @param object $widgets_manager
68 *
69 * @since 3.1.0
70 */
71 public function register_widgets( $widgets_manager ) {
72 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/email-sample/widget.php';
73 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/email-address/widget.php';
74 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/phone-number/widget.php';
75 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/copy-button/widget.php';
76 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/copy-icon/widget.php';
77 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/blockquote/widget.php';
78 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/code-snippet/widget.php';
79 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/message/widget.php';
80 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/wish/widget.php';
81 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/shayari/widget.php';
82 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/sms/widget.php';
83 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/deal/widget.php';
84 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/coupon/widget.php';
85 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/ai-prompt-generator/widget.php';
86 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/table/widget.php';
87 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/contact-information/widget.php';
88
89 $widgets_manager->register( new EmailSample() );
90 $widgets_manager->register( new EmailAddress() );
91 $widgets_manager->register( new PhoneNumber() );
92 $widgets_manager->register( new CopyButton() );
93 $widgets_manager->register( new CopyIcon() );
94 $widgets_manager->register( new Blockquote() );
95 $widgets_manager->register( new CodeSnippet() );
96 $widgets_manager->register( new Message() );
97 $widgets_manager->register( new Wish() );
98 $widgets_manager->register( new Shayari() );
99 $widgets_manager->register( new SMS() );
100 $widgets_manager->register( new Deal() );
101 $widgets_manager->register( new Coupon() );
102 $widgets_manager->register( new AIPromptGenerator() );
103 $widgets_manager->register( new Table() );
104 $widgets_manager->register( new ContactInformation() );
105 }
106
107 /**
108 * Get blocks
109 *
110 * @return array
111 *
112 * @since 3.1.0
113 */
114 public static function get_blocks() {
115 return [
116 [
117 'id' => 'email-sample',
118 'name' => 'Email Sample',
119 'description' => 'Create the email sample and allow users to copy it.',
120 ],
121 [
122 'id' => 'email-address',
123 'name' => 'Email Address',
124 'description' => 'Add the email address and allow users to copy it.',
125 ],
126 [
127 'id' => 'phone-number',
128 'name' => 'Phone Number',
129 'description' => 'Add the phone number and allow users to copy it.',
130 ],
131 [
132 'id' => 'copy-button',
133 'name' => 'Copy Button',
134 'description' => 'Add the copy button and add the hidden content which you want to copy.',
135 ],
136 [
137 'id' => 'copy-icon',
138 'name' => 'Copy Icon',
139 'description' => 'Add the copy icon and add the hidden content which you want to copy.',
140 ],
141 [
142 'id' => 'blockquote',
143 'name' => 'Blockquote',
144 'description' => 'Create the blockquote and allow users to copy the text.',
145 ],
146 [
147 'id' => 'code-snippet',
148 'name' => 'Code Snippet',
149 'description' => 'Create the code snippet and allow users to copy the text.',
150 ],
151 ];
152 }
153
154 }
155
156 new Blocks();
157