WordPress.org

Make WordPress Core

Ticket #11688: 11688.diff

File 11688.diff, 1003 bytes (added by nacin, 4 years ago)

Using add_query_arg()

  • wp-admin/includes/template.php

     
    14581458                        } 
    14591459                        if ( in_array($post->post_status, array('pending', 'draft')) ) { 
    14601460                                if ( current_user_can('edit_post', $post->ID) ) 
    1461                                         $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 
     1461                                        $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($post->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 
    14621462                        } elseif ( 'trash' != $post->post_status ) { 
    14631463                                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 
    14641464                        }