table-of-contents icon indicating copy to clipboard operation
table-of-contents copied to clipboard

Adds a table of contents to your WordPress pages based on h3 and h4 tags. Useful for documention-centric sites.

Results 7 table-of-contents issues
Sort by recently updated
recently updated
newest added

The plugin can't run with php 8 version, no toc rendered in the page.

Addresses #1 Filters the conditional that controls when a TOC is added, allowing plugin customization.

resolves #4 This PR removes `h4` tags from the default TOC generation, as they were not added correctly. Now, `h3` is used by default and is filterable, allowing `h4` tags...

Introduced in WP5.8 https://make.wordpress.org/core/2021/06/29/introducing-update-uri-plugin-header-in-wordpress-5-8/ Since there's another "table-of-contents" plugin in the wporg repo, this would prevent accidental overwrites when updating from the admin.

The TOC only generate the h3 headings tag, the h4 headings are not listed in the TOC generated

Not strictly a Gutenberg/Block Editor problem, but that does make it vastly easier to create incompatible headings. The regex only matches plain tags: https://github.com/Automattic/table-of-contents/blob/5b3da29a3831ac7b10526394c18320b7a4004b4b/table-of-contents.php#L129 Any attributes added such as alignment...

enhancement

I'd love to use this plugin on my employer's Intranet site. Would would be the most sensible way to modify this plugin so that it only renders a TOC on...