Make WordPress Core

Ticket #15323: 15323.patch

File 15323.patch, 1.7 KB (added by sscovil, 11 years ago)
  • wp-admin/includes/class-wp-posts-list-table.php

     
    214214                                );
    215215                                wp_dropdown_categories( $dropdown_options );
    216216                        }
     217
     218                        if ( post_type_supports( $this->screen->post_type, 'post-formats' ) ) {
     219                                $dropdown_options = array(
     220                                        'show_option_all' => __( 'View all formats' ),
     221                                        'orderby' => 'name',
     222                                        'name' => 'format',
     223                                        'taxonomy' => 'post_format',
     224                                        'selected' => isset( $_GET['format'] ) ? $_GET['format'] : 0,
     225                                        'hide_if_empty' => true
     226                                );
     227
     228                                wp_dropdown_categories( $dropdown_options );
     229                        }
     230
    217231                        do_action( 'restrict_manage_posts' );
    218232                        submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
    219233                }
  • wp-admin/includes/post.php

     
    868868        $posts_per_page = apply_filters( $per_page, $posts_per_page );
    869869        $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type );
    870870
    871         $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
     871        $query = compact( 'post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page' );
     872        if ( ! empty( $q['format'] ) ) {
     873                $query['taxonomy'] = 'post_format';
     874                $term = get_term( $q['format'], $query['taxonomy'] );
     875                $query['term'] = $term->slug;
     876        }
    872877
    873878        // Hierarchical types require special args.
    874879        if ( is_post_type_hierarchical( $post_type ) && !isset($orderby) ) {