WordPress.org

Make WordPress Core

Changeset 24081


Ignore:
Timestamp:
04/25/2013 02:44:23 AM (5 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.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r24063 r24081  
    140140    if ( ! $post_format ) {
    141141        $post_format = 'standard';
    142         if ( 'auto-draft' == $post->post_status )
     142
     143        if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
     144            $post_format = $_REQUEST['format'];
     145        elseif ( 'auto-draft' == $post->post_status )
    143146            $post_format_set_class = '';
    144147    }
  • 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.