Make WordPress Core

Changeset 36926


Ignore:
Timestamp:
03/10/2016 04:41:34 AM (9 years ago)
Author:
jeremyfelt
Message:

Posts: Call set_url_scheme() consistently on URLs passed through preview_post_link

After [34170], some preview URLs that passed through set_url_scheme() no longer do so. We can restore that behavior by applying set_url_scheme() whenever get_preview_post_link() provides the URL.

Props danielbachhuber.
Fixes #35407.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r36808 r36926  
    12261226            if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
    12271227                if ( $can_edit_post ) {
    1228                     $unpublished_link = set_url_scheme( get_permalink( $post ) );
    1229                     $preview_link = get_preview_post_link( $post, array(), $unpublished_link );
     1228                    $preview_link = get_preview_post_link( $post );
    12301229                    $actions['view'] = sprintf(
    12311230                        '<a href="%s" rel="permalink" aria-label="%s">%s</a>',
  • trunk/src/wp-admin/includes/post.php

    r36853 r36926  
    12951295    if ( current_user_can( 'read_post', $post->ID ) ) {
    12961296        if ( 'draft' === $post->post_status ) {
    1297             $draft_link = set_url_scheme( get_permalink( $post->ID ) );
    1298             $view_link = get_preview_post_link( $post, array(), $draft_link );
     1297            $view_link = get_preview_post_link( $post );
    12991298            $preview_target = " target='wp-preview-{$post->ID}'";
    13001299        } else {
  • trunk/src/wp-includes/admin-bar.php

    r36874 r36926  
    559559        {
    560560            if ( 'draft' == $post->post_status ) {
    561                 $draft_link = set_url_scheme( get_permalink( $post->ID ) );
    562                 $preview_link = get_preview_post_link( $post, array(), $draft_link );
     561                $preview_link = get_preview_post_link( $post );
    563562                $wp_admin_bar->add_menu( array(
    564563                    'id' => 'preview',
  • trunk/src/wp-includes/link-template.php

    r36874 r36926  
    12231223    if ( is_post_type_viewable( $post_type_object ) ) {
    12241224        if ( ! $preview_link ) {
    1225             $preview_link = get_permalink( $post );
     1225            $preview_link = set_url_scheme( get_permalink( $post ) );
    12261226        }
    12271227
Note: See TracChangeset for help on using the changeset viewer.