Use set_url_scheme(). Props johnbillion, MarcusPope. see #19037 #20759

git-svn-id: https://develop.svn.wordpress.org/trunk@21664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-08-30 13:33:00 +00:00
parent bca5b5538d
commit 92ea34f6a2
14 changed files with 43 additions and 68 deletions
+1 -3
View File
@@ -41,9 +41,7 @@ if ( 'publish' == $post->post_status ) {
$preview_link = esc_url( get_permalink( $post->ID ) );
$preview_button = __( 'Preview Changes' );
} else {
$preview_link = get_permalink( $post->ID );
if ( is_ssl() )
$preview_link = str_replace( 'http://', 'https://', $preview_link );
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
$preview_button = __( 'Preview' );
}