WordPress.org

Make WordPress Core

Ticket #13328: use_https_preview.diff

File use_https_preview.diff, 711 bytes (added by filosofo, 8 years ago)
  • wp-admin/includes/meta-boxes.php

     
    4040        $preview_link = esc_url(get_permalink($post->ID));
    4141        $preview_button = __('Preview Changes');
    4242} else {
    43         $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
     43        $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', home_url( ( 'page' == $post->post_type ? '?page_id=' : '?p=' ) . $post->ID, ( is_ssl() ? 'https' : 'http' ) ))));
    4444        $preview_button = __('Preview');
    4545}
    4646?>