# ultimate-post/4.0.3/addons/table_of_content/init.php

Post Grid Gutenberg Blocks – PostX, version 4.0.3. 25 lines.

- Page: https://pluginprobe.com/plugins/ultimate-post/4.0.3/code/addons/table_of_content/init.php
- Raw: https://pluginprobe.com/plugins/ultimate-post/4.0.3/raw/addons/table_of_content/init.php
- Modified: 2024-01-15T10:13:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ultimate-post/4.0.3/code/addons/table_of_content/init.php#L10-L20`.

```php
<?php
defined( 'ABSPATH' ) || exit;

add_filter('ultp_addons_config', 'ultp_toc_config');
function ultp_toc_config( $config ) {
	$configuration = array(
		'name' => __( 'Table of Contents', 'ultimate-post' ),
		'desc' => __( 'It enables a highly customizable block to the Gutenberg blocks library to display the Table of Contents.', 'ultimate-post' ),
		'img' => ULTP_URL.'/assets/img/addons/table-of-content.svg',
		'is_pro' => false,
		'docs' => 'https://wpxpo.com/docs/postx/add-on/table-of-content/', 
		'live' => 'https://www.wpxpo.com/postx/addons/table-of-content/live_demo_args',
		'video' => 'https://www.youtube.com/watch?v=xKu_E720MkE',
		'position' => 25
	);
	$arr['ultp_table_of_content'] = $configuration;
	return $arr + $config;
}

add_filter( 'rank_math/researches/toc_plugins', function( $toc_plugins ) {
	if (has_block( 'ultimate-post/table-of-content' ) ) {
		$toc_plugins['ultimate-post/ultimate-post.php'] = 'PostX';
	}
 	return $toc_plugins;
});
```
