Make WordPress Core


Ignore:
Timestamp:
04/25/2013 02:44:23 AM (13 years ago)
Author:
markjaquith
Message:

post-new.php?format=X will pre-fill the format, to allow for Post-Format-chosen-first editor jump-starting.

props kovshenin, wonderboymusic. fixes #24116.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/screen.php

    r24039 r24081  
    149149 */
    150150function get_screen_icon( $screen = '' ) {
    151         global $post_ID;
    152151        if ( empty( $screen ) )
    153152                $screen = get_current_screen();
     
    169168                        $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $screen->post_type );
    170169
    171                 if ( $post_ID ) {
    172                         $format = get_post_format( $post_ID );
    173                         if ( $format )
    174                                 $class .= ' wp-format-' . $format;
     170                if ( 'post' == $screen->id ) {
     171                        $post_format = get_post_format();
     172                        if ( ! $post_format && ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
     173                                $post_format = $_REQUEST['format'];
     174
     175                        if ( $post_format )
     176                                $class .= ' wp-format-' . $post_format;
    175177                }
    176178        }
Note: See TracChangeset for help on using the changeset viewer.