Alternate Headings Bug
-
I noticed that “Alternate Headings” does not work in the current version of the plugin.
In easy-table-of-contents.php file you replace the title and save new in $toc variable.
if ( @preg_match( ‘/^’ . $original_heading . ‘$/imU’, strip_tags( $toc[ $i ][0] ) ) ) {
//$matches[ $i ][0] = str_replace( $original_heading, $alt_heading, $matches[ $i ][0] );
$toc[ $i ][0] = $alt_heading;
}https://i.imgur.com/RLjeLJf.png
Then you use $matches variable to print the $title
https://i.imgur.com/GpygN1K.png
——–Maybe it depends on the version of PHP and in some versions when changing the $toc – changes $matches, but I think that this is the wrong approach.
https://i.imgur.com/LxRJkAf.png——–
And thanks for the plugin, very useful, except this little bug.
- The topic ‘Alternate Headings Bug’ is closed to new replies.