Helping Organisations get organised!

Changelog

  • 2.2.0: Maintenance release; the ids added to paragraphs and headings are unchanged. The optional paragraph link feature (the lh_paragraph_ids_link_enabled filter) works again: its script was registered with attributes the loader could not apply, which dropped the script tag, and it only matched paragraphs whose sole class was lh-paragraph-id, which block content never has. The script is now registered with WordPress’s own defer loading, finds every paragraph with an id, and its link title can be translated. The text domain is now lh-paragraph-ids, matching the plugin slug. The plugin can be switched off in code with the new lh_paragraph_ids_init_plugin filter, and gains plugin_name() and plugin_version(). The libxml error setting is restored after parsing, and nothing is done where PHP’s DOM extension is missing. Header: clearer description, License, License URI and Requires PHP 7.4 added. Code tidied to current standards, the closing PHP tag and the class_exists guard around the class removed. The bundled LH_Register_file_class is no longer used and is removed. Lh-tasks #148021.
  • 2.1.0: Paragraph and heading ids now work on pages that use a block template. The content filter was added when the body tag’s classes were built, which in a block template happens after the post content has already been rendered, so those pages lost their lh_element_id anchors and links to a paragraph stopped working. The filter is now added before the page renders, on single posts and pages only, and acts only on the main post’s content in the page body, once per page: after the body opens in classic and PHP templates, as before, or while a block template renders its markup. The ids it adds are unchanged. Fixed: backslashes in content (for example in code) were removed when the ids were added, because the content was passed through stripslashes. Feeds are no longer filtered. Requires WordPress 6.1. Lh-tasks #148021.
  • 2.00: Removed settings, improved and simplified.
  • 1.00: Object-oriented code.
  • 0.02: Only filter content on the front end.
  • 0.01: Initial release.

If you like this plugin please consider making a donation to further development