WordPress.org

Make WordPress Core

Ticket #19711: 19711.diff

File 19711.diff, 1.4 KB (added by sillybean, 5 years ago)

First pass at adding filter indicator to post list page title

  • wp-admin/edit.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    234234        echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
    235235if ( ! empty( $_REQUEST['s'] ) )
    236236        printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
     237if ( !empty( $_REQUEST['m'] ) || !empty( $_REQUEST['cat']) || !empty( $_REQUEST['author'] ) ) {
     238    $post_filters = array();
     239    if ( !empty( $_REQUEST['cat'] )  )
     240        $post_filters[] = single_cat_title( '', false );
     241    if ( !empty( $_REQUEST['author'] ) )
     242        $post_filters[] = get_user_meta( $_REQUEST['author'], 'nickname', true );
     243    if ( !empty( $_REQUEST['m'] ) ) {
     244        /* translators: 1: month name, 2: 4-digit year */
     245        $post_filters[] = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( substr( $_REQUEST['m'], 4, 2 ) ), substr( $_REQUEST['m'], 0, 4 ) );
     246    }
     247    printf( ' <span class="subtitle">' . __('Showing posts from: %s') . '</span>', implode(', ', $post_filters ) );
     248}
    237249?></h2>
    238250
    239251<?php if ( isset( $_REQUEST['locked'] ) || isset( $_REQUEST['updated'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) ) {