Proposed Patch: Add language selection support to the shortcode & query.
-
I ran into a site where they’re using Polylang for multilingual content, but they had a page where they didn’t want to have leave the language of the site the visitor’s using while still only having one set of content to manage. The default behavior would keep the language of the currently viewed page even though I was specifying the ID of the content (which is unique for each language). The fix was to make it so the shortcode could accept & appropriately handle the lang query parameter.
I’ve submitted my solution as a pull request at: https://github.com/billerickson/display-posts-shortcode/pull/196
This defaults to whatever get_locale() returns, but it also accepts lang=”” for the default language or having lang be whatever the appropriate locale should be.
I’d love to see this officially implemented in the plugin for future use.
Thanks for the great plugin,
Kurt
The topic ‘Proposed Patch: Add language selection support to the shortcode & query.’ is closed to new replies.