Opened 10 years ago
Closed 10 years ago
#31658 closed defect (bug) (fixed)
Press This: Users lacking the ability to publish should not see a Publish button
Reported by: | DrewAPicture | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Press This | Keywords: | needs-patch |
Focuses: | ui | Cc: |
Description
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:
- Remove the Publish button. Switch the order of Preview and Save Draft and make Save Draft the primary:
- 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)
Change History (6)
#2
in reply to:
↑ 1
@
10 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.
#3
@
10 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 );
Option #1