From 23e02fafce7769ffc9f2c9b2cf2bf3dd22c7214c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 19 Jun 2015 21:49:25 +0000 Subject: [PATCH] Edit Post screen messages need to run preview URLs through the `preview_post_link` filter. Props pareshradadiya. Fixes #32191. Built from https://develop.svn.wordpress.org/trunk@32870 git-svn-id: http://core.svn.wordpress.org/trunk@32841 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 15 +++++++++++---- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 0724a88c71..c93112b49a 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -81,6 +81,9 @@ if ( ! $permalink ) { } $messages = array(); +/** This filter is documented in wp-admin/includes/meta-boxes.php */ +$post_preview_url = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $permalink ), $post ); + $messages['post'] = array( 0 => '', // Unused. Messages start at index 1. 1 => sprintf( __('Post updated. View post'), esc_url( $permalink ) ), @@ -91,12 +94,16 @@ $messages['post'] = array( 5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => sprintf( __('Post published. View post'), esc_url( $permalink ) ), 7 => __('Post saved.'), - 8 => sprintf( __('Post submitted. Preview post'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + 8 => sprintf( __('Post submitted. Preview post'), esc_url( $post_preview_url ) ), 9 => sprintf( __('Post scheduled for: %1$s. Preview post'), /* translators: Publish box date format, see http://php.net/date */ date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ), - 10 => sprintf( __('Post draft updated. Preview post'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + 10 => sprintf( __('Post draft updated. Preview post'), esc_url( $post_preview_url ) ), ); + +/** This filter is documented in wp-admin/includes/meta-boxes.php */ +$page_preview_url = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $permalink ), $post ); + $messages['page'] = array( 0 => '', // Unused. Messages start at index 1. 1 => sprintf( __('Page updated. View page'), esc_url( $permalink ) ), @@ -106,9 +113,9 @@ $messages['page'] = array( 5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => sprintf( __('Page published. View page'), esc_url( $permalink ) ), 7 => __('Page saved.'), - 8 => sprintf( __('Page submitted. Preview page'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + 8 => sprintf( __('Page submitted. Preview page'), esc_url( $page_preview_url ) ), 9 => sprintf( __('Page scheduled for: %1$s. Preview page'), date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ), - 10 => sprintf( __('Page draft updated. Preview page'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + 10 => sprintf( __('Page draft updated. Preview page'), esc_url( $page_preview_url ) ), ); $messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now. diff --git a/wp-includes/version.php b/wp-includes/version.php index 478ba21f25..fb5055351e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32869'; +$wp_version = '4.3-alpha-32870'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.