qtranslate-slug
qtranslate-slug copied to clipboard
Wrapper function to get URL
Hi,
I'm the lead developer of WP Rocket, a caching plugin (https://github.com/wp-media/wp-rocket)
We have customers using your plugin with qTranslate-X, and we're having one issue with our exclude pages option: it's the default slug that is added, instead of the translated slug.
For example: /cart/ and /fr/cart/ instead of /cart/ and /fr/panier/
We use the qtranxf_convertURL() to get the correct path for each language currently. So ideally, you can give us a way to work with that, or another option would be to have a wrapper function which given an id and a lang would return the full URL for the page.
Kinda like the qts_get_slug() function, but returning a full path/URL.
Hi @Tabrisrp, sorry for the delay!
Would you want a function qts_get_url($lang = false) {
that returns the full url based on an ID?
this qts_get_url() returns the url for the current page.
Yes qts_get_url( $id, $lang = false )
for example, that would be very good