mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
49ae9c8b6e
commit
ad6f2b2921
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user