All features
Cherry Blossom feature
Frontend Breadcrumbs: Native Trail
Native WordPress breadcrumb trail.
Native WordPress breadcrumb trail.
Capabilities and extension points
Builds breadcrumb items from the current WordPress query.
Gets breadcrumb items for the current request.
Uses the main query without changing globals. Standard posts use their deepest assigned category, with term ID as a deterministic tie-breaker. Other post types use their alphabetically first public hierarchical taxonomy. Customize the final trail through breadcrumbs/items on the coordinating module when a project needs a different hierarchy.
- return array Breadcrumb items containing a label and URL.
Adds items for a singular post.
- param array $items Breadcrumb items.
- param \WP_Post $post Queried post.
Adds the configured posts page.
- param array $items Breadcrumb items.
- param bool $include_fallback Whether to add a fallback blog item.
Adds a post type archive when available.
- param array $items Breadcrumb items.
- param string|array $post_type Post type name or query value.
Adds items for a queried term archive.
- param array $items Breadcrumb items.
- param mixed $term Queried term.
Adds the deepest assigned term and its ancestors.
- param array $items Breadcrumb items.
- param \WP_Post $post Current post.
- param string $taxonomy Taxonomy name.
Adds a term's ancestors from root to parent.
- param array $items Breadcrumb items.
- param \WP_Term $term Child term.
Adds a term after validating its URL.
- param array $items Breadcrumb items.
- param \WP_Term $term Term to add.
Gets the alphabetically first public hierarchical taxonomy for a post type.
- param string $post_type Post type name.
- return string Taxonomy name, or an empty string.
Gets a public post type registered to a taxonomy.
- param array $post_types Post type names.
- return string Post type name, or an empty string.
Adds the active date archive hierarchy.
- param array $items Breadcrumb items.
Appends the current archive or singular page.
- param array $items Breadcrumb items.
- return array Breadcrumb items.
Gets a post's display label.
- param int|\WP_Post $post Post to label.
- return string Post label.
Gets the current request URL without mutating query state.
- return string Current URL.
Adds one normalized breadcrumb item.
- param array $items Breadcrumb items.
- param string $label Item label.
- param string $url Item URL.
Source reference
This editable reference page is based on the PHP documentation in frontend/breadcrumbs/class-native-trail.php.