diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index f3edaa530e..6d19ce90ed 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -116,22 +116,13 @@ addLoadEvent(focusit);
id ); // TODO: ROLE SYSTEM
+$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $authors && count( $authors ) > 1 ) :
?>
diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php
index 61e0aac4e5..aa3c6e99f2 100644
--- a/wp-admin/edit-pages.php
+++ b/wp-admin/edit-pages.php
@@ -13,14 +13,10 @@ $post_stati = array( // array( adj, noun )
$post_status_label = _c('Pages|manage pages header');
-$post_listing_pageable = true;
$post_status_q = '';
if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
$post_status_label = $post_stati[$_GET['post_status']][1];
- $post_listing_pageable = false;
$post_status_q = '&post_status=' . $_GET['post_status'];
- if ( 'publish' == $_GET['post_status'] );
- $post_listing_pageable = true;
}
?>
@@ -30,7 +26,12 @@ if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($
display_name ));
+}
+printf( _c( '%1$s%2$s%3$s|manage pages header' ), $post_status_label, $h2_author, $h2_search );
?>
@@ -50,6 +51,14 @@ printf( _c( '%1$s%2$s|manage pages header' ), $post_status_label, $h2_search );
+ 1 ) : ?>
+
+
+
+
+
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index 7328fbd303..ecae267ee8 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -16,17 +16,10 @@ $post_stati = array( // array( adj, noun )
);
$post_status_q = '';
-$author_q = '';
$post_status_label = _c('Posts|manage posts header');
-$post_listing_pageable = true;
if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
$post_status_label = $post_stati[$_GET['post_status']][1];
- $post_listing_pageable = false;
$post_status_q = '&post_status=' . $_GET['post_status'];
- if ( in_array( $_GET['post_status'], array('draft', 'private') ) )
- $author_q = "&author=$user_ID";
- elseif ( 'publish' == $_GET['post_status'] );
- $post_listing_pageable = true;
}
?>
@@ -34,7 +27,7 @@ if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($
display_name ));
+ }
$h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching “%s”'), wp_specialchars( get_search_query() ) ) : '';
$h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), single_cat_title('', false) ) : '';
$h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : '';
- printf( _c( '%1$s%2$s%3$s%4$s|manage posts header' ), $h2_noun, $h2_search, $h2_cat, $h2_month );
+ 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 );
}
?>
@@ -86,8 +84,16 @@ if ( is_single() ) {
- 1 ) :
+?>
+
+posts WHERE post_type = 'post' ORDER BY post_date DESC";
@@ -129,31 +135,7 @@ if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?
-' . __('Your Posts') . "\n";
- include( 'edit-post-rows.php' );
-
- $editable_ids = get_editable_user_ids( $user_ID );
-
- if ( $editable_ids && count($editable_ids) > 1 ) {
- $_editable_ids = join(',', array_diff($editable_ids, array($user_ID)));
-
- $post_status_q = "&post_status=" . $_GET['post_status'];
-
- unset($GLOBALS['day']); // setup_postdata does this
- wp("what_to_show=posts&author=$_editable_ids$post_status_q&posts_per_page=-1&posts_per_archive_page=-1");
-
- if ( have_posts() ) {
- echo '' . __("Others' Posts") . "
\n";
- include( 'edit-post-rows.php' );
- }
- }
-
-} else {
- include( 'edit-post-rows.php' );
-}
-?>
+
diff --git a/wp-admin/includes/upload.php b/wp-admin/includes/upload.php
index 92c1ceaf83..341a60ca2c 100644
--- a/wp-admin/includes/upload.php
+++ b/wp-admin/includes/upload.php
@@ -284,7 +284,7 @@ function wp_upload_posts_where( $where ) {
}
function wp_upload_tab_browse() {
- global $wpdb, $action, $paged;
+ global $action, $paged;
$old_vars = compact( 'paged' );
switch ( $action ) :
@@ -301,11 +301,7 @@ function wp_upload_tab_browse() {
add_action( 'pre_get_posts', 'wp_upload_grab_attachments' );
if ( 'browse' == $tab && $post_id )
add_filter( 'posts_where', 'wp_upload_posts_where' );
- $attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged");
- $count_query = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'";
- if ( $post_id )
- $count_query .= " AND post_parent = '$post_id'";
- $total = $wpdb->get_var($count_query);
+ $attachments = query_posts("what_to_show=posts&post_status=any&posts_per_page=10&paged=$paged");
echo "\n";
if ( have_posts() ) : while ( have_posts() ) : the_post();
@@ -357,4 +353,4 @@ function wp_upload_admin_head() {
}
}
-?>
\ No newline at end of file
+?>
diff --git a/wp-includes/user.php b/wp-includes/user.php
index dcce85de37..cd1c6aa007 100644
--- a/wp-includes/user.php
+++ b/wp-includes/user.php
@@ -179,4 +179,69 @@ function setup_userdata($user_id = '') {
$user_identity = $user->display_name;
}
+function wp_dropdown_users( $args = '' ) {
+ global $wpdb;
+ $defaults = array(
+ 'show_option_all' => '', 'show_option_none' => '',
+ 'orderby' => 'display_name', 'order' => 'ASC',
+ 'include' => '', 'exclude' => '',
+ 'show' => 'display_name', 'echo' => 1,
+ 'selected' => 0, 'name' => 'user', 'class' => ''
+ );
+
+ $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r );
+
+ $query = "SELECT * FROM $wpdb->users";
+
+ $query_where = array();
+
+ if ( is_array($include) )
+ $include = join(',', $include);
+ $include = preg_replace('/[^0-9,]/', '', $include); // (int)
+ if ( $include )
+ $query_where[] = "ID IN ($include)";
+
+ if ( is_array($exclude) )
+ $exclude = join(',', $exclude);
+ $exclude = preg_replace('/[^0-9,]/', '', $exclude); // (int)
+ if ( $exclude )
+ $query_where[] = "ID NOT IN ($exclude)";
+
+ if ( $query_where )
+ $query .= " WHERE " . join(' AND', $query_where);
+
+ $query .= " ORDER BY $orderby $order";
+
+ $users = $wpdb->get_results( $query );
+
+ $output = '';
+ if ( !empty($users) ) {
+ $output = "";
+ }
+
+ $output = apply_filters('wp_dropdown_users', $output);
+
+ if ( $echo )
+ echo $output;
+
+ return $output;
+}
+
?>