Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 20 months ago

#56687 closed defect (bug) (worksforme)

Post Updated Messages are not working with Gutenberg

Reported by: pratik-jain's profile Pratik Jain Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.0.2
Component: Posts, Post Types Keywords:
Focuses: Cc:

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 20 months ago.
Custom Post Type Update Message
page-update.png (58.7 KB) - added by Pratik Jain 20 months ago.
Default Page Update Message

Download all attachments as: .zip

Change History (5)

@Pratik Jain
20 months ago

Custom Post Type Update Message

@Pratik Jain
20 months ago

Default Page Update Message

#1 @swissspidy
20 months 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
20 months ago

  • Resolution set to worksforme
  • Status changed from new to 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
20 months ago

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