Changeset 24664 for trunk/wp-admin/includes/revision.php
- Timestamp:
- 07/11/2013 10:56:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/revision.php
r24663 r24664 62 62 } 63 63 64 function wp_prepare_revisions_for_js( $post, $selected_revision_id ) {64 function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) { 65 65 $post = get_post( $post ); 66 66 $revisions = array(); … … 99 99 } 100 100 101 // Now, grab the initial diff 102 if ( ! $from ) { // Single mode 103 $initial_revisions = array_reverse( array_keys( array_slice( $revisions, array_search( $selected_revision_id, array_keys( $revisions ) ), 2, true ) ) ); 104 $compare_two_mode = false; 105 } else { // Compare two 106 $compare_two_mode = true; 107 $initial_revisions = array( $from, $selected_revision_id ); 108 } 109 $diffs = array( array( 110 'id' => $initial_revisions[0] . ':' . $initial_revisions[1], 111 'fields' => wp_get_revision_ui_diff( $post->ID, $initial_revisions[0], $initial_revisions[1] ), 112 )); 113 101 114 return array( 102 115 'postId' => $post->ID, 103 116 'nonce' => wp_create_nonce( 'revisions-ajax-nonce' ), 104 117 'revisionData' => array_values( $revisions ), 105 'selectedRevision' => $selected_revision_id, 118 'to' => $selected_revision_id, 119 'from' => $from, 120 'diffData' => $diffs, 121 'baseUrl' => parse_url( admin_url( 'revision.php' ), PHP_URL_PATH ), 122 'compareTwoMode' => absint( $compare_two_mode ), // Apparently booleans are not allowed 106 123 ); 107 124 }
Note: See TracChangeset
for help on using the changeset viewer.