Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31658 closed defect (bug) (fixed)

Press This: Users lacking the ability to publish should not see a Publish button

Reported by: drewapicture's profile DrewAPicture Owned by: azaozz's profile azaozz
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Press This Keywords: needs-patch
Focuses: ui Cc:


Currently, if a user lacks the capability to publish posts, they still see a Publish button in the Press This window:

And while clicking the Publish button simply appears to save a draft and redirect the user to the editing view within the admin, this workflow could be confusing. That said, I think we have two reasonably good options:

  1. Remove the Publish button. Switch the order of Preview and Save Draft and make Save Draft the primary:

  1. Replace the Publish button with a Submit for Review button, and upon clicking it, the post is actually submitted for review, redirecting to the editing screen as expected:

The patch I've attached handles the first option above. The second option would require a little more intimate knowledge of how Press This operates.

Attachments (2)

31658.diff (965 bytes) - added by DrewAPicture 9 years ago.
Option #1
31658.2.diff (804 bytes) - added by stephdau 9 years ago.

Download all attachments as: .zip

Change History (6)

9 years ago

Option #1

#1 follow-up: @Michael Arestad
9 years ago

Option 2 is better.

#2 in reply to: ↑ 1 @DrewAPicture
9 years ago

  • Keywords needs-patch added; has-patch removed

Replying to Michael Arestad:

Option 2 is better.

I agree. I think it falls more in line with what users would expect and is the more elegant solution. And in that case, we'll need a new patch.

9 years ago

#3 @stephdau
9 years ago

Since $_POST['status'] used in WP_Press_This::save_post() based on having the publish-button class in the JS:

} else if ( $target.hasClass( 'publish-button' ) ) {
	submitPost( 'publish' );

... that means the caption on the button is irrelevant to the process, and can be switched to "Submit for review", and work as intended.

See 31658.2.diff

Note that we also have more cap checks in press-this.php itself, for the basic stuff.

if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) )
	wp_die( __( 'Cheatin’ uh?' ), 403 );

#4 @azaozz
9 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 31798:

Press This: change the Publish button text to Submit for Review for contributors (like on the Edit Post screen).
Props stephdau, DrewAPicture. Fixes #31658.

Note: See TracTickets for help on using tickets.