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

Post Grid Gutenberg Blocks – PostX, version 2.5.2. 21 lines.

- Page: https://pluginprobe.com/plugins/ultimate-post/2.5.2/code/addons/table_of_content/init.php
- Raw: https://pluginprobe.com/plugins/ultimate-post/2.5.2/raw/addons/table_of_content/init.php
- Modified: 2022-02-08T11:56:56+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/2.5.2/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' => __( 'Add a Customizable Table of Contents into your blog posts and custom post types.', 'ultimate-post' ),
		'img' => ULTP_URL.'/assets/img/addons/table-of-content.svg',
		'is_pro' => false
	);
	$config['ultp_table_of_content'] = $configuration;
	return $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;
});
```
