Ticket #28729: 28729.1.diff
File 28729.1.diff, 4.0 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/class-wp-posts-list-table.php
663 663 if ( $can_edit_post ) { 664 664 665 665 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 666 $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';666 $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ), $post ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 667 667 } 668 668 } elseif ( 'trash' != $post->post_status ) { 669 669 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; -
wp-admin/includes/meta-boxes.php
49 49 * 50 50 * @param string $preview_link URI the user will be directed to for a post preview. 51 51 */ 52 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );52 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ) ); 53 53 $preview_button = __( 'Preview' ); 54 54 } 55 55 ?> -
wp-admin/includes/post.php
1220 1220 if( 'draft' == $post->post_status ) { 1221 1221 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); 1222 1222 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1223 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) );1223 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); 1224 1224 $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"; 1225 1225 } else { 1226 1226 $return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n"; … … 1404 1404 } 1405 1405 1406 1406 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1407 $preview_link = apply_filters( 'preview_post_link', $preview_link );1407 $preview_link = apply_filters( 'preview_post_link', $preview_link, $post ); 1408 1408 1409 1409 /** 1410 1410 * Filter whether to allow the post lock to be overridden. … … 1606 1606 $url = add_query_arg( $query_args, get_permalink( $post->ID ) ); 1607 1607 1608 1608 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1609 return apply_filters( 'preview_post_link', $url );1609 return apply_filters( 'preview_post_link', $url, $post ); 1610 1610 } 1611 1611 1612 1612 /** -
wp-includes/admin-bar.php
496 496 if( 'draft' == $post->post_status ) { 497 497 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); 498 498 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 499 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) );499 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); 500 500 $wp_admin_bar->add_menu( array( 501 501 'id' => 'preview', 502 502 'title' => __( 'Preview' ),