We should change this message depending on if a page or a post:
Related filter: https://developer.wordpress.org/reference/hooks/post_updated_messages/
I do not expect that this is exposed anywhere in the REST API, but could be bootstrapped for page load.
This would depend upon whether we want to respect post updated messages for custom post types specifically, since core already hard-codes labels for posts, pages, and media:
Should be similar on post types, for example product.
Product published. View Product
I thought I'd raised it at one point before, but since I'm not seeing it here:
We should consider making this an optional label for post types, using it within the editor UI. It seems suitable as the purpose for the labels
property of a custom post type.
Related filter: https://developer.wordpress.org/reference/hooks/post_updated_messages/
I do not expect that this is exposed anywhere in the REST API, but could be bootstrapped for page load.
Specific to post_updated_messages
, we can't _necessarily_ use this filter in Gutenberg because:
post_updated_messages
stale.post_updated_messages
strings don't match what we're using in Gutenberg.This would point towards introduce new labels on the post type object. Labels on the post type object are stateless, which mitigate the concern about modification. Also worth noting, we can't do sprintf( __( '%s updated!' ), postType )
because we need to accommodate different grammar (?) structures in each locale.
Based on a quick look, it appears we'd need to introduce at least these strings as new post type labels:
@swissspidy @ocean90 Because I know you're relatively close to localization, is there anything you'd add or change to my assessment?
I've documented this in my Gutenberg migration guide https://github.com/danielbachhuber/gutenberg-migration-guide/blob/master/filter-post-updated-messages.md
Post type labels make sense, yeah.
Looking at https://core.trac.wordpress.org/browser/tags/4.9/src/wp-admin/edit-form-advanced.php#L146, I think these are needed too:
Also, should the 'Post scheduled' label contain the date like in the current editor, e.g. 'Post scheduled for: %s.'?
On a side note, I'm not sure how I feel about the exclamation mark in the Gutenberg strings vs. the dot in the current strings in core.
Flagging Needs Copy Review
to get finalized strings before we create a Core patch for this.
Allo allo! I saw the "needs copy review" bat signal. I think these sound fine and I agree with @swissspidy that we probably don't need exclamation points and should remove them for consistency in core. So that would leave us the following. (I added one minor revision.)
It would be nice to include the time and date when a user schedules a post as a courtesy to the user.
@0aveRyan said he'd pick this up today in Slack.
@0aveRyan I just saw @danielbachhuber's comment above. I've started working on this issue yesterday already and created the PR #10361 earlier today. As this is my second PR to Gutenberg and my very first JS-based PR it might be a bit bumpy though. Feel free to give me feedback on how to improve #10361 or create your own PR, if you think my implementation is not aligned with the overall Gutenberg development. 馃槈
@nielslange no worries! I just sat down to write a patch, but glad I checked back first. Jumping discussion over to that PR.
In the thread on PR #10361, we discussed an alternative solution which exposes label data through PHP (by adding the computed labels for each type as a labels
property on the wp/v2/types
endpoint) then consuming that label data in Gutenberg to construct the strings using the singular label for the specified type. Based on conversation in the #core-restapi channel, this feels like a more robust way forward than a JS-only solution. @0aveRyan do you still have any bandwidth to pick this up again?
we discussed an alternative solution which exposes label data through PHP (by adding the computed labels for each type as a
labels
property on thewp/v2/types
endpoint) then consuming that label data in Gutenberg to construct the strings using the singular label for the specified type.
@kadamwhite Just to be clear, isn't this what I originally proposed in https://github.com/WordPress/gutenberg/issues/3315#issuecomment-408271116 ?
Most helpful comment
Allo allo! I saw the "needs copy review" bat signal. I think these sound fine and I agree with @swissspidy that we probably don't need exclamation points and should remove them for consistency in core. So that would leave us the following. (I added one minor revision.)
It would be nice to include the time and date when a user schedules a post as a courtesy to the user.