Edit Post: When a post is "Pending Review", the "View Post" link should behave like ot does for drafts and generate a preview link.
Props wpdev101. Fixes #33541. git-svn-id: https://develop.svn.wordpress.org/trunk@34324 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1ca6eee748
commit
6d51562d72
@ -1329,7 +1329,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $view_post ) ) {
|
if ( isset( $view_post ) ) {
|
||||||
if ( 'draft' == $post->post_status ) {
|
if ( 'draft' == $post->post_status || 'pending' == $post->post_status ) {
|
||||||
$draft_link = set_url_scheme( get_permalink( $post->ID ) );
|
$draft_link = set_url_scheme( get_permalink( $post->ID ) );
|
||||||
$preview_link = get_preview_post_link( $post, array(), $draft_link );
|
$preview_link = get_preview_post_link( $post, array(), $draft_link );
|
||||||
$return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n";
|
$return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user