PluginProbe
Getwid – Gutenberg Blocks / 3.0.2
Getwid – Gutenberg Blocks v3.0.2
3.0.2 3.0.1 3.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 trunk 1.8.7 1.9.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
getwid / includes / blocks / table-of-contents.php

table-of-contents.php in Getwid – Gutenberg Blocks 3.0.2, at includes/blocks/table-of-contents.php

43 lines 784 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Getwid\Blocks;
4
5 class TableOfContents extends AbstractBlock {
6
7 public function __construct() {
8
9 parent::__construct( 'getwid/table-of-contents' );
10
11 register_block_type(
12 getwid_get_plugin_path( 'assets/blocks/table-of-contents' ),
13 array(
14 'render_callback' => array( $this, 'render_callback' ),
15 )
16 );
17
18 /**
19 * Rank Math ToC Plugins List.
20 */
21 add_filter(
22 'rank_math/researches/toc_plugins',
23 function ( $toc_plugins ) {
24 $toc_plugins['getwid/getwid.php'] = 'Getwid';
25
26 return $toc_plugins;
27 }
28 );
29 }
30
31 public function get_label() {
32 return __( 'Table of Contents', 'getwid' );
33 }
34
35 public function render_callback( $attributes, $content ) {
36 return $content;
37 }
38 }
39
40 getwid()->blocksManager()->addBlock(
41 new TableOfContents()
42 );
43