Changeset 12751 for trunk/wp-admin/revision.php
- Timestamp:
- 01/18/2010 11:44:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/revision.php
r12500 r12751 13 13 14 14 wp_reset_vars(array('revision', 'left', 'right', 'diff', 'action')); 15 15 16 $revision_id = absint($revision); 16 17 $diff = absint($diff); … … 18 19 $right = absint($right); 19 20 20 $ parent_file = $redirect = 'edit.php';21 $redirect = 'edit.php'; 21 22 22 23 switch ( $action ) : 23 case 'delete' : // stubs24 case 'edit' :25 if ( constant('WP_POST_REVISIONS') ) // stub26 $redirect = remove_query_arg( 'action' );27 else // Revisions disabled28 $redirect = 'edit.php';29 break;30 24 case 'restore' : 31 25 if ( !$revision = wp_get_post_revision( $revision_id ) ) … … 116 110 break; 117 111 112 $post_type_object = get_post_type_object($post->post_type); 113 118 114 $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>'; 119 115 $revision_title = wp_post_revision_title( $revision, false ); 120 $h2 = sprintf( __( 'Post Revision for “%1$s” created on %2$s' ), $post_title, $revision_title ); 116 $h2 = sprintf( __( 'Revision for “%1$s” created on %2$s' ), $post_title, $revision_title ); 117 $title = __( 'Revisions' ); 121 118 122 119 // Sets up the diff radio buttons … … 128 125 endswitch; 129 126 130 if ( !$redirect && !in_array( $post->post_type, array( 'post', 'page' ) ) ) 131 $redirect = 'edit.php'; 132 133 if ( $redirect ) { 127 if ( !$redirect ) { 128 if ( empty($post->post_type) ) // Empty post_type means either malformed object found, or no valid parent was found. 129 $redirect = 'edit.php'; 130 elseif ( !post_type_supports($post->post_type, 'revisions') ) 131 $redirect = 'edit.php?post_type=' . $post->post_type; 132 } 133 134 if ( !empty($redirect) ) { 134 135 wp_redirect( $redirect ); 135 136 exit; 136 137 } 137 138 138 if ( 'page' == $post->post_type ) { 139 $submenu_file = 'edit-pages.php'; 140 $title = __( 'Page Revisions' ); 141 } else { 142 $submenu_file = 'edit.php'; 143 $title = __( 'Post Revisions' ); 144 } 139 // This is so that the correct "Edit" menu item is selected. 140 if ( !empty($post->post_type) && 'post' != $post->post_type ) 141 $parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type; 142 else 143 $parent_file = $submenu_file = 'edit.php'; 145 144 146 145 require_once( 'admin-header.php' );
Note: See TracChangeset
for help on using the changeset viewer.