Revisions: Fix up some bugs I introduced while reviewing the mega revisions patch - when comparing two historical revisions only one half of the diff would load
See #23497 props adamsilverstein. git-svn-id: http://core.svn.wordpress.org/trunk@23508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
23e05a6301
commit
5133b4990b
|
@ -2140,7 +2140,7 @@ function wp_ajax_revisions_data() {
|
|||
$compareto = isset( $_GET['compareto'] ) ? absint( $_GET['compareto'] ) : 0;
|
||||
$showautosaves = isset( $_GET['showautosaves'] ) ? $_GET['showautosaves'] : '';
|
||||
$show_split_view = isset( $_GET['show_split_view'] ) ? $_GET['show_split_view'] : '';
|
||||
$postid = isset( $_GET['postid'] ) ? absint( $_GET['postid'] ) : '';
|
||||
$postid = isset( $_GET['post_id'] ) ? absint( $_GET['post_id'] ) : '';
|
||||
|
||||
$comparetwomode = ( '' == $postid ) ? false : true;
|
||||
//
|
||||
|
@ -2149,7 +2149,6 @@ function wp_ajax_revisions_data() {
|
|||
//so only the possible diffs need be generated
|
||||
//
|
||||
$alltherevisions = array();
|
||||
|
||||
if ( '' == $postid )
|
||||
$postid = $compareto;
|
||||
|
||||
|
@ -2159,6 +2158,7 @@ function wp_ajax_revisions_data() {
|
|||
if ( ! $revisions = wp_get_post_revisions( $postid ) )
|
||||
return;
|
||||
|
||||
|
||||
//if we are comparing two revisions, the first 'revision' represented by the leftmost
|
||||
//slider position is the current revision, prepend a comparison to this revision
|
||||
if ( $comparetwomode )
|
||||
|
|
|
@ -112,7 +112,7 @@ window.wp = window.wp || {};
|
|||
self._right_handle_revisions.url =
|
||||
ajaxurl +
|
||||
'?action=revisions-data&compareto=' + wpRevisionsSettings.post_id +
|
||||
'&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id +
|
||||
'&post_id=' + wpRevisionsSettings.post_id +
|
||||
'&showautosaves=' + self._autosaves +
|
||||
'&showsplitview=' + self._showsplitview +
|
||||
'&nonce=' + wpRevisionsSettings.nonce;
|
||||
|
@ -120,7 +120,7 @@ window.wp = window.wp || {};
|
|||
self._right_handle_revisions.url =
|
||||
ajaxurl +
|
||||
'?action=revisions-data&compareto=' + self._revisions.at( self._left_diff - 1 ).get( 'ID' ) +
|
||||
'&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id +
|
||||
'&post_id=' + wpRevisionsSettings.post_id +
|
||||
'&showautosaves=' + self._autosaves +
|
||||
'&showsplitview=' + self._showsplitview +
|
||||
'&nonce=' + wpRevisionsSettings.nonce;
|
||||
|
@ -129,7 +129,7 @@ window.wp = window.wp || {};
|
|||
self._left_handle_revisions.url =
|
||||
ajaxurl +
|
||||
'?action=revisions-data&compareto=' + self._revisions.at( self._right_diff - 1 ).get( 'ID' ) +
|
||||
'&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id +
|
||||
'&post_id=' + wpRevisionsSettings.post_id +
|
||||
'&showautosaves=' + self._autosaves +
|
||||
'&showsplitview=' + self._showsplitview +
|
||||
'&nonce=' + wpRevisionsSettings.nonce;
|
||||
|
|
Loading…
Reference in New Issue