API to add/remove language part to/from arbitrary URL?
-
Are there functions that take an arbitrary URL and add/remove the language part in accordance with qTranslateX URL style configuration?
Please note well: I do *really* need to work at this abstraction level: I have a URL in a string and I need it “languaged” or “delanguaged” according to qTranslateX’s convention. I *know* that this is *usually* done automatically for links to native content items like posts or pages. However, I *absolutely positively do have a corner case* here, where this automation cannot be taken advantage of.
For example, I have a url like:
and I want to be converted to either
https://www.example.com/de/path/to/some/custom/content/unfixably/poorly/integrated/with/wordpress/permalink/mechanicsor
or to
depending on qTranslateX settings, or even left intact if German is the default language and qTranslateX is configured to suppress the language part for the default language.
- The topic ‘API to add/remove language part to/from arbitrary URL?’ is closed to new replies.