PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 3.8.3
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v3.8.3
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 / gutenberg / class-blocks.php

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

53 lines 897 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Gutenberg Blocks
4 *
5 * @package Copy the Code
6 * @since 3.1.0
7 */
8
9 namespace CopyTheCode\Gutenberg;
10
11 use CopyTheCode\Gutenberg\Blocks\Icon;
12
13 /**
14 * Blocks
15 *
16 * @since 3.1.0
17 */
18 class Blocks {
19
20 /**
21 * Constructor
22 */
23 public function __construct() {
24 require_once COPY_THE_CODE_DIR . 'classes/gutenberg/blocks/icon/class-block.php';
25
26 new Icon();
27
28 add_filter( 'block_categories_all', [ $this, 'add_block_category' ], 10, 2 );
29 }
30
31 /**
32 * Add block category.
33 *
34 * @param array $categories Block categories.
35 * @param object $post Post object.
36 * @return array
37 */
38 public function add_block_category( $categories, $post ) {
39 return array_merge(
40 $categories,
41 [
42 [
43 'slug' => 'ctc-blocks',
44 'title' => esc_html__( 'Copy Anything to Clipboard', 'copy-the-code' ),
45 ],
46 ]
47 );
48 }
49
50 }
51
52 new Blocks();
53