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.

git-svn-id: https://develop.svn.wordpress.org/trunk@24081 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2013-04-25 02:44:23 +00:00
parent 5c78df14f8
commit 9d531ae545
2 changed files with 11 additions and 6 deletions

View File

@ -139,7 +139,10 @@ if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'enable_
if ( ! $post_format ) {
$post_format = 'standard';
if ( 'auto-draft' == $post->post_status )
if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
$post_format = $_REQUEST['format'];
elseif ( 'auto-draft' == $post->post_status )
$post_format_set_class = '';
}

View File

@ -148,7 +148,6 @@ function screen_icon( $screen = '' ) {
* @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 ) )
@ -168,10 +167,13 @@ 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 .= ' wp-format-' . $format;
if ( 'post' == $screen->id ) {
$post_format = get_post_format();
if ( ! $post_format && ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
$post_format = $_REQUEST['format'];
if ( $post_format )
$class .= ' wp-format-' . $post_format;
}
}