Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#54365 closed defect (bug) (duplicate)

permalink from REST API is wrong when wp_unique_post_slug is filtered

Reported by: nilav18's profile nilav18 Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.8.1
Component: Permalinks Keywords:
Focuses: rest-api Cc:

Description

Hi,

I use a filter on wp_unique_post_slug
add_filter( 'wp_unique_post_slug', 'custom_unique_post_slug', 1, 5 );
I think there is no need for the moment to show you what I do because with PHP, it works like a charm. But, with REST API, the permalink is not updated.

For example, the snackbar "Page updated. View page" get the post_name before my filter. But if I refresh the page, everything is ok. Not a big problem, just if I click on the link "View page", I have a wrong url and I get a 404 error.

Change History (3)

#1 @nilav18
2 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #54364.

Sorry, the website said me there was a database error but my ticket has been published anyway.

#2 @desrosj
2 years ago

  • Milestone Awaiting Review deleted

#3 @desrosj
2 years ago

  • Component changed from General to Permalinks
  • Focuses rest-api added
Note: See TracTickets for help on using tickets.