Display custom statuses in post states #579
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #395
Custom post statuses has enough hacks as-is, let's adhere to core APIs and standards when we can :)
Instead of adding an extra column to the post list that takes up valuable space, let's follow core's UI and display custom statuses just like other statuses are shown in WP.
For some context, here is what is done in WP core: https://github.com/WordPress/WordPress/blob/dd4d98a368ca1d617adfaaef9b2937c60464ac4a/wp-admin/includes/template.php#L2100-L2170. Of note, I followed the same rules by letting core continue to handle some statuses specially, and by not showing the status when a specific post status is filtered.
It will also smartly handle cases where EF has changed a core statuses name (like pending). Thanks to the use of array keys, it'll override the default status display name with our custom ones.
Testing
Apply the patch and try out different post statuses, post types, etc.
Preview