Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix post revision action link by getting the adjacent revision #659

Merged
merged 2 commits into from Nov 19, 2014

Conversation

fjarrett
Copy link
Contributor

Taking another stab at #585, this time using a workaround that finds the adjacent revision ID.

Unfortunately, the revision_id being saved as record meta is still incorrect. But this PR does fix the action link problem to arrive to the correct revision for that record.

screen shot 2014-11-13 at 9 27 30 pm

@shadyvb please review.

@shadyvb shadyvb self-assigned this Nov 16, 2014
$revision_id = absint( wp_stream_get_meta( $record, 'revision_id', true ) );
$revision_id = self::get_adjacent_post_revision( $revision_id, false );

if ( wp_is_post_revision( $revision_id ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fjarrett get_adjacent_post_revision already does that check internally. Also i think we should first check if $revision_id is empty or not, so as not to make the extra function call if it was empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shadyvb Nice suggestions. How's this? a0e42d2

@shadyvb shadyvb assigned fjarrett and unassigned shadyvb Nov 16, 2014
fjarrett added a commit that referenced this pull request Nov 19, 2014
Fix post revision action link by getting the adjacent revision
@fjarrett fjarrett merged commit 1d72070 into develop Nov 19, 2014
@fjarrett fjarrett deleted the issue-585 branch November 19, 2014 05:54
@fjarrett fjarrett removed their assignment Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants