mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-13 05:10:18 +00:00
Create a function, get_preview_post_link(), to DRY the logic for applying the 'preview_post_link' filter to a URL.
Props TomHarrigan, wonderboymusic. Fixes #24345. git-svn-id: https://develop.svn.wordpress.org/trunk@34170 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1157,9 +1157,9 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
$title = _draft_or_post_title();
|
||||
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
|
||||
if ( $can_edit_post ) {
|
||||
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
|
||||
$unpublished_link = set_url_scheme( get_permalink( $post ) );
|
||||
/** This filter is documented in wp-admin/includes/meta-boxes.php */
|
||||
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
|
||||
$preview_link = get_preview_post_link( $post, array(), $unpublished_link );
|
||||
$actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
|
||||
}
|
||||
} elseif ( 'trash' != $post->post_status ) {
|
||||
|
||||
Reference in New Issue
Block a user