Opened 14 months ago

Last modified 13 months ago

#20345 new enhancement

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

Reported by: johnbillion Owned by:
Priority: low Milestone: Future Release
Component: Administration Version: 3.4
Severity: normal Keywords: has-patch
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 14 months ago.
20345.2.patch (2.0 KB) - added by SergeyBiryukov 14 months ago.
20345.3.patch (2.4 KB) - added by SergeyBiryukov 13 months ago.

Download all attachments as: .zip

Change History (14)

  • Description modified (diff)
  • 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.

  • Keywords has-patch added; needs-patch removed
  • Keywords commit added
  • Milestone changed from Future Release to 3.4

This code came with a guitar in hand.

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: http://cl.ly/011E2R1Z222u2w2f211O

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.)

  • Keywords commit removed

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.

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.

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.

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.

  • Milestone changed from 3.4 to Future Release

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

Note: See TracTickets for help on using tickets.