Opened 11 years ago
Closed 11 years ago
#27059 closed enhancement (fixed)
Add View Page button for private pages
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8.1 |
Component: | Posts, Post Types | Keywords: | has-patch commit |
Focuses: | ui, administration | Cc: |
Description
A private page is simply one that users with the read_private_pages
have permission to view. Any logged in user with that permission can view the page, which makes sense.
When editing a private page, however, there is never a clear indication in the UI that you (a user with the read_private_pages
capability) can view the page. The only options presented are Preview Page
and Update
.
I've found myself on numerous occasions trying to figure out how to view a private page from the edit.php (perhaps after saving some changes), but there isn't one.
The View Page
button is only visible when the page is set to Published.
The only option to view a private page is the Preview
button, which has a few issues for this scenario:
- It implies that changes have been made, even if there haven't been any (Preview is shown even after saving a change)
- The
Preview
button uses a post preview URl with a nonce, which means the URL can become invalid. If I want to share the private page's URL with another user with theread_private_pages
capability, this is kind of crappy.
- The normal permalink, such as site.com/?page_id=1148 works just fine, it's just never revealed.
There is a View Page
link presented in the update notification, but never anywhere when simply viewing the page editor. There is also one in the page action links from the list table, but not in the editor.
I'd propose that we show the View Page
button between the Edit
and Get Shortlink
buttons: http://screencloud.net/v/7Sun
Note, this actually applies to all post types, but pages is the one I've always run into it with.
Attachments (3)
Change History (10)
#1
@
11 years ago
- Focuses accessibility removed
- Milestone changed from Awaiting Review to 3.9
Makes sense.
#3
@
11 years ago
I guess we can use current_user_can( 'read_post', $post->ID )
here: 27059.2.patch.
#4
@
11 years ago
27059.3.patch uses current_user_can()
to set $view_post
, but keeps the current check for $title
.
#6
@
11 years ago
I don't really understand this either:
if ( 'publish' == get_post_status( $post ) ) { $title = __('Click to edit this part of the permalink'); } else { $title = __('Temporary permalink. Click to edit this part.'); }
Realistically that first branch applies to 'private', and really 'future' too. There isn't an obvious way to discern those from the post status object though, so holding off on an immediate change. It's also only a title attribute, which is probably why no one else noticed it either. And generally, perhaps get_sample_permalink()'s blacklist of 'draft' and 'pending' would make more sense.
Show View {post type} if current user can read private posts