- Priority bug with block-based content —
MarkupFixerwas hooked tothe_contentat priority 5, which runs before WordPress renders blocks (do_blocksruns at priority 9). On block-based posts the headings were still<!-- wp:heading -->comments when MarkupFixer ran, so noidattributes were ever added. Priority changed to 20 so MarkupFixer processes real<h2>/<h3>HTML.
- Heading IDs are now added to all content, not only shortcode posts — the
has_shortcodeguard has been removed fromfix_content_by_adding_anchors. Every post processed bythe_contentfilter now getsidattributes on its headings. This aligns with the plugin description ("adds ID anchor attributes for proper in-page links") and is harmless for sites not using the shortcode. Migration note for existing users: if you relied on the plugin only modifying shortcode posts, heading IDs will now appear on all posts. This is safe in practice; if you need opt-in behaviour, addremove_filter('the_content', ['PloverToc\TableOfContents', 'fix_content_by_adding_anchors'], 20)and re-add it selectively.
TableOfContents::build_toc_from_rendered_content(string $rendered_content): string— new public static method that parses H2–H4 headings from already-rendered post content (after the fullthe_contentfilter chain, so headings already carryidattributes) and returns the inner<li>HTML for a themed TOC widget. Does not runMarkupFixera second time.plovertoc_generate_toc_items_html(string $rendered_content): string— global helper function (autoloaded) that themes can call to retrieve server-side TOC markup. Returns an empty string if no H2–H4 headings withidattributes are found, making conditional rendering trivial.- Heading anchor links — opt-in feature that injects a permalink icon (
<a class="plovertoc-anchor-link">) inside every H2–H4 heading after its text. Disabled by default; themes enable it with one line:add_filter('plovertoc_anchor_links', '__return_true');Theplovertoc-anchor-linkCSS class is the styling hook. JS can enhance the link with copy-to-clipboard behaviour (construct full URL fromwindow.location+ thehreffragment). A double-injection guard ensures the link is never added twice even if the filter chain fires the content multiple times.
- Rebrand the plugin from "ClaraPress" to "PloverToc":
- The WordPress Plugin Review Team warned of infringement on the WordPress trademark by virtue of the portmanteau effect in which the "Press" part in "ClaraPress" was deemed as a composition of Clara and WordPress and hence a violation of the WordPress trademark policy.
- This also meant I had to abandon my ClaraPress.com domain name and move to a new one, namely PloverHub.com
- Fix errors and warnings as per the online WordPress playground with Plugin Check plugin
- oddly enough, the plugin check tool is not able to detect these when hosting on local
- Fix general errors and warnings generated by WordPress' Plugin Check plugin
- releases should not contain .keep files
- short description should be within 150 characters
- Added customizable heading levels for TOC using top_level and depth shortcode attributes.
- Implemented a filter clarapress_toc_summary_text to allow overriding the summary text in the TOC.
- Added localization support for summary text using the __() function and text domain clarapress-toc.
- Ensured compatibility with PHP 8.0+ and WordPress 6.4+
- Added a section for styling guidelines and provided an HTML template for users to see CSS classes to target.
- Updated documentation to include usage examples and customization options.
- Added SiteNavigationElement schema to enhance SEO with an option to enable/disable it via shortcode attribute schema.
- Workout a Github Action to automate the release process whenever a new tag is pushed to the repository.
- Initial commit of working code for the benefit of everyone who needs this plugin