Skip to content

Fix breadcrumb path in edge cases when using Polylang#39

Open
timiwahalahti wants to merge 2 commits intojustintadlock:masterfrom
timiwahalahti:polylang-fixes
Open

Fix breadcrumb path in edge cases when using Polylang#39
timiwahalahti wants to merge 2 commits intojustintadlock:masterfrom
timiwahalahti:polylang-fixes

Conversation

@timiwahalahti
Copy link
Copy Markdown

In some situations with Polylang translation plugin (look like edge cases), the plugin uses wrong post ID in add_post_parents function and that causes breadcrumb to link to the default language. Simple check if Polylang is active and allowing Polylang to check if there are translations available, fixes this issue.

pll_get_post returns the id of the translated post or page as integer.

@justintadlock
Copy link
Copy Markdown
Owner

Please see contributing guidelines: https://github.com/justintadlock/breadcrumb-trail/blob/master/contributing.md#pull-requests

Also, this should probably be something that we look at for the Hybrid Breadcrumbs script, which is what the next version of BT will be based on: https://github.com/justintadlock/hybrid-breadcrumbs

Generally speaking, I'm not big on directly adding third-party plugin integration, particularly for plugins that I don't use myself. That leads to more long-term maintenance. I think it's better to open up the code so that it can be altered via filter hook or something similar.

Anyway, feel free to open up a ticket for discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants