Make WordPress Core


Ignore:
Timestamp:
05/29/2007 04:28:10 AM (18 years ago)
Author:
ryan
Message:

Post and page management filter additions from mdawaffe. see #3945

File:
1 edited

Legend:

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

    r5583 r5587  
    1717
    1818$post_status_q = '';
    19 $author_q = '';
    2019$post_status_label = _c('Posts|manage posts header');
    21 $post_listing_pageable = true;
    2220if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
    2321    $post_status_label = $post_stati[$_GET['post_status']][1];
    24     $post_listing_pageable = false;
    2522    $post_status_q = '&post_status=' . $_GET['post_status'];
    26     if ( in_array( $_GET['post_status'], array('draft', 'private') ) )
    27         $author_q = "&author=$user_ID";
    28     elseif ( 'publish' == $_GET['post_status'] );
    29         $post_listing_pageable = true;
    3023}
    3124?>
     
    3528<?php
    3629
    37 wp("what_to_show=posts$author_q$post_status_q&posts_per_page=15&posts_per_archive_page=-1");
     30wp("what_to_show=posts$post_status_q&posts_per_page=15");
    3831
    3932do_action('restrict_manage_posts');
     
    6659        $h2_noun = $post_status_label;
    6760    // Use $_GET instead of is_ since they can override each other
     61    $h2_author = '';
     62    if ( isset($_GET['author']) && $_GET['author'] ) {
     63        $author_user = get_userdata( get_query_var( 'author' ) );
     64        $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
     65    }
    6866    $h2_search = isset($_GET['s'])   && $_GET['s']   ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( get_search_query() ) ) : '';
    6967    $h2_cat    = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in &#8220;%s&#8221;'), single_cat_title('', false) ) : '';
    7068    $h2_month  = isset($_GET['m'])   && $_GET['m']   ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : '';
    71     printf( _c( '%1$s%2$s%3$s%4$s|manage posts header' ), $h2_noun, $h2_search, $h2_cat, $h2_month );
     69    printf( _c( '%1$s%2$s%3$s%4$s%5$s|manage posts header' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_month );
    7270}
    7371?></h2>
     
    8785    </fieldset>
    8886
     87<?php
     88$editable_ids = get_editable_user_ids( $user_ID );
     89if ( $editable_ids && count( $editable_ids ) > 1 ) :
     90?>
     91    <fieldset><legend><?php _e('Author&hellip;'); ?></legend>
     92        <?php wp_dropdown_users( array('include' => $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?>
     93    </fieldset>
     94
    8995<?php
    90 
     96endif;
    9197
    9298$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC";
     
    130136<br style="clear:both;" />
    131137
    132 <?php
    133 if ( $post_status_q && ( false !== strpos($post_status_q, 'draft') || false !== strpos($post_status_q, 'private') ) ) {
    134     echo '<h3>' . __('Your Posts') . "</h3>\n";
    135     include( 'edit-post-rows.php' );
    136 
    137     $editable_ids = get_editable_user_ids( $user_ID );
    138 
    139     if ( $editable_ids && count($editable_ids) > 1 ) {
    140         $_editable_ids = join(',', array_diff($editable_ids, array($user_ID)));
    141 
    142         $post_status_q = "&post_status=" . $_GET['post_status'];
    143 
    144         unset($GLOBALS['day']); // setup_postdata does this
    145         wp("what_to_show=posts&author=$_editable_ids$post_status_q&posts_per_page=-1&posts_per_archive_page=-1");
    146 
    147         if ( have_posts() ) {
    148             echo '<h3>' . __("Others' Posts") . "</h3>\n";
    149             include( 'edit-post-rows.php' );
    150         }
    151     }
    152 
    153 } else {
    154     include( 'edit-post-rows.php' );
    155 }
    156 ?>
     138<?php include( 'edit-post-rows.php' ); ?>
    157139
    158140<div id="ajax-response"></div>
Note: See TracChangeset for help on using the changeset viewer.