HEX
Server: nginx/1.26.1
System: Linux 850a3e23ecee 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64
User: (1000)
PHP: 8.2.27
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/fixed-toc/compatibility/rank-math-plugin.php
<?php

/**
 * Filter to add plugins to the Rank Math SEO TOC list.
 *
 * @param array TOC plugins.
 */
add_filter( 'rank_math/researches/toc_plugins', function ( $toc_plugins ) {
	$toc_plugins['fixed-toc/fixed-toc.php'] = 'Fixed TOC';

	return $toc_plugins;
} );

/**
 * Applies Rank Math link attributes filter before creating headings data.
 *
 * FTOC Can't recognize heading tags if there are links within headings, because links are inserted extra attributes.
 *
 * @since 3.1.19
 */
add_action( 'fixedtoc_before_creating_data', function () {
	/** @noinspection PhpUndefinedClassInspection */
	/** @noinspection PhpUndefinedNamespaceInspection */
	$rank_math_link_attrs = new RankMath\Frontend\Link_Attributes();
	/** @noinspection PhpUndefinedMethodInspection */
	$rank_math_link_attrs->add_attributes();
} );