Consistently apply 'preview_post_link' filter. fixes #19378.
git-svn-id: https://develop.svn.wordpress.org/trunk@23560 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a8c27b4039
commit
3624fa4fde
|
@ -577,7 +577,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
if ( $post_type_object->public ) {
|
||||
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
|
||||
if ( $can_edit_post )
|
||||
$actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
|
||||
$actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
|
||||
} elseif ( 'trash' != $post->post_status ) {
|
||||
$actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
|
||||
}
|
||||
|
|
|
@ -1313,5 +1313,5 @@ function post_preview() {
|
|||
$url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $id, 'preview_nonce' => $nonce ), get_permalink($id) );
|
||||
}
|
||||
|
||||
return $url;
|
||||
return apply_filters( 'preview_post_link', $url );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue