WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 months ago

#20345 new enhancement

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

Reported by: johnbillion Owned by:
Milestone: Future Release 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 2 years ago.
20345.2.patch (2.0 KB) - added by SergeyBiryukov 2 years ago.
20345.3.patch (2.4 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 johnbillion2 years ago

  • Description modified (diff)

comment:2 jane2 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.

SergeyBiryukov2 years ago

comment:3 SergeyBiryukov2 years ago

  • Keywords has-patch added; needs-patch removed

comment:4 nacin2 years ago

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

This code came with a guitar in hand.

comment:5 nacin2 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: 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.)

comment:6 nacin2 years ago

  • Keywords commit removed

comment:7 SergeyBiryukov2 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.

SergeyBiryukov2 years ago

SergeyBiryukov2 years ago

comment:8 SergeyBiryukov2 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.

comment:9 ryan2 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.

comment:10 nacin2 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.

comment:11 ryan2 years ago

  • Milestone changed from 3.4 to Future Release

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

comment:12 mercime9 months ago

  • Cc mercijavier@… added

comment:13 jeremyfelt2 months ago

  • Component changed from Administration to Posts, Post Types
  • Focuses admin added
Note: See TracTickets for help on using tickets.