WordPress.org

Make WordPress Core

Changeset 13104


Ignore:
Timestamp:
02/13/2010 09:49:44 AM (12 years ago)
Author:
nacin
Message:

Add ?preview=true to edit post rows when draft|pending. Props MMN-o, fixes #11688

File:
1 edited

Legend:

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

    r13097 r13104  
    13671367            if ( in_array($post->post_status, array('pending', 'draft')) ) {
    13681368                if ( current_user_can($post_type_object->edit_cap, $post->ID) )
    1369                     $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1369                    $actions['view'] = '<a href="' . add_query_arg( get_permalink($post->ID), 'preview', 'true' ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    13701370            } elseif ( 'trash' != $post->post_status ) {
    13711371                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
     
    15891589        if ( in_array($post->post_status, array('pending', 'draft')) ) {
    15901590            if ( current_user_can($post_type_object->edit_cap, $page->ID) )
    1591                 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1591                $actions['view'] = '<a href="' . add_query_arg( get_permalink($page->ID), 'preview', 'true' ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    15921592        } elseif ( $post->post_status != 'trash' ) {
    15931593            $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
Note: See TracChangeset for help on using the changeset viewer.