After [31114] and [31323], 'View Post' generated in `get_sample_permalink_html()` should go to pretty permalink.
`get_permalink()` will return a non-pretty permalink for future posts, which breaks some user workflows that expect View Post to lead to a page with the pretty permalink. Fixes #30910. Built from https://develop.svn.wordpress.org/trunk@32002 git-svn-id: http://core.svn.wordpress.org/trunk@31981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
820b895cf6
commit
62450e9f0f
|
@ -1294,6 +1294,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
|||
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
|
||||
$pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post_name, urldecode( $permalink ) );
|
||||
|
||||
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
|
||||
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
|
||||
|
@ -1309,7 +1310,11 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
|||
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
|
||||
$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";
|
||||
} else {
|
||||
$return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||
if ( empty( $pretty_permalink ) ) {
|
||||
$pretty_permalink = $permalink;
|
||||
}
|
||||
|
||||
$return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-beta4-32001';
|
||||
$wp_version = '4.2-beta4-32002';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue