@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-paragraph-ids/>
  a sioc:Post ;
  dc:title "Developer reference" ;
  dcterms:identifier 149788 ;
  dc:modified "2026-10-11T00:36:26Z"^^xsd:dateTime ;
  dc:created "2026-10-11T00:36:26Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-paragraph-ids/developer-reference/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded "<ul class=\"lh_portfolio-meta\"><li><strong>Part of:</strong> <a href=\"https://lhero.org/portfolio/lh-paragraph-ids/\">LH Paragraph IDs</a></li></ul><h2 class=\"wp-block-heading\">What is changed</h2><p class=\"wp-block-paragraph\">On a single post, page or custom post type, the main post&#8217;s content is parsed with PHP&#8217;s DOMDocument and every <code>p</code>, <code>h1</code>, <code>h2</code>, <code>h3</code> and <code>h4</code> element without an id gets <code>id=\"lh_element_id-{tag}{post ID}-{n}\"</code>, where <code>n</code> counts from 0 for each tag. Every one of those elements gets the class <code>lh-paragraph-id</code>. Nothing is done where the DOM extension is not available.</p><h2 class=\"wp-block-heading\">When content is changed</h2><p class=\"wp-block-paragraph\">A <code>the_content</code> filter at priority 10 is added on <code>template_redirect</code> for singular, non-feed requests. It acts once per request, only on the queried post&#8217;s content, and only when that content is rendered for the page body: after <code>wp_body_open</code> in classic and PHP templates, or while a block template renders its markup (after <code>template_include</code>, before <code>wp_head</code>). Content run for the page head, such as excerpts built for meta tags, and content of other posts shown on the page are left alone.</p><h2 class=\"wp-block-heading\">Filters</h2><ul class=\"wp-block-list\"><li><code>lh_paragraph_ids_return_elegible_tags</code>: the tag names that get ids (default <code>p</code>, <code>h1</code> to <code>h4</code>). Adding a tag numbers it from 0 without changing the ids of the others.</li><li><code>lh_paragraph_ids_link_enabled</code>: return true to add the ¶ paragraph links (default false).</li><li><code>lh_paragraph_ids_init_plugin</code>: return false to switch the plugin off in code without deactivating it.</li></ul><h2 class=\"wp-block-heading\">Script</h2><p class=\"wp-block-paragraph\">The paragraph link script (handle <code>lh_paragraph_ids-script</code>, deferred, in the footer) is enqueued only when links are enabled and the content has paragraphs. It appends <code>&lt;span&gt; &lt;a class=\"lh-paragraph-id-anchor\" href=\"#{id}\"&gt;¶&lt;/a&gt;&lt;/span&gt;</code> to every <code>p.lh-paragraph-id</code> with an id. The link title (&#8220;Link to this paragraph&#8221;) is translatable.</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH Paragraph IDsWhat is changedOn a single post, page or custom post type, the main post&#8217;s content is parsed with PHP&#8217;s DOMDocument and every p, h1, h2, h3 and h4 element without an id gets id=\"lh_element_id-{tag}{post ID}-{n}\", where n counts from 0 for each tag. Every one of those elements gets the class lh-paragraph-id. Nothing is done where the DOM extension is not available.When content is changedA the_content filter at priority 10 is added on template_redirect for singular, non-feed requests. It acts once per request, only on the queried post&#8217;s content, and only when that content is rendered for the page body: after wp_body_open in classic and PHP templates, or while a block template renders its markup (after template_include, before wp_head). Content run for the page head, such as excerpts built for meta tags, and content of other posts shown on the page are left alone.Filterslh_paragraph_ids_return_elegible_tags: the tag names that get ids (default p, h1 to h4). Adding a tag numbers it from 0 without changing the ids of the others.lh_paragraph_ids_link_enabled: return true to add the ¶ paragraph links (default false).lh_paragraph_ids_init_plugin: return false to switch the plugin off in code without deactivating it.ScriptThe paragraph link script (handle lh_paragraph_ids-script, deferred, in the footer) is enqueued only when links are enabled and the content has paragraphs. It appends &lt;span&gt; &lt;a class=\"lh-paragraph-id-anchor\" href=\"#{id}\"&gt;¶&lt;/a&gt;&lt;/span&gt; to every p.lh-paragraph-id with an id. The link title (&#8220;Link to this paragraph&#8221;) is translatable." ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
