[wp-trac] [WordPress Trac] #54964: get_permalink() does not use the correct slug rewrite base
WordPress Trac
noreply at wordpress.org
Wed Oct 4 11:54:51 UTC 2023
#54964: get_permalink() does not use the correct slug rewrite base
-------------------------------------------+------------------------------
Reporter: jakubaondrej | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 5.9
Severity: blocker | Resolution:
Keywords: needs-patch reporter-feedback | Focuses: rest-api
-------------------------------------------+------------------------------
Changes (by lopo):
* keywords: needs-patch => needs-patch reporter-feedback
Comment:
I looked into this issue during the Yoast Contributor Day, I could not
reproduce the problem in 6.4 beta 2.
This is how I tried:
- I installed Yoast Test Helper from the wp.org repository
- in Tools > Yoast Test, I enabled the custom post types
- I created and published an item under the `Book` post type, it got id 6
- I edited `wp-content/plugins/yoast-test-helper/src/post-types.php` to
change from
{{{#!php
<?php
'slug' => 'yoast-test-books',
}}}
to
{{{#!php
<?php
'slug' => _x( 'yoast-test-books', 'slug', 'yoast-test-helper' ),
}}}
- I set the site to use Italian
- I installed Locotranslate from wp.org
- Using Locotranslate, I translated `yoast-test-books` to `libri`
- I edited the theme and added `echo get_permalink( 6 );`
- I got http://localhost:8889/libri/book-title/ as expected
(notice that the link would return a 404 unless the permalink had been
flushed, but it's not needed to get the translated URL).
@jakubaondrej can you check again if the issue is still occurring, and if
so, can you provide instructions to reproduce?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54964#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list