Post Format UI.

* Icons
* Selection
* Prompt text
* Special fields
* Styling
* Sparkles

This is going to need testing, polish, and love.

see #19570. props melchoyce, helen, wonderboymusic, lessbloat, rachelbaker, aaroncampbell, DrewAPicture, ryelle.

git-svn-id: http://core.svn.wordpress.org/trunk@23843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith
2013-03-29 03:35:41 +00:00
parent 3575abd055
commit c93e0231af
12 changed files with 576 additions and 83 deletions

View File

@@ -142,11 +142,13 @@ function screen_icon( $screen = '' ) {
*
* @since 3.2.0
*
* @global $post_ID
* @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
* which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
* @return string HTML for the screen icon.
*/
function get_screen_icon( $screen = '' ) {
global $post_ID;
if ( empty( $screen ) )
$screen = get_current_screen();
elseif ( is_string( $screen ) )
@@ -165,6 +167,12 @@ function get_screen_icon( $screen = '' ) {
if ( $screen->post_type )
$class .= ' ' . sanitize_html_class( 'icon32-posts-' . $screen->post_type );
if ( $post_ID ) {
$format = get_post_format( $post_ID );
if ( $format )
$class .= ' ' . $format;
}
}
return '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"><br /></div>';