WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#16947 closed defect (bug) (fixed)

Author role should have "Stick this post to the front page" hidden

Reported by: linuxologos Owned by: nacin
Milestone: 3.2 Priority: normal
Severity: normal Version: 2.9
Component: General Keywords: has-patch
Focuses: Cc:

Description

Currently, making a post sticky depends on the "edit_others_posts" capability. The Author role does not have this by default.

Log in with an Author account.
Go to Add New/Edit Post screen > Publish meta box > Visibility.
Check the "Stick this post to the front page" option.
Click Publish/Update. Visibility is set back to "Public" (not Sticky).

This is the intended behavior, so "Stick this post to the front page" should be hidden from Authors. The related code must be at /wp-admin/includes/meta-boxes.php#L142.

Quick Edit works fine, since it does check for the edit_others_posts cap in /wp-admin/includes/class-wp-posts-list-table.php#L957.

Discovered in WP 3.1, but I think the related piece of code lies there since 2.9.

Attachments (1)

16947.diff (1.1 KB) - added by solarissmoke 10 years ago.

Download all attachments as: .zip

Change History (5)

@solarissmoke
10 years ago

#1 @solarissmoke
10 years ago

  • Keywords has-patch added

Side note, it seems a bit weird that an author isn't allowed to unstick a public post, but can unstick it by making it private/protected.

#2 @jane
10 years ago

Agree, the sticky option should be hidden from authors.

#3 @nacin
10 years ago

  • Milestone changed from Awaiting Review to 3.2
  • Owner set to nacin
  • Status changed from new to accepted

Looks good.

#4 @nacin
10 years ago

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

(In [17724]) Only show the sticky posts checkbox when edit_others_posts. Doesn't work without it. props solarissmoke, linuxologos, fixes #16947.

Note: See TracTickets for help on using tickets.