WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 5 years ago

#19609 closed enhancement (fixed)

Show the 'Mine' filter on the manage posts screen for all users

Reported by: johnbillion Owned by: johnbillion
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: needs-screenshots has-patch
Focuses: administration Cc:

Description

Authors and Contributors get a handy filter on the manage posts screen called 'Mine' which shows just that user's posts. It's also the default view for those user roles.

Editors and Admins don't see this filter at all. It'd be nice if it was available, even if it's not the default view like it is for Authors and Contributors.

If no-one else wants to then I'll look at doing a patch after the holidays.

Attachments (4)

19609.patch (1.6 KB) - added by linuxologos 9 years ago.
19609.diff (2.6 KB) - added by wonderboymusic 5 years ago.
19609.2.diff (2.3 KB) - added by johnbillion 5 years ago.
19609.3.diff (685 bytes) - added by ocean90 5 years ago.

Download all attachments as: .zip

Change History (23)

@linuxologos
9 years ago

#1 @linuxologos
9 years ago

  • Keywords has-patch added

It sounds like a useful enhancement.

19609.patch is an initial effort. It allows user_posts_count to get a value and pushes $post_type_object->cap->edit_others_posts to be checked a bit later, in order to maintain the "All" filter as the default one for Editors/Admins.

Then we should consider, if the "All" filter should be displayed first in the row on the manage posts screen for Editors/Admins.

#2 @Veraxus
8 years ago

I agree. This is a simple change but really handy when you have a team of editors. Any chance this could be implemented in 3.6?

#3 @johnbillion
7 years ago

Note: the Co-authors Plus plugin adds this functionality.

#4 @nacin
7 years ago

  • Component changed from Administration to Posts, Post Types
  • Focuses administration added

@wonderboymusic
5 years ago

#5 @wonderboymusic
5 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to johnbillion
  • Status changed from new to assigned

19609.diff refreshes

#6 @johnbillion
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34360:

Implement a 'Mine' link on post listing screens in the admin area for all users who have authored posts. This feature was previously only available to users who cannot edit other users' posts (namely Authors and Contributors).

Props linuxologos, wonderboymusic
Fixes #19609

#7 @GaryJ
5 years ago

Any benefit in limiting this to when there is more than one user with author+ capabilities? i.e. if there is only one author or above, even with a load of subscribers, having a Mine link showing is completely redundant.

Or perhaps, only when there first post by a second user has been created?

A simpler check may be when the count for Mine matches the count for All. If they are the same, then don't show Mine.

#8 @johnbillion
5 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

I concur. Only showing the link when the Mine count doesn't match the All count makes the most sense.

#9 @GaryJ
5 years ago

Could is_multi_author() be useful here?

#10 @ryan
5 years ago

  • Keywords needs-screenshots added

#11 @wonderboymusic
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 34584:

Posts List Table: check is_multi_author() before attempting to set ->user_posts_count. Also, don't show "Mine" when the count is the same as "All."

Fixes #19609.

#12 @johnbillion
5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

is_multi_author() isn't actually appropriate here because it only queries published Posts.

@johnbillion
5 years ago

#13 @johnbillion
5 years ago

  • Keywords has-patch added; needs-patch removed

19609.2.diff should fix this.

#14 @johnbillion
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 34667:

Correct the logic used when determining whether to display the 'Mine' link on post list tables. It should only be shown when the count for the user's posts differs for the total count of posts. is_multi_author() cannot be used because it only considers Posts.

Fixes #19609

@ocean90
5 years ago

#15 @ocean90
5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The pagination is currently broken on the "Mine" view. We have to set the $total_items to $this->user_posts_count, see 19609.3.diff.

#16 @johnbillion
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 34837:

Correct pagination when viewing the 'Mine' link on the post listing screen.

Fixes #19609
Props ocean90

#17 @johnbillion
5 years ago

I switched to a loose type comparison and $_GET['author'] so it handles both users who've manually clicked the 'Mine' tab, and users such as Authors who see the 'Mine' tab by default.

#18 @afercia
5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Looks like the "All" link doesn't get the .current CSS class anymore:

https://cldup.com/qR0-6W81Nr.png

probably the conditional in this bit of code should be changed since now $this->user_posts_count returns a count value for all users not just for authors.

if ( empty( $class ) && ( ( $this->is_base_request() && ! $this->user_posts_count ) || isset( $_REQUEST['all_posts'] ) ) ) {
	$class = 'current';
}

#19 @wonderboymusic
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 34889:

Posts List Table: ensure that "All" gets the "current" CSS class when applicable.

Props afercia.
Fixes #19609.

Note: See TracTickets for help on using tickets.