Skip to content

Support multiple crumb anchors in a single item #35

@lkraav

Description

@lkraav

Use case: e-learning environment, where courses can belong to multiple certificate programs.

Breadcrumb structure goal (pardon the ASCII limitations, vertical-align: middle would be nicer):

Certificate Uno > Track Some 
                              > Course > Lesson
Certificate Dos > Track Other 

HTML (styled into multi-line later):

<a href="/certificate/uno">Certificate Uno</a><a href="/certificate/dos/">Certificate Dos</a>

Solution: seems simple on surface, https://github.com/justintadlock/breadcrumb-trail/blob/1.1.0/inc/breadcrumbs.php#L200 should become greedy instead of lazy. Can we lose the lazy ? from matching between <a></a>?

preg_match( '/(<a.*?>)(.*)(<\/a>)/i', $item, $matches );

Side effects: none that I can see on 1.0.0, but I have yet to test 1.1.0.

Alternatively, it would help if the preg_match() call is put through a filter, so I could run my own regex on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions