# SEO breadcrumb and content-schema filters

Help4 Builder Suite builds one final breadcrumb item list for both the
`[h4_breadcrumbs]` shortcode and `BreadcrumbList` JSON-LD. Extensions should
change that shared list instead of filtering rendered HTML or removing JSON-LD
after output.

## `h4bs_breadcrumb_items`

```php
add_filter(
    'h4bs_breadcrumb_items',
    static function (array $items, int $post_id, array $settings): array {
        return $items;
    },
    10,
    3
);
```

Each returned item must have a plain-text `name` and an HTTP(S) `url`. Relative
URLs are resolved against `home_url('/')`. Help4 applies the site's trailing
slash policy, preserves query strings, removes fragments, rejects invalid
entries, and keeps the first item when canonical URLs repeat. Fewer than two
valid distinct URLs produce no visible breadcrumb and no `BreadcrumbList`.

WordPress remains authoritative for taxonomy destinations. Use the normal
`term_link` filter when a category or taxonomy should resolve to a curated
landing page; Help4 consumes the final `get_category_link()` or
`get_term_link()` result.

The current static-front-page contract intentionally emits no breadcrumb trail.
Do not use this filter to work around that behavior.

## `h4bs_content_schema`

```php
add_filter(
    'h4bs_content_schema',
    static function (array $schema, int $post_id, array $settings): array {
        $schema['isAccessibleForFree'] = true;
        return $schema;
    },
    10,
    3
);
```

The filter runs after Help4 constructs the content node and before final graph
validation. Return an empty or invalid value to suppress that content schema.
Final validation rejects nodes without a schema type, keeps one node for a
duplicate graph identity, keeps one `Organization` and one `BreadcrumbList`
node per filtered graph, and removes or corrects breadcrumb references so they
cannot point to a node Help4 did not emit.

`h4bs_organization_schema` remains unchanged and continues to receive the
Organization schema and Help4 settings as its two arguments.
