Don't show "Preview" for locked, non-public post types. props aaroncampbell. fixed #24139.
git-svn-id: http://core.svn.wordpress.org/trunk@24799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
84c50056b7
commit
d07cc7be81
|
@ -1235,6 +1235,7 @@ function _admin_notice_post_locked() {
|
|||
<?php
|
||||
|
||||
if ( $locked ) {
|
||||
if ( get_post_type_object( $post->post_type )->public ) {
|
||||
$preview_link = set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) );
|
||||
|
||||
if ( 'publish' == $post->post_status || $user->ID != $post->post_author ) {
|
||||
|
@ -1242,6 +1243,9 @@ function _admin_notice_post_locked() {
|
|||
$nonce = wp_create_nonce( 'post_preview_' . $post->ID );
|
||||
$preview_link = add_query_arg( array( 'preview_id' => $post->ID, 'preview_nonce' => $nonce ), $preview_link );
|
||||
}
|
||||
} else {
|
||||
$preview_link = '';
|
||||
}
|
||||
|
||||
$preview_link = apply_filters( 'preview_post_link', $preview_link );
|
||||
$override = apply_filters( 'override_post_lock', true, $post, $user );
|
||||
|
@ -1254,8 +1258,10 @@ function _admin_notice_post_locked() {
|
|||
<?php do_action( 'post_lock_text', $post ); ?>
|
||||
<p>
|
||||
<a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
|
||||
<?php if ( $preview_link ) { ?>
|
||||
<a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e('Preview'); ?></a>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Allow plugins to prevent some users overriding the post lock
|
||||
if ( $override ) {
|
||||
|
|
Loading…
Reference in New Issue