WordPress.org

Make WordPress Core

Changeset 16903


Ignore:
Timestamp:
12/13/10 22:38:27 (7 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r16684 r16903  
    3939<?php 
    4040if ( 'publish' == $post->post_status ) { 
    41     $preview_link = esc_url(get_permalink($post->ID)); 
    42     $preview_button = __('Preview Changes'); 
     41    $preview_link = esc_url( get_permalink( $post->ID ) ); 
     42    $preview_button = __( 'Preview Changes' ); 
    4343} else { 
    44     $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); 
    45     $preview_button = __('Preview'); 
     44    $preview_link = get_permalink( $post->ID ); 
     45    if ( is_ssl() ) 
     46        $preview_link = str_replace( 'http://', 'https://', $preview_link ); 
     47    $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); 
     48    $preview_button = __( 'Preview' ); 
    4649} 
    4750?> 
Note: See TracChangeset for help on using the changeset viewer.