[wp-trac] [WordPress Trac] #54365: permalink from REST API is wrong when wp_unique_post_slug is filtered

WordPress Trac noreply at wordpress.org
Tue Nov 2 14:05:13 UTC 2021


#54365: permalink from REST API is wrong when wp_unique_post_slug is filtered
--------------------------+-----------------------------
 Reporter:  nilav18       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.8.1
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54365>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list