Correct the "View Post" button link when changing a post slug. Fixes #16477. Props aubreypwd.

Built from https://develop.svn.wordpress.org/trunk@27508


git-svn-id: http://core.svn.wordpress.org/trunk@27351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-03-11 23:00:16 +00:00
parent 75b86ecfb0
commit cc7f0b61ec
1 changed files with 4 additions and 2 deletions

View File

@ -1094,8 +1094,10 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
if ( isset($view_post) )
$return .= "<span id='view-post-btn'><a href='$view_link' class='button button-small'>$view_post</a></span>\n";
if ( isset( $view_post ) ) {
$return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n";
}
$return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);