All features
Cherry Blossom feature
Structured data Providers: Post Type Provider base
Provides shared request matching for singular post-type schema providers.
Provides shared request matching for singular post-type schema providers.
Capabilities and extension points
Post types linked to the provider.
- var array
Creates a provider for one or more post types.
- param string|array $post_types Post type name or names.
Determines whether the current singular post is supported.
- param object $context Structured data request context.
- return bool Whether the provider supports the request.
Gets schema entities for the current singular post.
Call only after supports() succeeds for this context.
- param object $context Structured data request context.
- return array One entity, a list of entities, or an empty array.
Builds schema entities for a supported singular post.
Override in a project provider. Return data matching the Provider contract, without @context or printed markup, using content visible on this page.
- param \WP_Post $post Singular post.
- param object $context Structured data request context.
- return array One entity, a list of entities, or an empty array.
Determines whether the provider supports additional post conditions.
- param \WP_Post $post Singular post.
- param object $context Structured data request context.
- return bool Whether the provider supports the post context.
Source reference
This editable reference page is based on the PHP documentation in structured-data/providers/abstract-post-type-provider.php.