@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-related-posts-by-taxonomy/>
  a sioc:Post ;
  dc:title "Developer reference" ;
  dcterms:identifier 149236 ;
  dc:modified "2026-10-05T12:56:53Z"^^xsd:dateTime ;
  dc:created "2026-10-05T12:56:53Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-related-posts-by-taxonomy/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-related-posts-by-taxonomy/">LH Related Posts by Taxonomy</a></li></ul>
<h2 class="wp-block-heading">Filters</h2>



<ul class="wp-block-list">
<li><code>lh_rpbt_auto_add_related</code> (bool, default true): whether the list is appended to post content on classic templates. Return false to turn it off.</li>



<li><code>lh_rpbt_is_singular_template_slug</code> (bool, $slug): whether the block is hooked after the post content in the block template with this slug.</li>



<li><code>lh_rpbt_get_related_post_types</code> (array, $post; default <code>array( 'post' )</code>): the post types searched for related items.</li>



<li><code>lh_rpbt_get_applicable_post_types</code> (array): post types that show related posts and get the per-post toggle. Defaults to viewable post types supporting the editor, except attachments and WooCommerce products.</li>



<li><code>lh_rpbt_return_term_ids</code> (array $term_ids, $post, $taxonomies): the terms matched against.</li>



<li><code>lh_rpbt_get_excluded_ids_filter</code> (array $ids, $post; default the current post): posts never returned.</li>



<li><code>lh_rpbt_get_included_ids_filter</code> (false|array $ids, $post): when set, only these posts can be returned.</li>



<li><code>lh_rpbt_return_related_post_args</code> (array $args, $content, $post): arguments for the automatic list and the block; set <code>post_ids</code> to choose the posts directly.</li>



<li><code>lh_rpbt_thumbnail_id_fallback</code> (int $attachment_id, $post_id): the image shown for each related post.</li>
</ul>



<p class="wp-block-paragraph">All IDs and term IDs returned by these filters are validated as positive integers, and the query is built with prepared statements.</p>



<h2 class="wp-block-heading">Overriding the template</h2>



<p class="wp-block-paragraph">Copy <code>lh_rpbt-templates/default-template.php</code> from the plugin to <code>lh_rpbt-templates/default-template.php</code> in the active (child) theme. It receives <code>$the_query</code>, a WP_Query of the related posts. The default output is a <code>div.lh_rpbt-related_div.no-print</code> holding an <code>h3</code> and a <code>ul.lh_rpbt-related_post_list</code>; in block templates it is wrapped in the block&#8217;s own wrapper.</p>



<h2 class="wp-block-heading">Stored data</h2>



<ul class="wp-block-list">
<li>Post meta <code>lh_rpbt_hide</code> (boolean, in the REST API): set when a post&#8217;s Show related posts toggle is off.</li>



<li>Option <code>lh_rpbt-schema_version</code> (per site): the upgrade routine&#8217;s progress.</li>
</ul>



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



<p class="wp-block-paragraph">Image size <code>lh_rpbt_featured</code> (200 by 150, cropped). Stylesheet handle <code>lh_rpbt-style</code>, enqueued only when a list is output; themes can override its rules.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Related Posts by Taxonomy
Filters




lh_rpbt_auto_add_related (bool, default true): whether the list is appended to post content on classic templates. Return false to turn it off.



lh_rpbt_is_singular_template_slug (bool, $slug): whether the block is hooked after the post content in the block template with this slug.



lh_rpbt_get_related_post_types (array, $post; default array( 'post' )): the post types searched for related items.



lh_rpbt_get_applicable_post_types (array): post types that show related posts and get the per-post toggle. Defaults to viewable post types supporting the editor, except attachments and WooCommerce products.



lh_rpbt_return_term_ids (array $term_ids, $post, $taxonomies): the terms matched against.



lh_rpbt_get_excluded_ids_filter (array $ids, $post; default the current post): posts never returned.



lh_rpbt_get_included_ids_filter (false|array $ids, $post): when set, only these posts can be returned.



lh_rpbt_return_related_post_args (array $args, $content, $post): arguments for the automatic list and the block; set post_ids to choose the posts directly.



lh_rpbt_thumbnail_id_fallback (int $attachment_id, $post_id): the image shown for each related post.




All IDs and term IDs returned by these filters are validated as positive integers, and the query is built with prepared statements.



Overriding the template



Copy lh_rpbt-templates/default-template.php from the plugin to lh_rpbt-templates/default-template.php in the active (child) theme. It receives $the_query, a WP_Query of the related posts. The default output is a div.lh_rpbt-related_div.no-print holding an h3 and a ul.lh_rpbt-related_post_list; in block templates it is wrapped in the block&#8217;s own wrapper.



Stored data




Post meta lh_rpbt_hide (boolean, in the REST API): set when a post&#8217;s Show related posts toggle is off.



Option lh_rpbt-schema_version (per site): the upgrade routine&#8217;s progress.




Assets



Image size lh_rpbt_featured (200 by 150, cropped). Stylesheet handle lh_rpbt-style, enqueued only when a list is output; themes can override its rules.
""" ;
  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> .
