Use https for preview links if is_ssl(). Props nacin, filosofo. fixes #13328

git-svn-id: http://svn.automattic.com/wordpress/trunk@16903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-12-13 22:38:27 +00:00
parent 49ae9c8b6e
commit ad6f2b2921
1 changed files with 7 additions and 4 deletions

View File

@ -38,11 +38,14 @@ function post_submit_meta_box($post) {
<div id="preview-action">
<?php
if ( 'publish' == $post->post_status ) {
$preview_link = esc_url(get_permalink($post->ID));
$preview_button = __('Preview Changes');
$preview_link = esc_url( get_permalink( $post->ID ) );
$preview_button = __( 'Preview Changes' );
} else {
$preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
$preview_button = __('Preview');
$preview_link = get_permalink( $post->ID );
if ( is_ssl() )
$preview_link = str_replace( 'http://', 'https://', $preview_link );
$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
$preview_button = __( 'Preview' );
}
?>
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>