Ticket #9681: 9681.patch
File 9681.patch, 2.4 KB (added by , 15 years ago) |
---|
-
wp-admin/revision.php
18 18 $parent_file = $redirect = 'edit.php'; 19 19 20 20 switch ( $action ) : 21 case 'delete' : // stubs 21 case 'delete' : 22 if ( !$revision = wp_get_post_revision( $revision_id ) ) 23 break; 24 if ( !current_user_can( 'edit_post', $revision->post_parent ) ) 25 break; 26 if ( !$post = get_post( $revision->post_parent ) ) 27 break; 28 if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave 29 break; 30 31 check_admin_referer( "delete-post_$post->ID|$revision->ID" ); 32 33 wp_delete_post_revision( $revision->ID ); 34 $redirect = false; 35 break; 22 36 case 'edit' : 23 37 if ( constant('WP_POST_REVISIONS') ) // stub 24 38 $redirect = remove_query_arg( 'action' ); -
wp-includes/post-template.php
1292 1292 $right_checked = $right == $revision->ID ? ' checked="checked"' : ''; 1293 1293 1294 1294 $class = $class ? '' : " class='alternate'"; 1295 1296 if ( $post->ID != $revision->ID && $can_edit_post ) 1297 $actions = '<a href="' . wp_nonce_url( add_query_arg( array( 'revision' => $revision->ID, 'diff' => false, 'action' => 'restore' ) ), "restore-post_$post->ID|$revision->ID" ) . '">' . __( 'Restore' ) . '</a>'; 1298 else 1299 $actions = ''; 1300 1295 1296 $actions = ''; 1297 1298 if ( $post->ID != $revision->ID && $can_edit_post ) { 1299 $actions .= '<a href="' . wp_nonce_url( add_query_arg( array( 'revision' => $revision->ID, 'diff' => false, 'action' => 'delete' ) ), "delete-post_$post->ID|$revision->ID" ) . '">' . __( 'Delete' ) . '</a>'; 1300 $actions .= ' | '; 1301 $actions .= '<a href="' . wp_nonce_url( add_query_arg( array( 'revision' => $revision->ID, 'diff' => false, 'action' => 'restore' ) ), "restore-post_$post->ID|$revision->ID" ) . '">' . __( 'Restore' ) . '</a>'; 1302 } 1303 1301 1304 $rows .= "<tr$class>\n"; 1302 1305 $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='left' value='$revision->ID'$left_checked /><input type='radio' name='right' value='$revision->ID'$right_checked /></th>\n"; 1303 1306 $rows .= "\t<td>$date</td>\n";