Changeset 34170 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 09/15/2015 04:14:23 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r34020 r34170 1319 1319 if ( isset( $view_post ) ) { 1320 1320 if ( 'draft' == $post->post_status ) { 1321 $ preview_link = set_url_scheme( get_permalink( $post->ID ) );1321 $draft_link = set_url_scheme( get_permalink( $post->ID ) ); 1322 1322 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1323 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post);1323 $preview_link = get_preview_post_link( $post, array(), $draft_link ); 1324 1324 $return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n"; 1325 1325 } else { … … 1512 1512 1513 1513 if ( $locked ) { 1514 $query_args = array(); 1514 1515 if ( get_post_type_object( $post->post_type )->public ) { 1515 $preview_link = set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) );1516 1517 1516 if ( 'publish' == $post->post_status || $user->ID != $post->post_author ) { 1518 1517 // Latest content is in autosave 1519 1518 $nonce = wp_create_nonce( 'post_preview_' . $post->ID ); 1520 $preview_link = add_query_arg( array( 'preview_id' => $post->ID, 'preview_nonce' => $nonce ), $preview_link ); 1519 $query_args['preview_id'] = $post->ID; 1520 $query_args['preview_nonce'] = $nonce; 1521 1521 } 1522 } else { 1523 $preview_link = ''; 1524 } 1525 1526 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1527 $preview_link = apply_filters( 'preview_post_link', $preview_link, $post ); 1522 } 1523 1524 $preview_link = get_preview_post_link( $post->ID, $query_args ); 1528 1525 1529 1526 /** … … 1711 1708 wp_die( $saved_post_id->get_error_message() ); 1712 1709 1713 $query_args = array( 'preview' => 'true');1710 $query_args = array(); 1714 1711 1715 1712 if ( $is_autosave && $saved_post_id ) { … … 1721 1718 } 1722 1719 1723 $url = add_query_arg( $query_args, get_permalink( $post->ID ) ); 1724 1725 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1726 return apply_filters( 'preview_post_link', $url, $post ); 1720 return get_preview_post_link( $post, $query_args ); 1727 1721 } 1728 1722
Note: See TracChangeset
for help on using the changeset viewer.