[wp-trac] [WordPress Trac] #44874: get_permalink($id) returns different output when on ajax mode.
WordPress Trac
noreply at wordpress.org
Fri Aug 31 10:44:12 UTC 2018
#44874: get_permalink($id) returns different output when on ajax mode.
--------------------------+-----------------------------
Reporter: gpisw | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Permalinks | Version: 4.9.8
Severity: critical | Keywords:
Focuses: |
--------------------------+-----------------------------
- WordPress version: 4.9.8
- Theme: twentyseventeen
- Active plugins: WPML Multilingual CMS and custom plugin in development
- Observations: For this issue it's needed WPML Multilingual CMS. I found
this issue, while developing a custom plugin.
- Setup: Clean install. WPML installed. Hello World post translated to
Catalan (any language is valid).
- Problem: When calling get_permalink($id) from an ajax request, using the
original post id and the translated post id (1, and 7), it returns the
same url, depending on current language.
- Expected: Expected to work like in the frontend or admin pages.
Output for a custom admin page:
{{{
id: 10 - permalink: http://localhost:8000/es/hola-mundo/
id: 7 - permalink: http://localhost:8000/ca/hola-mon/
id: 1 - permalink: http://localhost:8000/hello-world/
}}}
Output for ajax call with language set to english:
{{{
id: 10 - permalink: http://localhost:8000/hello-world/
id: 7 - permalink: http://localhost:8000/hello-world/
id: 1 - permalink: http://localhost:8000/hello-world/
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44874>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list