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 / class-blocks.php

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

141 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
26 /**
27 * Blocks
28 *
29 * @since 3.1.0
30 */
31 class Blocks {
32
33 /**
34 * Constructor
35 */
36 public function __construct() {
37 if ( ! is_plugin_active('elementor/elementor.php') ) {
38 return;
39 }
40
41 add_action( 'elementor/widgets/register', [ $this, 'register_widgets' ] );
42 add_action( 'elementor/elements/categories_registered', [ $this, 'register_category' ] );
43 }
44
45 /**
46 * Register category
47 *
48 * @param object $elements_manager
49 *
50 * @since 3.1.0
51 */
52 public function register_category( $elements_manager ) {
53 $elements_manager->add_category(
54 'copy-the-code',
55 [
56 'title' => esc_html__( 'Copy Anything to Clipboard', 'copy-the-code' ),
57 'icon' => 'fa fa-code',
58 ]
59 );
60 }
61
62 /**
63 * Register widgets
64 *
65 * @param object $widgets_manager
66 *
67 * @since 3.1.0
68 */
69 public function register_widgets( $widgets_manager ) {
70 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/email-sample/widget.php';
71 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/email-address/widget.php';
72 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/phone-number/widget.php';
73 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/copy-button/widget.php';
74 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/copy-icon/widget.php';
75 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/blockquote/widget.php';
76 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/code-snippet/widget.php';
77 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/message/widget.php';
78 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/wish/widget.php';
79 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/shayari/widget.php';
80 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/sms/widget.php';
81 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/deal/widget.php';
82 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/coupon/widget.php';
83 require_once COPY_THE_CODE_DIR . 'classes/elementor/widgets/ai-prompt-generator/widget.php';
84
85 $widgets_manager->register( new EmailSample() );
86 $widgets_manager->register( new EmailAddress() );
87 $widgets_manager->register( new PhoneNumber() );
88 $widgets_manager->register( new CopyButton() );
89 $widgets_manager->register( new CopyIcon() );
90 $widgets_manager->register( new Blockquote() );
91 $widgets_manager->register( new CodeSnippet() );
92 $widgets_manager->register( new Message() );
93 $widgets_manager->register( new Wish() );
94 $widgets_manager->register( new Shayari() );
95 $widgets_manager->register( new SMS() );
96 $widgets_manager->register( new Deal() );
97 $widgets_manager->register( new Coupon() );
98 $widgets_manager->register( new AIPromptGenerator() );
99 }
100
101 public static function get_blocks() {
102 return [
103 [
104 'id' => 'email-sample',
105 'name' => 'Email Sample',
106 'description' => 'Create the email sample and allow users to copy it.',
107 ],
108 [
109 'id' => 'email-address',
110 'name' => 'Email Address',
111 'description' => 'Add the email address and allow users to copy it.',
112 ],
113 [
114 'id' => 'phone-number',
115 'name' => 'Phone Number',
116 'description' => 'Add the phone number and allow users to copy it.',
117 ],
118 [
119 'id' => 'copy-button',
120 'name' => 'Copy Button',
121 'description' => 'Add the copy button and add the hidden content which you want to copy.',
122 ],
123 [
124 'id' => 'copy-icon',
125 'name' => 'Copy Icon',
126 'description' => 'Add the copy icon and add the hidden content which you want to copy.',
127 ],
128 [
129 'id' => 'blockquote',
130 'name' => 'Blockquote',
131 'description' => 'Create the blockquote and allow users to copy the text.',
132 ],
133 [
134 'id' => 'code-snippet',
135 'name' => 'Code Snippet',
136 'description' => 'Create the code snippet and allow users to copy the text.',
137 ],
138 ];
139 }
140
141 }