diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index 5372a865c6..cebebfc59a 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -87,12 +87,12 @@ $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace(
if ( isset( $post ) && is_a( $post, 'WP_Post' ) && post_type_supports( get_post_type(), 'post-formats' ) ) {
$post_format = get_post_format();
- if ( ! $post_format ) {
- $post_format = 'standard';
- if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
- $post_format = $_REQUEST['format'];
- }
+ if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
+ $post_format = $_REQUEST['format'];
+
+ if ( ! $post_format )
+ $post_format = 'standard';
$admin_body_class .= ' wp-format-' . $post_format;
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index f878caea27..39d7103627 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -136,12 +136,11 @@ if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'enable_
wp_enqueue_style( 'wp-mediaelement' );
$post_format = get_post_format();
- if ( ! $post_format ) {
- $post_format = 'standard';
+ if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
+ $post_format = $_REQUEST['format'];
- if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) )
- $post_format = $_REQUEST['format'];
- }
+ if ( ! $post_format )
+ $post_format = 'standard';
$format_class = " class='wp-format-{$post_format}'";
@@ -185,7 +184,9 @@ if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'enable_
$active_post_type_slug = $slug;
}
- $post_format_options .= '' . ucfirst( $slug ) . '';
+ $url = add_query_arg( 'format', $slug );
+
+ $post_format_options .= '' . ucfirst( $slug ) . '';
}
$current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) );