Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#56687 closed defect (bug) (worksforme)

Post Updated Messages are not working with Gutenberg

Reported by: Pratik Jain Owned by:
Priority: normal Milestone:
Component: Posts, Post Types Version: 6.0.2
Severity: normal Keywords:
Cc: Focuses:

Description

post_updated_messages filter is not working with Gutenberg for custom post type.

I have a custom post type named 'news' and I have added a post_updated_messages filter to change its respective messages like 'News updated', 'News published' and etc.

I have enabled the Gutenberg editor with a custom post type.

Now when I update the news post then it says 'Post updated. View News Item'. I think it should be 'News updated. View News Item'.

When I checked the same thing with WordPress default page then it says 'Page updated. View Page'.

Attachments (2)

custom-post-update.png​ (109.3 KB ) - added by Pratik Jain 4 years ago.
Custom Post Type Update Message
page-update.png​ (58.7 KB ) - added by Pratik Jain 4 years ago.
Default Page Update Message

Download all attachments as: .zip

Change History (5)

@Pratik Jain
4 years ago

Custom Post Type Update Message

@Pratik Jain
4 years ago

Default Page Update Message

#1 @swissspidy
4 years ago

Have you tried setting the item_updated post type label for your post type instead of using this filter?

If I look at the history of ​https://github.com/WordPress/gutenberg/issues/3315 it's basically impossible to respect this filter in Gutenberg.

So if you need a filter like this in JS to completely customize the message then I don't think it works.

#2 @Pratik Jain
4 years ago

  • Resolution → worksforme
  • Status new → closed

Hi @swissspidy

Thanks for your update. I have used item_updated filters and yes, it is working properly. Thanks for your assistance. You can mark this as a resolved.

More labels can be find over here.
​https://developer.wordpress.org/reference/functions/get_post_type_labels/

#3 @swissspidy
4 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.