Skip to content

Commit

Permalink
Merge pull request #597 from dxw/fix/previewing-others-posts
Browse files Browse the repository at this point in the history
Fix bug preventing previewing posts authored by other users
  • Loading branch information
cojennin authored Apr 7, 2020
2 parents 804c53b + 233750f commit 58cccda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/custom-status/custom-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ public function fix_preview_link_part_two( $permalink, $post, $sample ) {
* @see https://github.com/Automattic/Edit-Flow/issues/513
*/
public function fix_preview_link_part_three( $preview_link, $query_args ) {
if ( $autosave = wp_get_post_autosave( $query_args->ID, $query_args->post_author ) ) {
if ( $autosave = wp_get_post_autosave( $query_args->ID, get_current_user_id() ) ) {
foreach ( array_intersect( array_keys( _wp_post_revision_fields( $query_args ) ), array_keys( _wp_post_revision_fields( $autosave ) ) ) as $field ) {
if ( normalize_whitespace( $query_args->$field ) != normalize_whitespace( $autosave->$field ) ) {
// Pass through, it's a personal preview.
Expand Down

0 comments on commit 58cccda

Please # to comment.