﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
15421,Make display_post_states easier to filter,greenshady,,"In `wp-admin/includes/template.php`, there's a filter hook on the post states array.  This is a list appended to the post title in the edit posts list.  Right now, you can filter `display_post_states`, but it's tough to change a single item.

Suppose I wanted to change the ""Post format"" text and do something a little different such as add an icon.  Currently, I could filter the `display_post_states` array and get the array key by searching for something like the below:

{{{
'<span>[</span>' . get_post_format_string( get_post_format( $post->ID ) ) . '<span>]</span>';
}}}

This doesn't seem like the best way to go about it.  One would need to do an `array_search()` or something similar to handle that.

Since the hook is on an array, it makes sense to provide specific array keys that can be overwritten with a filter.  So, in my filter, I could do something like this:

{{{
$states['post_format'] = '<img src=""#"" alt="""" />';
}}}

I'll attach a patch that makes this possible.",enhancement,closed,normal,3.2,Administration,3.1,normal,fixed,has-patch commit 3.2-early,WordPress@…
