Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display custom statuses in post states #579

Merged
merged 7 commits into from
Jan 17, 2020

Conversation

WPprodigy
Copy link
Contributor

@WPprodigy WPprodigy commented Jan 16, 2020

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

post-states

@cojennin
Copy link
Contributor

Hey great! Thanks for carrying the torch on this, I was giving it a shot with #561 but got side tracked. Definitely makes more sense

Copy link
Contributor

@cojennin cojennin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple PHPCS issues that need fixing (can ignore anything that starts with Line indented incorrectly;, the whole file is indented incorrectly), once those are addressed it's good to go

Copy link
Contributor

@cojennin cojennin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@cojennin cojennin merged commit 241f0db into master Jan 17, 2020
@cojennin cojennin deleted the fix/395-display-status-in-post-states branch January 29, 2020 21:33
@cojennin cojennin added this to the 0.9.4 milestone Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Status Labels Appear Next to Post Title in List
2 participants