Problem with get_page_by_path function
-
Hi,
I’am using this plugin to translate the slugs. I have a problem when i want to get the page (post) corresponding to a path, using the wp function “get_page_by_path”.
I have a url like this https://www.example.com/english-slug/shop and the url https://www.example.com/swede-slug/shop. I have defined a rules that specified the correct page to go when in the url appears the word “shop”.
When i go to this page i have to get the post corresponding to “english-slug” or “swede-slug”, and this post have to be the same obviously.
I use the function like this: $post = get_page_by_path(‘english-slug’,OBJECT,’post’); but dont found the page.
This is a bug in the plugin? Or how can i get the post using the translated slug? without make a query in database of course.
Thanks!!!
- The topic ‘Problem with get_page_by_path function’ is closed to new replies.