Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Use wrapper for sanitize_title to avoid messed up slugs. #2723

Merged
merged 4 commits into from
Sep 27, 2016

Conversation

joehoyle
Copy link
Member

@joehoyle joehoyle commented Sep 23, 2016

This is required sinse passing sanitize_title directly will result in
messed up slugs due to the context param getting a garbage value.

Fixes #2487

This is required sinse passing sanitize_title directly will result in
messed up slugs due to the `context` param getting a garbage value.
@rmccue
Copy link
Member

rmccue commented Sep 23, 2016

Duplicate of #1712; should bring over the changes from there.

* @param string $slug
* @return string
*/
public function sanitize_slug( $slug ) {
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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?

@rmccue
Copy link
Member

rmccue commented Sep 23, 2016

Updated with notes as above; @joehoyle happy with this?

@rmccue rmccue added this to the 2.0 Beta 14 milestone Sep 23, 2016
@rmccue rmccue added the Bug label Sep 23, 2016
@joehoyle
Copy link
Member Author

Looks good to me

@rmccue rmccue merged commit 4d52309 into develop Sep 27, 2016
@rmccue rmccue deleted the fix-sanitize-slug branch September 27, 2016 20:41
$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 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here

@kadamwhite
Copy link
Contributor

Wait no. D'oh :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants