-
Notifications
You must be signed in to change notification settings - Fork 652
Use wrapper for sanitize_title to avoid messed up slugs.
#2723
Conversation
This is required sinse passing sanitize_title directly will result in messed up slugs due to the `context` param getting a garbage value.
|
Duplicate of #1712; should bring over the changes from there. |
| * @param string $slug | ||
| * @return string | ||
| */ | ||
| public function sanitize_slug( $slug ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going into core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until the proper fix in https://core.trac.wordpress.org/ticket/34659 goes in, we still need to work around the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Could we add a note on the method then?
|
Updated with notes as above; @joehoyle happy with this? |
|
Looks good to me |
| $new_data = $response->get_data(); | ||
| $this->assertEquals( 'test-accented-charaecters', $new_data['slug'] ); | ||
| $post = get_post( $new_data['id'] ); | ||
| $this->assertEquals( 'test-accented-charaecters', $post->post_name ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here
|
Wait no. D'oh :) |
This is required sinse passing sanitize_title directly will result in
messed up slugs due to the
contextparam getting a garbage value.Fixes #2487