Make WordPress Core

Opened 12 years ago

Closed 9 years ago

#20345 closed enhancement (maybelater)

Don't show Author column on posts screen for single author sites

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: low
Severity: normal Version: 3.4
Component: Posts, Post Types Keywords: has-patch
Focuses: administration Cc:

Description (last modified by johnbillion)

The 'Author' column on post listing screens is a bit pointless for single-author sites.

To simplify this screen, I think it would make sense to remove this column for sites which only have one user, and possibly also remove it for sites with more than one user but still only one author (ie. !is_multi_author()).

I'm not sure how best to handle the column's visibility and a user's column visibility preferences at the point when a site goes from being a single-author site to a multi-author site.

Attachments (3)

20345.patch (1.3 KB) - added by SergeyBiryukov 12 years ago.
20345.2.patch (2.0 KB) - added by SergeyBiryukov 12 years ago.
20345.3.patch (2.4 KB) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (17)

#1 @johnbillion
12 years ago

  • Description modified (diff)

#2 @jane
12 years ago

  • Keywords needs-patch added
  • Milestone set to Future Release
  • Version set to 3.4

Limiting it to show only when there are multiple authors is fine with me. If additional authors are added, the column should just magically appear. And by magic I mean code that is smart, sensitive, and likes long walks on the beach. In the rain. With a guitar in hand.

#3 @SergeyBiryukov
12 years ago

  • Keywords has-patch added; needs-patch removed

#4 @nacin
12 years ago

  • Keywords commit added
  • Milestone changed from Future Release to 3.4

This code came with a guitar in hand.

#5 @nacin
12 years ago

Had two posts by the same author. Quick edited one post to set the author to author 2.

The ajax response came back with an extra column:

We may need to pass is_multi_author() back via quick edit so it knows to not return that column until the page refreshes.

Also, maybe is_multi_author() isn't the best check here, because it is the admin. If I am the 'admin', I would probably want to see an author column of posts by 'steve'.

Perhaps it should be an actual check for total users in the DB. (That would avoid the need to mess with quick edit.)

#6 @nacin
12 years ago

  • Keywords commit removed

#7 @SergeyBiryukov
12 years ago

20345.2.patch leverages count_users().

We still need to pass the value via Quick Edit, otherwise it would return the excess column
after adding a user in another browser tab.

#8 @SergeyBiryukov
12 years ago

Not sure about the performance impact of count_users() with a large wp_usermeta table.

20345.3.patch is an attempt to implement a lightweight function that will just check the number of records in wp_users.

#9 @ryan
12 years ago

Perhaps get_user_count() and the cron job that updates the corresponding site option could be used. It is currently MS only, but can be moved.

#10 @nacin
12 years ago

Ideally, our logic is smart. It counts the number of users for the blog, and if that is == 1, and if that 1 user is the user logged in, then we don't show a column. If a super admin is logged in, they should see the column. It doesn't make sense to show an author column in multisite just because there are > 1 user even when every user has only one blog (and each blog has only one user).

An alternative thing we could do is just take this into CSS/JS. Just hide the column all together (as if the box is unchecked). Show the column when the new inline data of a quick edited post reflects a user ID of someone new. A bit more complicated, but sticks to the interface.

#11 @ryan
12 years ago

  • Milestone changed from 3.4 to Future Release

This needs more thought than 3.4 allows. Punting per bug scrub.

#12 @mercime
11 years ago

  • Cc mercijavier@… added

#13 @jeremyfelt
10 years ago

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

#14 @johnbillion
9 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.