Make WordPress Core

Ticket #28729: 28729.1.diff

File 28729.1.diff, 4.0 KB (added by danielbachhuber, 10 years ago)
  • wp-admin/includes/class-wp-posts-list-table.php

     
    663663                                                if ( $can_edit_post ) {
    664664
    665665                                                        /** 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 &#8220;%s&#8221;' ), $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 &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
    667667                                                }
    668668                                        } elseif ( 'trash' != $post->post_status ) {
    669669                                                $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
  • wp-admin/includes/meta-boxes.php

     
    4949         *
    5050         * @param string $preview_link URI the user will be directed to for a post preview.
    5151         */
    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 ) );
    5353        $preview_button = __( 'Preview' );
    5454}
    5555?>
  • wp-admin/includes/post.php

     
    12201220                if( 'draft' == $post->post_status ) {
    12211221                        $preview_link = set_url_scheme( get_permalink( $post->ID ) );
    12221222                        /** 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 );
    12241224                        $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";
    12251225                } else {
    12261226                        $return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n";
     
    14041404                }
    14051405
    14061406                /** 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 );
    14081408
    14091409                /**
    14101410                 * Filter whether to allow the post lock to be overridden.
     
    16061606        $url = add_query_arg( $query_args, get_permalink( $post->ID ) );
    16071607
    16081608        /** 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 );
    16101610}
    16111611
    16121612/**
  • wp-includes/admin-bar.php

     
    496496                        if( 'draft' == $post->post_status ) {
    497497                                $preview_link = set_url_scheme( get_permalink( $post->ID ) );
    498498                                /** 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 );
    500500                                $wp_admin_bar->add_menu( array(
    501501                                        'id' => 'preview',
    502502                                        'title' => __( 'Preview' ),