@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-html-sitemap/>
  a sioc:Post ;
  dc:title "Blocks, hooks and filters" ;
  dcterms:identifier 148163 ;
  dc:modified "2026-09-22T14:00:53Z"^^xsd:dateTime ;
  dc:created "2026-09-22T14:00:53Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-html-sitemap/blocks-hooks-and-filters/> ;
  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-html-sitemap/">LH HTML Sitemap</a></li></ul>
<h2 class="wp-block-heading">Blocks</h2>



<ul class="wp-block-list">
<li><code>lh-html-sitemap/sitemap</code>: dynamic block, one per page. Attribute <code>showTaxonomies</code> (boolean, default false). Logged-out visitors get a render of the public statuses, stored in the object cache (group <code>lh_html_sitemap</code>) under a key built from the attributes, the public statuses, the per-type cap and <code>wp_cache_get_last_changed( 'posts' )</code> (plus <code>'terms'</code> when taxonomies are shown), so it refreshes itself when content changes. Logged-in users get a live render on every request, never cached, and the block fires <code>litespeed_control_set_nocache</code> so LiteSpeed does not cache that page.</li>



<li><code>lh-html-sitemap/sitemap-link</code>: dynamic Navigation child block (parent <code>core/navigation</code>, listed through <code>block_core_navigation_listable_blocks</code>). Attribute <code>label</code> (default &#8220;Sitemap&#8221;). Links to the sitemap page and renders nothing while there is none.</li>
</ul>



<h2 class="wp-block-heading">Sitemap page</h2>



<p class="wp-block-paragraph">When a published post containing the Sitemap block is saved (<code>wp_after_insert_post</code>), its ID is stored in the option <code>lh_html_sitemap-page_id</code>; it is removed when that post is saved without the block or unpublished. Every read re-checks that the stored post is still published and still has the block.</p>



<h2 class="wp-block-heading">Filters</h2>



<ul class="wp-block-list">
<li><code>lh_html_sitemap_return_public_statuses</code>: statuses listed for logged-out visitors (default <code>publish</code>). A plugin that registers a status visitors can view, such as an archived status, adds it here.</li>



<li><code>lh_html_sitemap_return_logged_in_statuses</code>: statuses queried for logged-in users (default: every non-internal, non-protected status plus the public ones). Posts outside the public statuses must also pass <code>current_user_can( 'read_post' )</code>.</li>



<li><code>lh_html_sitemap_return_post_types</code>: post types listed, applied after core&#8217;s <code>wp_sitemaps_post_types</code>.</li>



<li><code>lh_html_sitemap_return_taxonomies</code>: taxonomies listed when enabled, applied after core&#8217;s <code>wp_sitemaps_taxonomies</code>.</li>



<li><code>lh_html_sitemap_return_items_per_type_cap</code>: items per post type or taxonomy before an archive link is shown (default 200).</li>



<li><code>lh_html_sitemap_get_excluded_post_ids</code>: post IDs never listed (default: WooCommerce cart, checkout and account pages).</li>



<li><code>lh_html_sitemap_post_type_query_args</code>: the <code>get_posts()</code> arguments per post type; also receives the post type object and whether the render is for a logged-in user.</li>



<li><code>lh_html_sitemap_get_sitemap_page_id</code>: the sitemap page ID used by the link block and menus.</li>



<li><code>lh_html_sitemap_sitemap_block_name</code>, <code>lh_html_sitemap_sitemap_link_block_name</code>: the block names.</li>



<li><code>lh_html_sitemap_init_plugin</code>: return false to stop the plugin loading.</li>
</ul>



<h2 class="wp-block-heading">Classic menus</h2>



<p class="wp-block-paragraph">With LH Dynamic Menu Items active, an &#8220;HTML Sitemap&#8221; item (<code>#lh_html_sitemap-site_map-link#</code>) is offered for classic menus, through <code>lh_dmis_return_menu_array</code> and <code>lh_dmis_switch_item</code>. It points to the sitemap page, and is left unchanged while there is none.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH HTML Sitemap
Blocks




lh-html-sitemap/sitemap: dynamic block, one per page. Attribute showTaxonomies (boolean, default false). Logged-out visitors get a render of the public statuses, stored in the object cache (group lh_html_sitemap) under a key built from the attributes, the public statuses, the per-type cap and wp_cache_get_last_changed( 'posts' ) (plus 'terms' when taxonomies are shown), so it refreshes itself when content changes. Logged-in users get a live render on every request, never cached, and the block fires litespeed_control_set_nocache so LiteSpeed does not cache that page.



lh-html-sitemap/sitemap-link: dynamic Navigation child block (parent core/navigation, listed through block_core_navigation_listable_blocks). Attribute label (default &#8220;Sitemap&#8221;). Links to the sitemap page and renders nothing while there is none.




Sitemap page



When a published post containing the Sitemap block is saved (wp_after_insert_post), its ID is stored in the option lh_html_sitemap-page_id; it is removed when that post is saved without the block or unpublished. Every read re-checks that the stored post is still published and still has the block.



Filters




lh_html_sitemap_return_public_statuses: statuses listed for logged-out visitors (default publish). A plugin that registers a status visitors can view, such as an archived status, adds it here.



lh_html_sitemap_return_logged_in_statuses: statuses queried for logged-in users (default: every non-internal, non-protected status plus the public ones). Posts outside the public statuses must also pass current_user_can( 'read_post' ).



lh_html_sitemap_return_post_types: post types listed, applied after core&#8217;s wp_sitemaps_post_types.



lh_html_sitemap_return_taxonomies: taxonomies listed when enabled, applied after core&#8217;s wp_sitemaps_taxonomies.



lh_html_sitemap_return_items_per_type_cap: items per post type or taxonomy before an archive link is shown (default 200).



lh_html_sitemap_get_excluded_post_ids: post IDs never listed (default: WooCommerce cart, checkout and account pages).



lh_html_sitemap_post_type_query_args: the get_posts() arguments per post type; also receives the post type object and whether the render is for a logged-in user.



lh_html_sitemap_get_sitemap_page_id: the sitemap page ID used by the link block and menus.



lh_html_sitemap_sitemap_block_name, lh_html_sitemap_sitemap_link_block_name: the block names.



lh_html_sitemap_init_plugin: return false to stop the plugin loading.




Classic menus



With LH Dynamic Menu Items active, an &#8220;HTML Sitemap&#8221; item (#lh_html_sitemap-site_map-link#) is offered for classic menus, through lh_dmis_return_menu_array and lh_dmis_switch_item. It points to the sitemap page, and is left unchanged while there is none.
""" ;
  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> .
