diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 0724a88c71..c93112b49a 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/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.