Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45101 closed enhancement (fixed)

Add additional default labels to get_post_type_labels()

Reported by: earnjam's profile earnjam Owned by: danielbachhuber's profile danielbachhuber
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch fixed-5.0
Focuses: rest-api Cc:

Description

We need to add some new labels to the post type object to help the post update notices in the new editor accurately reflect the post type being edited.

Required labels are:

  • 'Post reverted to draft.'
  • 'Post published.'
  • 'Post published privately.'
  • 'Post scheduled.'
  • 'Post updated.'

For additional details, see: https://github.com/WordPress/gutenberg/issues/3315

Attachments (2)

45101.diff (1.5 KB) - added by earnjam 6 years ago.
45101.2.diff (2.7 KB) - added by earnjam 6 years ago.
Added documentation of new labels

Download all attachments as: .zip

Change History (10)

#1 @danielbachhuber
6 years ago

  • Focuses rest-api added

#2 @swissspidy
6 years ago

  • Keywords needs-unit-tests added

@earnjam
6 years ago

#3 @earnjam
6 years ago

  • Keywords has-patch added; needs-patch removed

45101.diff has the new labels, but no tests.

@swissspidy What are your thoughts on tests for these? I didn't see any coverage for the other individual labels. Trunk has getPostTypeLabels.php, but that's not in 5.0.

@earnjam
6 years ago

Added documentation of new labels

#4 @earnjam
6 years ago

Realized I forgot to update the docs for get_post_type_labels(), so added that in 45101.2.diff

This ticket was mentioned in Slack in #core by danielbachhuber. View the logs.


6 years ago

#6 @danielbachhuber
6 years ago

  • Owner set to danielbachhuber
  • Resolution set to fixed
  • Status changed from new to closed

In 43744:

Posts, Post Types: Add labels for post transformation messages.

Because the existing post_updated_messages filter can be modified dynamically based on post state, it's unreliable to use with REST API clients. Instead, these new labels give clients stateless equivalents.

Props earnjam.
Fixes #45101.

#7 @danielbachhuber
6 years ago

  • Keywords fixed-5.0 added; needs-unit-tests removed
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Type changed from defect (bug) to enhancement

Reopening for merge to trunk.

#8 @pento
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44110:

Posts, Post Types: Add labels for post transformation messages.

Because the existing post_updated_messages filter can be modified dynamically based on post state, it's unreliable to use with REST API clients. Instead, these new labels give clients stateless equivalents.

Merges [43744] from the 5.0 branch to trunk.

Props earnjam.
Fixes #45101.

Note: See TracTickets for help on using tickets.