<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>wp-admin/css/farbtastic-rtl.css</filename>
    </added>
    <added>
      <filename>wp-admin/css/farbtastic.css</filename>
    </added>
    <added>
      <filename>wp-admin/css/plugin-install-rtl.css</filename>
    </added>
    <added>
      <filename>wp-admin/css/plugin-install.css</filename>
    </added>
    <added>
      <filename>wp-admin/images/archive-link.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/blue-grad.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/bubble_bg-rtl.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/button-grad-active.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/button-grad.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/ed-bg.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/fav-arrow-rtl.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/fav-arrow.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/fav-top.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/fav.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/generic.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/gray-grad.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/icons32-vs.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/icons32.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/list-vs.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/list.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/marker.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/mask.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu-arrows.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu-bits-rtl.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu-bits.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu-dark-rtl.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu-dark.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu-vs.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/menu.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/resize.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/screen-options-left.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/screen-options-right-up.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/screen-options-right.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/se.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/star.gif</filename>
    </added>
    <added>
      <filename>wp-admin/images/wheel.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/white-grad-active.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/white-grad.png</filename>
    </added>
    <added>
      <filename>wp-admin/images/wp-logo.gif</filename>
    </added>
    <added>
      <filename>wp-admin/import/opml.php</filename>
    </added>
    <added>
      <filename>wp-admin/includes/class-wp-filesystem-ssh2.php</filename>
    </added>
    <added>
      <filename>wp-admin/includes/plugin-install.php</filename>
    </added>
    <added>
      <filename>wp-admin/includes/update-core.php</filename>
    </added>
    <added>
      <filename>wp-admin/js/dashboard.js</filename>
    </added>
    <added>
      <filename>wp-admin/js/farbtastic.js</filename>
    </added>
    <added>
      <filename>wp-admin/js/inline-edit-post.js</filename>
    </added>
    <added>
      <filename>wp-admin/js/inline-edit-tax.js</filename>
    </added>
    <added>
      <filename>wp-admin/js/plugin-install.js</filename>
    </added>
    <added>
      <filename>wp-admin/media-new.php</filename>
    </added>
    <added>
      <filename>wp-admin/options-media.php</filename>
    </added>
    <added>
      <filename>wp-admin/plugin-install.php</filename>
    </added>
    <added>
      <filename>wp-admin/tools.php</filename>
    </added>
    <added>
      <filename>wp-admin/update-core.php</filename>
    </added>
    <added>
      <filename>wp-admin/user-new.php</filename>
    </added>
    <added>
      <filename>wp-includes/http.php</filename>
    </added>
    <added>
      <filename>wp-includes/images/upload.png</filename>
    </added>
    <added>
      <filename>wp-includes/js/comment-reply.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/hoverIntent.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/jquery/jquery.hotkeys.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/jquery/jquery.table-hotkeys.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/jquery/ui.dialog.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/jquery/ui.draggable.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/jquery/ui.resizable.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/swfupload/plugins/swfupload.swfobject.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/swfupload/swfupload.swf</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/langs/wp-langs-en.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/plugins/wpgallery/img/delete.png</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/plugins/wpgallery/img/edit.png</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png</filename>
    </added>
    <added>
      <filename>wp-includes/js/tinymce/plugins/wpgallery/img/t.gif</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,9 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                          675 Mass Ave, Cambridge, MA 02139, USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc. 
+              51 Franklin St, Fifth Floor, Boston, MA 02110, USA
+
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 </diff>
      <filename>license.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,67 @@
 &lt;?php
+/**
+ * WordPress AJAX Process Execution.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Executing AJAX process.
+ *
+ * @since unknown
+ */
 define('DOING_AJAX', true);
+define('WP_ADMIN', true);
 
 require_once('../wp-load.php');
 require_once('includes/admin.php');
 
-if ( !is_user_logged_in() )
+if ( ! is_user_logged_in() ) {
+
+	if ( $_POST['action'] == 'autosave' ) {
+		$id = isset($_POST['post_ID'])? (int) $_POST['post_ID'] : 0;
+
+		if ( ! $id )
+			die('-1');
+
+		$message = sprintf( __('&lt;strong&gt;ALERT: You are logged out!&lt;/strong&gt; Could not save draft. &lt;a href=&quot;%s&quot; target=&quot;blank&quot;&gt;Please log in again.&lt;/a&gt;'), wp_login_url() );
+			$x = new WP_Ajax_Response( array(
+				'what' =&gt; 'autosave',
+				'id' =&gt; $id,
+				'data' =&gt; $message
+			) );
+			$x-&gt;send();
+	}
+
 	die('-1');
+}
 
-if ( isset($_GET['action']) &amp;&amp; 'ajax-tag-search' == $_GET['action'] ) {
+if ( isset( $_GET['action'] ) ) :
+switch ( $action = $_GET['action'] ) :
+case 'ajax-tag-search' :
 	if ( !current_user_can( 'manage_categories' ) )
 		die('-1');
 
 	$s = $_GET['q']; // is this slashed already?
 
-	if ( strstr( $s, ',' ) ) { 
-		$s = explode( ',', $s ); 
-		$s = $s[count( $s ) - 1]; 
+	if ( false !== strpos( $s, ',' ) ) {
+		$s = explode( ',', $s );
+		$s = $s[count( $s ) - 1];
 	}
 	$s = trim( $s );
 	if ( strlen( $s ) &lt; 2 )
-	 die; // require 2 chars for matching
-	$results = $wpdb-&gt;get_col( &quot;SELECT name FROM $wpdb-&gt;terms WHERE name LIKE ('%&quot;. $s . &quot;%')&quot; );
+		die; // require 2 chars for matching
+	$results = $wpdb-&gt;get_col( &quot;SELECT t.name FROM $wpdb-&gt;term_taxonomy AS tt INNER JOIN $wpdb-&gt;terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = 'post_tag' AND t.name LIKE ('%&quot;. $s . &quot;%')&quot; );
 	echo join( $results, &quot;\n&quot; );
 	die;
-}
+	break;
+default :
+	do_action( 'wp_ajax_' . $_GET['action'] );
+	die('0');
+	break;
+endswitch;
+endif;
 
 $id = isset($_POST['id'])? (int) $_POST['id'] : 0;
 switch ( $action = $_POST['action'] ) :
@@ -170,7 +208,7 @@ case 'dim-comment' :
 	if ( $_POST['new'] == $current )
 		die('1');
 
-	if ( 'unapproved' == $current ) {
+	if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
 		check_ajax_referer( &quot;approve-comment_$id&quot; );
 		if ( wp_set_comment_status( $comment-&gt;comment_ID, 'approve' ) )
 			die('1');
@@ -278,7 +316,7 @@ case 'add-cat' : // From Manage-&gt;Categories
 		) );
 		$x-&gt;send();
 	}
-	
+
 	$cat = wp_insert_category( $_POST, true );
 
 	if ( is_wp_error($cat) ) {
@@ -305,6 +343,7 @@ case 'add-cat' : // From Manage-&gt;Categories
 	$x = new WP_Ajax_Response( array(
 		'what' =&gt; 'cat',
 		'id' =&gt; $cat-&gt;term_id,
+		'position' =&gt; -1,
 		'data' =&gt; _cat_row( $cat, $level, $cat_full_name ),
 		'supplemental' =&gt; array('name' =&gt; $cat_full_name, 'show-link' =&gt; sprintf(__( 'Category &lt;a href=&quot;#%s&quot;&gt;%s&lt;/a&gt; added' ), &quot;cat-$cat-&gt;term_id&quot;, $cat_full_name))
 	) );
@@ -340,6 +379,7 @@ case 'add-link-cat' : // From Blogroll -&gt; Categories
 	$x = new WP_Ajax_Response( array(
 		'what' =&gt; 'link-cat',
 		'id' =&gt; $term_id,
+		'position' =&gt; -1,
 		'data' =&gt; $link_cat
 	) );
 	$x-&gt;send();
@@ -376,11 +416,35 @@ case 'add-tag' : // From Manage-&gt;Tags
 	$x = new WP_Ajax_Response( array(
 		'what' =&gt; 'tag',
 		'id' =&gt; $tag-&gt;term_id,
+		'position' =&gt; '-1',
 		'data' =&gt; _tag_row( $tag ),
 		'supplemental' =&gt; array('name' =&gt; $tag_full_name, 'show-link' =&gt; sprintf(__( 'Tag &lt;a href=&quot;#%s&quot;&gt;%s&lt;/a&gt; added' ), &quot;tag-$tag-&gt;term_id&quot;, $tag_full_name))
 	) );
 	$x-&gt;send();
 	break;
+case 'get-tagcloud' :
+	if ( !current_user_can( 'manage_categories' ) )
+		die('-1');
+
+	$tags = get_tags( array( 'number' =&gt; 45, 'orderby' =&gt; 'count', 'order' =&gt; 'DESC' ) );
+
+	if ( empty( $tags ) )
+		die( __('No tags found!') );
+
+	foreach ( $tags as $key =&gt; $tag ) {
+		$tags[ $key ]-&gt;link = '#';
+		$tags[ $key ]-&gt;id = $tag-&gt;term_id;
+	}
+
+	$return = wp_generate_tag_cloud( $tags );
+
+	if ( empty($return) )
+		die('0');
+
+	echo $return;
+
+	exit;
+	break;
 case 'add-comment' :
 	check_ajax_referer( $action );
 	if ( !current_user_can( 'edit_post', $id ) )
@@ -389,8 +453,9 @@ case 'add-comment' :
 	$start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24;
 	$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
 	$mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
-
-	list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 );
+	$p = isset($_POST['p']) ? $_POST['p'] : 0;
+	$comment_type = isset($_POST['comment_type']) ? $_POST['comment_type'] : '';
+	list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1, $p, $comment_type );
 
 	if ( get_option('show_avatars') )
 		add_filter( 'comment_author', 'floated_admin_avatar' );
@@ -401,7 +466,7 @@ case 'add-comment' :
 	foreach ( (array) $comments as $comment ) {
 		get_comment( $comment );
 		ob_start();
-			_wp_comment_row( $comment-&gt;comment_ID, $mode, $status );
+			_wp_comment_row( $comment-&gt;comment_ID, $mode, $status, true, true );
 			$comment_list_item = ob_get_contents();
 		ob_end_clean();
 		$x-&gt;add( array(
@@ -412,6 +477,142 @@ case 'add-comment' :
 	}
 	$x-&gt;send();
 	break;
+case 'get-comments' :
+	check_ajax_referer( $action );
+
+	$post_ID = (int) $_POST['post_ID'];
+	if ( !current_user_can( 'edit_post', $post_ID ) )
+		die('-1');
+
+	$start = isset($_POST['start']) ? intval($_POST['start']) : 0;
+	$num = isset($_POST['num']) ? intval($_POST['num']) : 10;
+
+	list($comments, $total) = _wp_get_comment_list( false, false, $start, $num, $post_ID );
+
+	if ( !$comments )
+		die('1');
+
+	$comment_list_item = '';
+	$x = new WP_Ajax_Response();
+	foreach ( (array) $comments as $comment ) {
+		get_comment( $comment );
+		ob_start();
+			_wp_comment_row( $comment-&gt;comment_ID, 'single', false, false );
+			$comment_list_item .= ob_get_contents();
+		ob_end_clean();
+	}
+	$x-&gt;add( array(
+		'what' =&gt; 'comments',
+		'data' =&gt; $comment_list_item
+	) );
+	$x-&gt;send();
+	break;
+case 'replyto-comment' :
+	check_ajax_referer( $action );
+
+	$comment_post_ID = (int) $_POST['comment_post_ID'];
+	if ( !current_user_can( 'edit_post', $comment_post_ID ) )
+		die('-1');
+
+	$status = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT post_status FROM $wpdb-&gt;posts WHERE ID = %d&quot;, $comment_post_ID) );
+
+	if ( empty($status) )
+		die('1');
+	elseif ( in_array($status, array('draft', 'pending') ) )
+		die( __('Error: you are replying to a comment on a draft post.') );
+
+	$user = wp_get_current_user();
+	if ( $user-&gt;ID ) {
+		$comment_author       = $wpdb-&gt;escape($user-&gt;display_name);
+		$comment_author_email = $wpdb-&gt;escape($user-&gt;user_email);
+		$comment_author_url   = $wpdb-&gt;escape($user-&gt;user_url);
+		$comment_content      = trim($_POST['content']);
+		if ( current_user_can('unfiltered_html') ) {
+			if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
+				kses_remove_filters(); // start with a clean slate
+				kses_init_filters(); // set up the filters
+			}
+		}
+	} else {
+		die( __('Sorry, you must be logged in to reply to a comment.') );
+	}
+
+	if ( '' == $comment_content )
+		die( __('Error: please type a comment.') );
+
+	$comment_parent = absint($_POST['comment_ID']);
+	$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
+
+	$comment_id = wp_new_comment( $commentdata );
+	$comment = get_comment($comment_id);
+	if ( ! $comment ) die('1');
+
+	$modes = array( 'single', 'detail', 'dashboard' );
+	$mode = isset($_POST['mode']) &amp;&amp; in_array( $_POST['mode'], $modes ) ? $_POST['mode'] : 'detail';
+	$position = ( isset($_POST['position']) &amp;&amp; (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
+	$checkbox = ( isset($_POST['checkbox']) &amp;&amp; true == $_POST['checkbox'] ) ? 1 : 0;
+
+	if ( get_option('show_avatars') &amp;&amp; 'single' != $mode )
+		add_filter( 'comment_author', 'floated_admin_avatar' );
+
+	$x = new WP_Ajax_Response();
+
+	ob_start();
+		if ( 'dashboard' == $mode ) {
+			require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
+			_wp_dashboard_recent_comments_row( $comment, false );
+		} else {
+			_wp_comment_row( $comment-&gt;comment_ID, $mode, false, $checkbox );
+		}
+		$comment_list_item = ob_get_contents();
+	ob_end_clean();
+
+	$x-&gt;add( array(
+		'what' =&gt; 'comment',
+		'id' =&gt; $comment-&gt;comment_ID,
+		'data' =&gt; $comment_list_item,
+		'position' =&gt; $position
+	));
+
+	$x-&gt;send();
+	break;
+case 'edit-comment' :
+	check_ajax_referer( 'replyto-comment' );
+
+	$comment_post_ID = (int) $_POST['comment_post_ID'];
+	if ( ! current_user_can( 'edit_post', $comment_post_ID ) )
+		die('-1');
+
+	if ( '' == $_POST['content'] )
+		die( __('Error: please type a comment.') );
+
+	$comment_id = (int) $_POST['comment_ID'];
+	$_POST['comment_status'] = $_POST['status'];
+	edit_comment();
+
+	$mode = ( isset($_POST['mode']) &amp;&amp; 'single' == $_POST['mode'] ) ? 'single' : 'detail';
+	$position = ( isset($_POST['position']) &amp;&amp; (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
+	$checkbox = ( isset($_POST['checkbox']) &amp;&amp; true == $_POST['checkbox'] ) ? 1 : 0;
+
+	if ( get_option('show_avatars') &amp;&amp; 'single' != $mode )
+		add_filter( 'comment_author', 'floated_admin_avatar' );
+
+	$x = new WP_Ajax_Response();
+
+	ob_start();
+		_wp_comment_row( $comment_id, $mode, true, $checkbox );
+		$comment_list_item = ob_get_contents();
+	ob_end_clean();
+
+	$x-&gt;add( array(
+		'what' =&gt; 'edit_comment',
+		'id' =&gt; $comment-&gt;comment_ID,
+		'data' =&gt; $comment_list_item,
+		'position' =&gt; $position
+	));
+
+	$x-&gt;send();
+	break;
 case 'add-meta' :
 	check_ajax_referer( 'add-meta' );
 	$c = 0;
@@ -616,13 +817,29 @@ case 'closed-postboxes' :
 	check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
 	$closed = isset( $_POST['closed'] )? $_POST['closed'] : '';
 	$closed = explode( ',', $_POST['closed'] );
+	$hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : '';
+	$hidden = explode( ',', $_POST['hidden'] );
+	$page = isset( $_POST['page'] )? $_POST['page'] : '';
+	if ( !preg_match( '/^[a-z-_]+$/', $page ) ) {
+		die(-1);
+	}
+	$current_user = wp_get_current_user();
+	if ( is_array($closed) )
+		update_usermeta($current_user-&gt;ID, 'closedpostboxes_'.$page, $closed);
+	if ( is_array($hidden) )
+		update_usermeta($current_user-&gt;ID, 'meta-box-hidden_'.$page, $hidden);
+break;
+case 'hidden-columns' :
+	check_ajax_referer( 'hiddencolumns', 'hiddencolumnsnonce' );
+	$hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : '';
+	$hidden = explode( ',', $_POST['hidden'] );
 	$page = isset( $_POST['page'] )? $_POST['page'] : '';
-	if ( !preg_match( '/^[a-z-]+$/', $page ) ) {
+	if ( !preg_match( '/^[a-z-_]+$/', $page ) ) {
 		die(-1);
 	}
-	if (!is_array($closed)) break;
 	$current_user = wp_get_current_user();
-	update_usermeta($current_user-&gt;ID, 'closedpostboxes_'.$page, $closed);
+	if ( is_array($hidden) )
+		update_usermeta($current_user-&gt;ID, &quot;manage-$page-columns-hidden&quot;, $hidden);
 break;
 case 'get-permalink':
 	check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
@@ -636,6 +853,189 @@ case 'sample-permalink':
 	$slug = isset($_POST['new_slug'])? $_POST['new_slug'] : '';
 	die(get_sample_permalink_html($post_id, $title, $slug));
 break;
+case 'inline-save':
+	check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
+
+	if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) )
+		exit;
+
+	if ( 'page' == $_POST['post_type'] ) {
+		if ( ! current_user_can( 'edit_page', $post_ID ) )
+			die( __('You are not allowed to edit this page.') );
+	} else {
+		if ( ! current_user_can( 'edit_post', $post_ID ) )
+			die( __('You are not allowed to edit this post.') );
+	}
+
+	if ( $last = wp_check_post_lock( $post_ID ) ) {
+		$last_user = get_userdata( $last );
+		$last_user_name = $last_user ? $last_user-&gt;display_name : __( 'Someone' );
+		printf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ),	wp_specialchars( $last_user_name ) );
+		exit;
+	}
+
+	$data = &amp;$_POST;
+	$post = get_post( $post_ID, ARRAY_A );
+	$data['content'] = $post['post_content'];
+	$data['excerpt'] = $post['post_excerpt'];
+
+	// rename
+	$data['user_ID'] = $GLOBALS['user_ID'];
+
+	if ( isset($data['post_parent']) )
+		$data['parent_id'] = $data['post_parent'];
+
+	// status
+	if ( isset($data['keep_private']) &amp;&amp; 'private' == $data['keep_private'] )
+		$data['post_status'] = 'private';
+	else
+		$data['post_status'] = $data['_status'];
+
+	if ( empty($data['comment_status']) )
+		$data['comment_status'] = 'closed';
+	if ( empty($data['ping_status']) )
+		$data['ping_status'] = 'closed';
+
+	// update the post
+	$_POST = $data;
+	edit_post();
+
+	$post = array();
+	if ( 'page' == $_POST['post_type'] ) {
+		$post[] = get_post($_POST['post_ID']);
+		page_rows($post);
+	} elseif ( 'post' == $_POST['post_type'] ) {
+		$mode = $_POST['post_view'];
+		$post[] = get_post($_POST['post_ID']);
+		post_rows($post);
+	}
+
+	exit;
+	break;
+case 'inline-save-tax':
+	check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
+
+	if ( ! current_user_can('manage_categories') )
+		die( __('Cheatin&amp;#8217; uh?') );
+
+	if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
+		die(-1);
+
+	switch ($_POST['tax_type']) {
+		case 'cat' :
+			$data = array();
+			$data['cat_ID'] = $id;
+			$data['cat_name'] = $_POST['name'];
+			$data['category_nicename'] = $_POST['slug'];
+			if ( isset($_POST['parent']) &amp;&amp; (int) $_POST['parent'] &gt; 0 )
+				$data['category_parent'] = $_POST['parent'];
+
+			$cat = get_category($id, ARRAY_A);
+			$data['category_description'] = $cat['category_description'];
+
+			$updated = wp_update_category($data);
+
+			if ( $updated &amp;&amp; !is_wp_error($updated) )
+				echo _cat_row( $updated, 0 );
+			else
+				die( __('Category not updated.') );
+
+			break;
+		case 'link-cat' :
+			$updated = wp_update_term($id, 'link_category', $_POST);
+
+			if ( $updated &amp;&amp; !is_wp_error($updated) )
+				echo link_cat_row($updated['term_id']);
+			else
+				die( __('Category not updated.') );
+
+			break;
+		case 'tag' :
+			$updated = wp_update_term($id, 'post_tag', $_POST);
+			if ( $updated &amp;&amp; !is_wp_error($updated) ) {
+				$tag = get_term( $updated['term_id'], 'post_tag' );
+				if ( !$tag || is_wp_error( $tag ) )
+					die( __('Tag not updated.') );
+
+				echo _tag_row($tag);
+			} else {
+				die( __('Tag not updated.') );
+			}
+
+			break;
+	}
+
+	exit;
+	break;
+case 'meta-box-order':
+	check_ajax_referer( 'meta-box-order' );
+	update_user_option( $GLOBALS['current_user']-&gt;ID, &quot;meta-box-order_$_POST[page]&quot;, $_POST['order'] );
+	die('1');
+	break;
+case 'find_posts':
+	check_ajax_referer( 'find-posts' );
+
+	if ( empty($_POST['ps']) )
+		exit;
+
+	$what = isset($_POST['pages']) ? 'page' : 'post';
+	$s = stripslashes($_POST['ps']);
+	preg_match_all('/&quot;.*?(&quot;|$)|((?&lt;=[\\s&quot;,+])|^)[^\\s&quot;,+]+/', $s, $matches);
+	$search_terms = array_map(create_function('$a', 'return trim($a, &quot;\\&quot;\'\\n\\r &quot;);'), $matches[0]);
+
+	$searchand = $search = '';
+	foreach( (array) $search_terms as $term) {
+		$term = addslashes_gpc($term);
+		$search .= &quot;{$searchand}(($wpdb-&gt;posts.post_title LIKE '%{$term}%') OR ($wpdb-&gt;posts.post_content LIKE '%{$term}%'))&quot;;
+		$searchand = ' AND ';
+	}
+	$term = $wpdb-&gt;escape($s);
+	if ( count($search_terms) &gt; 1 &amp;&amp; $search_terms[0] != $s )
+		$search .= &quot; OR ($wpdb-&gt;posts.post_title LIKE '%{$term}%') OR ($wpdb-&gt;posts.post_content LIKE '%{$term}%')&quot;;
+
+	$posts = $wpdb-&gt;get_results( &quot;SELECT ID, post_title, post_status, post_date FROM $wpdb-&gt;posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50&quot; );
+
+	if ( ! $posts )
+		exit( __('No posts found.') );
+
+	$html = '&lt;table class=&quot;widefat&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th class=&quot;found-radio&quot;&gt;&lt;br /&gt;&lt;/th&gt;&lt;th&gt;'.__('Title').'&lt;/th&gt;&lt;th&gt;'.__('Time').'&lt;/th&gt;&lt;th&gt;'.__('Status').'&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;';
+	foreach ( $posts as $post ) {
+
+		switch ( $post-&gt;post_status ) {
+			case 'publish' :
+			case 'private' :
+				$stat = __('Published');
+				break;
+			case 'future' :
+				$stat = __('Scheduled');
+				break;
+			case 'pending' :
+				$stat = __('Pending Review');
+				break;
+			case 'draft' :
+				$stat = __('Unpublished');
+				break;
+		}
+
+		if ( '0000-00-00 00:00:00' == $post-&gt;post_date ) {
+			$time = '';
+		} else {
+			$time = mysql2date(__('Y/m/d'), $post-&gt;post_date);
+		}
+
+		$html .= '&lt;tr class=&quot;found-posts&quot;&gt;&lt;td class=&quot;found-radio&quot;&gt;&lt;input type=&quot;radio&quot; id=&quot;found-'.$post-&gt;ID.'&quot; name=&quot;found_post_id&quot; value=&quot;'.$post-&gt;ID.'&quot;&gt;&lt;/td&gt;';
+		$html .= '&lt;td&gt;&lt;label for=&quot;found-'.$post-&gt;ID.'&quot;&gt;'.wp_specialchars($post-&gt;post_title, true).'&lt;/label&gt;&lt;/td&gt;&lt;td&gt;'.wp_specialchars($time, true).'&lt;/td&gt;&lt;td&gt;'.wp_specialchars($stat, true).'&lt;/td&gt;&lt;/tr&gt;'.&quot;\n\n&quot;;
+	}
+	$html .= '&lt;/tbody&gt;&lt;/table&gt;';
+
+	$x = new WP_Ajax_Response();
+	$x-&gt;add( array(
+		'what' =&gt; $what,
+		'data' =&gt; $html
+	));
+	$x-&gt;send();
+
+	break;
 default :
 	do_action( 'wp_ajax_' . $_POST['action'] );
 	die('0');</diff>
      <filename>wp-admin/admin-ajax.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,28 @@
-&lt;/div&gt;&lt;!-- wpbody --&gt;
-&lt;/div&gt;&lt;!-- wpcontent --&gt;
+&lt;?php
+/**
+ * WordPress Administration Template Footer
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+?&gt;
+
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- wpbody-content --&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- wpbody --&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- wpcontent --&gt;
 &lt;/div&gt;&lt;!-- wpwrap --&gt;
+
 &lt;div id=&quot;footer&quot;&gt;
-&lt;p&gt;&lt;?php
-do_action('in_admin_footer', '');
+&lt;p id=&quot;footer-left&quot; class=&quot;alignleft&quot;&gt;&lt;?php
+do_action( 'in_admin_footer' );
 $upgrade = apply_filters( 'update_footer', '' );
-echo __('Thank you for creating with &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;').' | '.__('&lt;a href=&quot;http://codex.wordpress.org/&quot;&gt;Documentation&lt;/a&gt;').' | '.__('&lt;a href=&quot;http://wordpress.org/support/forum/4&quot;&gt;Feedback&lt;/a&gt;').' '.$upgrade;
-?&gt;&lt;/p&gt;
+echo '&lt;span id=&quot;footer-thankyou&quot;&gt;' . __('Thank you for creating with &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;.').'&lt;/span&gt; | '.__('&lt;a href=&quot;http://codex.wordpress.org/&quot;&gt;Documentation&lt;/a&gt;').' | '.__('&lt;a href=&quot;http://wordpress.org/support/forum/4&quot;&gt;Feedback&lt;/a&gt;'); ?&gt;
+&lt;/p&gt;
+&lt;?php // if ( $is_IE ) browse_happy(); ?&gt;
+&lt;p id=&quot;footer-upgrade&quot; class=&quot;alignright&quot;&gt;&lt;?php echo $upgrade; ?&gt;&lt;/p&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;?php do_action('admin_footer', ''); ?&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;if(typeof wpOnload=='function')wpOnload();&lt;/script&gt;
 &lt;/body&gt;
-&lt;/html&gt;
+&lt;/html&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/admin-footer.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,16 @@
 &lt;?php
-// Deprecated.  Use includes/admin.php.
+/**
+ * Administration Functions
+ *
+ * This file is deprecated, use 'wp-admin/includes/admin.php' instead.
+ *
+ * @deprecated 2.5
+ * @package WordPress
+ * @subpackage Administration
+ */
+
 _deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/admin.php' );
+
+/** WordPress Administration API: Includes all Administration functions. */
 require_once(ABSPATH . 'wp-admin/includes/admin.php');
-?&gt;
+?&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/admin-functions.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,33 +1,23 @@
 &lt;?php
+/**
+ * WordPress Administration Template Header
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
 if (!isset($_GET[&quot;page&quot;])) require_once('admin.php');
-if ( $editing ) {
-	if ( user_can_richedit() )
-		wp_enqueue_script( 'wp_tiny_mce' );
-}
-wp_enqueue_script( 'wp-gears' );
-
-$min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' );
-$the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
-$ie6_no_scrollbar = true;
-
-function add_minwidth($c) {
-	return $c . 'minwidth ';
-}
-
-if ( in_array( $the_current_page, $min_width_pages ) ) {
-		$ie6_no_scrollbar = false;
-		add_filter( 'admin_body_class', 'add_minwidth' );
-}
 
 get_admin_page_title();
-
+$title = wp_specialchars( strip_tags( $title ) );
+wp_user_settings();
 ?&gt;
 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php do_action('admin_xml_ns'); ?&gt; &lt;?php language_attributes(); ?&gt;&gt;
 &lt;head&gt;
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;&lt;?php bloginfo('html_type'); ?&gt;; charset=&lt;?php echo get_option('blog_charset'); ?&gt;&quot; /&gt;
-&lt;title&gt;&lt;?php bloginfo('name') ?&gt; &amp;rsaquo; &lt;?php echo wp_specialchars( strip_tags( $title ) ); ?&gt; &amp;#8212; WordPress&lt;/title&gt;
+&lt;title&gt;&lt;?php bloginfo('name') ?&gt; &amp;rsaquo; &lt;?php echo $title; ?&gt; &amp;#8212; WordPress&lt;/title&gt;
 &lt;?php
 
 wp_admin_css( 'css/global' );
@@ -39,94 +29,104 @@ wp_admin_css( 'css/ie' );
 &lt;script type=&quot;text/javascript&quot;&gt;
 //&lt;![CDATA[
 addLoadEvent = function(func) {if (typeof jQuery != &quot;undefined&quot;) jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
+
+function convertEntities(o) {
+	var c = function(s) {
+		if (/&amp;[^;]+;/.test(s)) {
+			var e = document.createElement(&quot;div&quot;);
+			e.innerHTML = s;
+			return !e.firstChild ? s : e.firstChild.nodeValue;
+		}
+		return s;
+	}
+
+	if ( typeof o === 'string' )
+		return c(o);
+	else if ( typeof o === 'object' )
+		for (var v in o) {
+			if ( typeof o[v] === 'string' )
+				o[v] = c(o[v]);
+		}
+	return o;
+};
 //]]&gt;
 &lt;/script&gt;
-&lt;?php if ( ($parent_file != 'link-manager.php') &amp;&amp; ($parent_file != 'options-general.php') &amp;&amp; $ie6_no_scrollbar ) : ?&gt;
-&lt;style type=&quot;text/css&quot;&gt;* html { overflow-x: hidden; }&lt;/style&gt;
-&lt;?php endif;
+&lt;?php
 
-$hook_suffixes = array();
+if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php', 'page-new.php') ) ) {
+	add_action( 'admin_head', 'wp_tiny_mce' );
+}
 
+$hook_suffix = '';
 if ( isset($page_hook) )
-	$hook_suffixes[] = &quot;-$page_hook&quot;;
+	$hook_suffix = &quot;$page_hook&quot;;
 else if ( isset($plugin_page) )
-	$hook_suffixes[] = &quot;-$plugin_page&quot;;
+	$hook_suffix = &quot;$plugin_page&quot;;
 else if ( isset($pagenow) )
-	$hook_suffixes[] = &quot;-$pagenow&quot;;
-
-$hook_suffixes[] = '';
+	$hook_suffix = &quot;$pagenow&quot;;
 
-foreach ( $hook_suffixes as $hook_suffix )
-	do_action(&quot;admin_print_styles$hook_suffix&quot;); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' );
-foreach ( $hook_suffixes as $hook_suffix )
-	do_action(&quot;admin_print_scripts$hook_suffix&quot;); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' );
-foreach ( $hook_suffixes as $hook_suffix )
-	do_action(&quot;admin_head$hook_suffix&quot;); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' );
-unset($hook_suffixes, $hook_suffix);
+do_action(&quot;admin_print_styles-$hook_suffix&quot;);
+do_action('admin_print_styles');
+do_action(&quot;admin_print_scripts-$hook_suffix&quot;);
+do_action('admin_print_scripts');
+do_action(&quot;admin_head-$hook_suffix&quot;);
+do_action('admin_head');
 
-?&gt;
+if ( $is_iphone ) { ?&gt;
+&lt;style type=&quot;text/css&quot;&gt;.row-actions{visibility:visible;}&lt;/style&gt;
+&lt;?php } ?&gt;
 &lt;/head&gt;
 &lt;body class=&quot;wp-admin &lt;?php echo apply_filters( 'admin_body_class', '' ); ?&gt;&quot;&gt;
+
 &lt;div id=&quot;wpwrap&quot;&gt;
 &lt;div id=&quot;wpcontent&quot;&gt;
 &lt;div id=&quot;wphead&quot;&gt;
-&lt;h1&gt;&lt;?php if ( '' == get_bloginfo('name', 'display') ) echo '&amp;nbsp;'; else echo get_bloginfo('name', 'display'); ?&gt;&lt;span id=&quot;viewsite&quot;&gt;&lt;a href=&quot;&lt;?php echo trailingslashit( get_option('home') ); ?&gt;&quot;&gt;&lt;?php _e('Visit Site') ?&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;
-&lt;/div&gt;
-
 &lt;?php
-if ( ! $is_opera ) { 
+$blog_name = get_bloginfo('name', 'display');
+if ( '' == $blog_name ) {
+	$blog_name = '&amp;nbsp;';
+} else {
+	$blog_name_excerpt = wp_html_excerpt($blog_name, 40);
+	if ( $blog_name != $blog_name_excerpt )
+		$blog_name_excerpt = trim($blog_name_excerpt) . '&amp;hellip;';
+	$blog_name = $blog_name_excerpt;
+}
+$title_class = '';
+if ( function_exists('mb_strlen') ) {
+	if ( mb_strlen($blog_name, 'UTF-8') &gt; 30 )
+		$title_class = 'class=&quot;long-title&quot;';
+} else {
+	if ( strlen($blog_name) &gt; 30 )
+		$title_class = 'class=&quot;long-title&quot;';
+}
 ?&gt;
-	&lt;div id=&quot;gears-info-box&quot; class=&quot;info-box&quot; style=&quot;display:none;&quot;&gt;
-	&lt;img src=&quot;images/gear.png&quot; title=&quot;Gear&quot; alt=&quot;&quot; class=&quot;gears-img&quot; /&gt;
-	&lt;div id=&quot;gears-msg1&quot;&gt;
-	&lt;h3 class=&quot;info-box-title&quot;&gt;&lt;?php _e('Speed up WordPress'); ?&gt;&lt;/h3&gt;
-	&lt;p&gt;&lt;?php _e('WordPress now has support for Gears, which adds new features to your web browser.'); ?&gt;&lt;br /&gt;
-	&lt;a href=&quot;http://gears.google.com/&quot; target=&quot;_blank&quot; style=&quot;font-weight:normal;&quot;&gt;&lt;?php _e('More information...'); ?&gt;&lt;/a&gt;&lt;/p&gt;
-	&lt;p&gt;&lt;?php _e('After you install and enable Gears most of WordPress&amp;#8217; images, scripts, and CSS files will be stored locally on your computer. This speeds up page load time.'); ?&gt;&lt;/p&gt;
-	&lt;p&gt;&lt;strong&gt;&lt;?php _e('Don&amp;#8217;t install on a public or shared computer.'); ?&gt;&lt;/strong&gt;&lt;/p&gt;	&lt;div class=&quot;submit&quot;&gt;&lt;button onclick=&quot;window.location = 'http://gears.google.com/?action=install&amp;amp;return=&lt;?php echo urlencode( admin_url() ); ?&gt;';&quot; class=&quot;button&quot;&gt;&lt;?php _e('Install Now'); ?&gt;&lt;/button&gt;
-	&lt;button class=&quot;button&quot; style=&quot;margin-left:10px;&quot; onclick=&quot;document.getElementById('gears-info-box').style.display='none';&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/button&gt;&lt;/div&gt;
-	&lt;/div&gt;
-
-	&lt;div id=&quot;gears-msg2&quot; style=&quot;display:none;&quot;&gt;
-	&lt;h3 class=&quot;info-box-title&quot;&gt;&lt;?php _e('Gears Status'); ?&gt;&lt;/h3&gt;
-	&lt;p&gt;&lt;?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?&gt;&lt;/p&gt; 
-	&lt;p&gt;&lt;?php 
-	
-	if ( $is_safari )
-		_e('To enable it, make sure this web site is not on the denied list in Gears Settings under the Safari menu, then click the button below.');
-	else
-		_e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser Tools menu, then click the button below.'); 
-	
-	?&gt;&lt;/p&gt;
-	&lt;p&gt;&lt;strong&gt;&lt;?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?&gt;&lt;/strong&gt;&lt;/p&gt;
-	&lt;div class=&quot;submit&quot;&gt;&lt;button class=&quot;button&quot; onclick=&quot;wpGears.getPermission();&quot;&gt;&lt;?php _e('Enable Gears'); ?&gt;&lt;/button&gt;
-	&lt;button class=&quot;button&quot; style=&quot;margin-left:10px;&quot; onclick=&quot;document.getElementById('gears-info-box').style.display='none';&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/button&gt;&lt;/div&gt;
-	&lt;/div&gt;
-
-	&lt;div id=&quot;gears-msg3&quot; style=&quot;display:none;&quot;&gt;
-	&lt;h3 class=&quot;info-box-title&quot;&gt;&lt;?php _e('Gears Status'); ?&gt;&lt;/h3&gt;
-	&lt;p&gt;&lt;?php
-	
-	if ( $is_safari )
-		_e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.');
-	else
-		_e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); 
-	
-	?&gt;&lt;/p&gt;
-	&lt;p&gt;&lt;?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?&gt;&lt;/p&gt;
-	&lt;p&gt;&lt;?php _e('Local storage status:'); ?&gt; &lt;span id=&quot;gears-wait&quot;&gt;&lt;span style=&quot;color:#f00;&quot;&gt;&lt;?php _e('Please wait! Updating files:'); ?&gt;&lt;/span&gt; &lt;span id=&quot;gears-upd-number&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
-	&lt;div class=&quot;submit&quot;&gt;&lt;button class=&quot;button&quot; onclick=&quot;document.getElementById('gears-info-box').style.display='none';&quot;&gt;&lt;?php _e('Close'); ?&gt;&lt;/button&gt;&lt;/div&gt;
-	&lt;/div&gt;
-	&lt;/div&gt;
+
+&lt;img id=&quot;header-logo&quot; src=&quot;../wp-includes/images/blank.gif&quot; alt=&quot;&quot; width=&quot;32&quot; height=&quot;32&quot; /&gt; &lt;h1 &lt;?php echo $title_class ?&gt;&gt;&lt;a href=&quot;&lt;?php echo trailingslashit( get_bloginfo('url') ); ?&gt;&quot; title=&quot;&lt;?php _e('Visit site') ?&gt;&quot;&gt;&lt;?php echo $blog_name ?&gt; &lt;span&gt;&amp;larr; &lt;?php _e('Visit site') ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;
+
+&lt;div id=&quot;wphead-info&quot;&gt;
+&lt;div id=&quot;user_info&quot;&gt;
+&lt;p&gt;&lt;?php printf(__('Howdy, &lt;a href=&quot;%1$s&quot; title=&quot;Edit your profile&quot;&gt;%2$s&lt;/a&gt;'), 'profile.php', $user_identity) ?&gt;
+&lt;?php if ( ! $is_opera ) { ?&gt;&lt;span class=&quot;turbo-nag hidden&quot;&gt; | &lt;a href=&quot;tools.php&quot;&gt;&lt;?php _e('Turbo') ?&gt;&lt;/a&gt;&lt;/span&gt;&lt;?php } ?&gt; |
+&lt;a href=&quot;&lt;?php echo wp_logout_url() ?&gt;&quot; title=&quot;&lt;?php _e('Log Out') ?&gt;&quot;&gt;&lt;?php _e('Log Out'); ?&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;?php favorite_actions(); ?&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;?php if ( get_user_setting('mfold') == 'f' ) { ?&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;jQuery('#wpcontent').addClass('folded');&lt;/script&gt;
 &lt;?php } ?&gt;
 
-&lt;div id=&quot;user_info&quot;&gt;&lt;p&gt;&lt;?php printf(__('Howdy, &lt;a href=&quot;%1$s&quot;&gt;%2$s&lt;/a&gt;!'), 'profile.php', $user_identity) ?&gt; | &lt;a href=&quot;&lt;?php echo site_url('wp-login.php?action=logout', 'login') ?&gt;&quot; title=&quot;&lt;?php _e('Log Out') ?&gt;&quot;&gt;&lt;?php _e('Log Out'); ?&gt;&lt;/a&gt; | &lt;?php _e('&lt;a href=&quot;http://codex.wordpress.org/&quot;&gt;Help&lt;/a&gt;') ?&gt; | &lt;?php _e('&lt;a href=&quot;http://wordpress.org/support/&quot;&gt;Forums&lt;/a&gt;'); if ( ! $is_opera ) { ?&gt; | &lt;span id=&quot;gears-menu&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;wpGears.message(1);return false;&quot;&gt;&lt;?php _e('Turbo') ?&gt;&lt;/a&gt;&lt;/span&gt;&lt;?php } ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;div id=&quot;wpbody&quot;&gt;
+&lt;?php require(ABSPATH . 'wp-admin/menu-header.php'); ?&gt;
 
+&lt;div id=&quot;wpbody-content&quot;&gt;
 &lt;?php
-require(ABSPATH . 'wp-admin/menu-header.php');
+screen_meta($hook_suffix);
+
+do_action('admin_notices');
 
 if ( $parent_file == 'options-general.php' ) {
 	require(ABSPATH . 'wp-admin/options-head.php');
 }
-?&gt;
-&lt;div id=&quot;wpbody&quot;&gt;</diff>
      <filename>wp-admin/admin-header.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
 &lt;?php
-define('WP_ADMIN', TRUE);
+/**
+ * WordPress Administration Generic POST Handler.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** We are located in WordPress Administration Panels */
+define('WP_ADMIN', true);
 
 if ( defined('ABSPATH') )
 	require_once(ABSPATH . 'wp-load.php');</diff>
      <filename>wp-admin/admin-post.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,16 @@
 &lt;?php
+/**
+ * WordPress Administration Bootstrap
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * In WordPress Administration Panels
+ *
+ * @since unknown
+ */
 define('WP_ADMIN', TRUE);
 
 if ( defined('ABSPATH') )
@@ -26,8 +38,8 @@ $time_format = get_option('time_format');
 
 wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
 
-wp_admin_css_color('classic', __('Classic'), admin_url(&quot;css/colors-classic.css&quot;), array('#07273E', '#14568A', '#D54E21', '#2683AE'));
-wp_admin_css_color('fresh', __('Fresh'), admin_url(&quot;css/colors-fresh.css&quot;), array('#464646', '#CEE1EF', '#D54E21', '#2683AE'));
+wp_admin_css_color('classic', __('Blue'), admin_url(&quot;css/colors-classic.css&quot;), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
+wp_admin_css_color('fresh', __('Gray'), admin_url(&quot;css/colors-fresh.css&quot;), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));
 
 wp_enqueue_script( 'common' );
 wp_enqueue_script( 'jquery-color' );
@@ -45,7 +57,14 @@ do_action('admin_init');
 
 // Handle plugin admin pages.
 if (isset($plugin_page)) {
-	$page_hook = get_plugin_page_hook($plugin_page, $pagenow);
+	if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) ) {
+		$page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
+		// backwards compatibility for plugins using add_management_page
+		if ( empty( $page_hook ) &amp;&amp; 'edit.php' == $pagenow &amp;&amp; '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
+			wp_redirect('tools.php?page=' . $plugin_page);
+			exit;
+		}
+	}
 
 	if ( $page_hook ) {
 		do_action('load-' . $page_hook);
@@ -84,7 +103,7 @@ if (isset($plugin_page)) {
 	}
 
 	// Allow plugins to define importers as well
-	if (! is_callable($wp_importers[$importer][2]))
+	if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]))
 	{
 		if (! file_exists(ABSPATH . &quot;wp-admin/import/$importer.php&quot;))
 		{
@@ -93,7 +112,7 @@ if (isset($plugin_page)) {
 		include(ABSPATH . &quot;wp-admin/import/$importer.php&quot;);
 	}
 
-	$parent_file = 'edit.php';
+	$parent_file = 'tools.php';
 	$submenu_file = 'import.php';
 	$title = __('Import');
 
@@ -108,6 +127,10 @@ if (isset($plugin_page)) {
 
 	include(ABSPATH . 'wp-admin/admin-footer.php');
 
+	// Make sure rules are flushed
+	global $wp_rewrite;
+	$wp_rewrite-&gt;flush_rules();
+
 	exit();
 } else {
 	do_action(&quot;load-$pagenow&quot;);</diff>
      <filename>wp-admin/admin.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,10 @@
 &lt;?php
-
-/* This accepts file uploads from swfupload or other asynchronous upload methods.
-
-*/
+/**
+ * Accepts file uploads from swfupload or other asynchronous upload methods.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
 if ( defined('ABSPATH') )
 	require_once(ABSPATH . 'wp-load.php');
@@ -22,9 +24,14 @@ header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
 if ( !current_user_can('upload_files') )
 	wp_die(__('You do not have permission to upload files.'));
 
-// just fetch the detail form for that attachment	
-if ( ($id = intval($_REQUEST['attachment_id'])) &amp;&amp; $_REQUEST['fetch'] ) {
-	echo get_media_item($id);
+// just fetch the detail form for that attachment
+if ( isset($_REQUEST['attachment_id']) &amp;&amp; ($id = intval($_REQUEST['attachment_id'])) &amp;&amp; $_REQUEST['fetch'] ) {
+	if ( 2 == $_REQUEST['fetch'] ) {
+		add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
+		echo get_media_item($id, array( 'send' =&gt; false, 'delete' =&gt; false ));
+	} else {
+		echo get_media_item($id);
+	}
 	exit;
 }
 
@@ -46,4 +53,4 @@ else {
 	echo apply_filters(&quot;async_upload_{$type}&quot;, $id);
 }
 
-?&gt;
+?&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/async-upload.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,19 @@
 &lt;?php
+/**
+ * Categories Management Panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
 require_once('admin.php');
 
 $title = __('Categories');
-$parent_file = 'edit.php';
 
-wp_reset_vars(array('action', 'cat'));
+wp_reset_vars( array('action', 'cat') );
 
-if ( isset($_GET['deleteit']) &amp;&amp; isset($_GET['delete']) )
+if ( isset( $_GET['action'] ) &amp;&amp; isset($_GET['delete']) &amp;&amp; ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) )
 	$action = 'bulk-delete';
 
 switch($action) {
@@ -63,7 +70,6 @@ case 'bulk-delete':
 	}
 
 	$sendback = wp_get_referer();
-	$sendback = preg_replace('|[^a-z0-9-~+_.?#=&amp;;,/:]|i', '', $sendback);
 
 	wp_redirect($sendback);
 	exit();
@@ -71,6 +77,8 @@ case 'bulk-delete':
 break;
 case 'edit':
 
+	$title = __('Edit Category');
+
 	require_once ('admin-header.php');
 	$cat_ID = (int) $_GET['cat_ID'];
 	$category = get_category_to_edit($cat_ID);
@@ -85,23 +93,32 @@ case 'editedcat':
 	if ( !current_user_can('manage_categories') )
 		wp_die(__('Cheatin&amp;#8217; uh?'));
 
+	$location = 'categories.php';
+	if ( $referer = wp_get_original_referer() ) {
+		if ( false !== strpos($referer, 'categories.php') )
+			$location = $referer;
+	}
+
 	if ( wp_update_category($_POST) )
-		wp_redirect('categories.php?message=3');
+		$location = add_query_arg('message', 3, $location);
 	else
-		wp_redirect('categories.php?message=5');
+		$location = add_query_arg('message', 5, $location);
+
+	wp_redirect($location);
 
 	exit;
 break;
 
 default:
 
-if ( !empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+if ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
+	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
 	 exit;
 }
 
-wp_enqueue_script( 'admin-categories' );
-wp_enqueue_script('admin-forms');
+wp_enqueue_script('admin-categories');
+if ( current_user_can('manage_categories') )
+	wp_enqueue_script('inline-edit-tax');
 
 require_once ('admin-header.php');
 
@@ -112,39 +129,47 @@ $messages[4] = __('Category not added.');
 $messages[5] = __('Category not updated.');
 ?&gt;
 
-&lt;?php if (isset($_GET['message'])) : ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&quot;wrap nosubsub&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title );
+if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
+	printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', wp_specialchars( stripslashes($_GET['s']) ) ); ?&gt;
+&lt;/h2&gt;
+
+&lt;?php
+if ( isset($_GET['message']) &amp;&amp; ( $msg = (int) $_GET['message'] ) ) : ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$msg]; ?&gt;&lt;/p&gt;&lt;/div&gt;
 &lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
 endif; ?&gt;
 
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
-&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
-	&lt;h2&gt;&lt;?php printf(__('Manage Categories (&lt;a href=&quot;%s&quot;&gt;add new&lt;/a&gt;)'), '#addcat') ?&gt; &lt;/h2&gt;
-&lt;?php else : ?&gt;
-	&lt;h2&gt;&lt;?php _e('Manage Categories') ?&gt; &lt;/h2&gt;
-&lt;?php endif; ?&gt;
-
-&lt;p id=&quot;post-search&quot;&gt;
-	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e('Search Categories'); ?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php echo attribute_escape(stripslashes($_GET['s'])); ?&gt;&quot; /&gt;
+&lt;form class=&quot;search-form topmargin&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
+&lt;p class=&quot;search-box&quot;&gt;
+	&lt;label class=&quot;hidden&quot; for=&quot;category-search-input&quot;&gt;&lt;?php _e('Search Categories'); ?&gt;:&lt;/label&gt;
+	&lt;input type=&quot;text&quot; class=&quot;search-input&quot; id=&quot;category-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php _admin_search_query(); ?&gt;&quot; /&gt;
 	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Categories' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
 &lt;/p&gt;
-
+&lt;/form&gt;
 &lt;br class=&quot;clear&quot; /&gt;
 
+&lt;div id=&quot;col-container&quot;&gt;
+
+&lt;div id=&quot;col-right&quot;&gt;
+&lt;div class=&quot;col-wrap&quot;&gt;
+&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
 &lt;div class=&quot;tablenav&quot;&gt;
 
 &lt;?php
-$pagenum = absint( $_GET['pagenum'] );
+$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
 if ( empty($pagenum) )
 	$pagenum = 1;
-if( !$catsperpage || $catsperpage &lt; 0 )
+if( ! isset( $catsperpage ) || $catsperpage &lt; 0 )
 	$catsperpage = 20;
 
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; ceil(wp_count_terms('category') / $catsperpage),
 	'current' =&gt; $pagenum
 ));
@@ -153,56 +178,135 @@ if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
 
-&lt;div class=&quot;alignleft&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Delete'); ?&gt;&quot; name=&quot;deleteit&quot; class=&quot;button-secondary delete&quot; /&gt;
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action&quot;&gt;
+&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
 &lt;?php wp_nonce_field('bulk-categories'); ?&gt;
 &lt;/div&gt;
 
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;table class=&quot;widefat fixed&quot; cellspacing=&quot;0&quot;&gt;
 	&lt;thead&gt;
 	&lt;tr&gt;
-		&lt;th scope=&quot;col&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Description') ?&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot; class=&quot;num&quot;&gt;&lt;?php _e('Posts') ?&gt;&lt;/th&gt;
+&lt;?php print_column_headers('categories'); ?&gt;
 	&lt;/tr&gt;
 	&lt;/thead&gt;
+
+	&lt;tfoot&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('categories', false); ?&gt;
+	&lt;/tr&gt;
+	&lt;/tfoot&gt;
+
 	&lt;tbody id=&quot;the-list&quot; class=&quot;list:cat&quot;&gt;
 &lt;?php
 cat_rows(0, 0, 0, $pagenum, $catsperpage);
 ?&gt;
 	&lt;/tbody&gt;
 &lt;/table&gt;
-&lt;/form&gt;
 
 &lt;div class=&quot;tablenav&quot;&gt;
-
 &lt;?php
 if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
+
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action2&quot;&gt;
+&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
+&lt;?php wp_nonce_field('bulk-categories'); ?&gt;
 &lt;/div&gt;
-&lt;br class=&quot;clear&quot; /&gt;
 
+&lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
 
-&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
-&lt;div class=&quot;wrap&quot;&gt;
+&lt;/form&gt;
+
+&lt;div class=&quot;form-wrap&quot;&gt;
 &lt;p&gt;&lt;?php printf(__('&lt;strong&gt;Note:&lt;/strong&gt;&lt;br /&gt;Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category &lt;strong&gt;%s&lt;/strong&gt;.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?&gt;&lt;/p&gt;
 &lt;p&gt;&lt;?php printf(__('Categories can be selectively converted to tags using the &lt;a href=&quot;%s&quot;&gt;category to tag converter&lt;/a&gt;.'), 'admin.php?import=wp-cat2tag') ?&gt;&lt;/p&gt;
 &lt;/div&gt;
 
-&lt;?php include('edit-category-form.php'); ?&gt;
+&lt;/div&gt;
+&lt;/div&gt;&lt;!-- /col-right --&gt;
+
+&lt;div id=&quot;col-left&quot;&gt;
+&lt;div class=&quot;col-wrap&quot;&gt;
+
+&lt;?php if ( current_user_can('manage_categories') ) { ?&gt;
+&lt;?php $category = (object) array(); $category-&gt;parent = 0; do_action('add_category_form_pre', $category); ?&gt;
+
+&lt;div class=&quot;form-wrap&quot;&gt;
+&lt;h3&gt;&lt;?php _e('Add Category'); ?&gt;&lt;/h3&gt;
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
+&lt;form name=&quot;addcat&quot; id=&quot;addcat&quot; method=&quot;post&quot; action=&quot;categories.php&quot; class=&quot;add:the-list: validate&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;addcat&quot; /&gt;
+&lt;?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-category'); ?&gt;
+
+&lt;div class=&quot;form-field form-required&quot;&gt;
+	&lt;label for=&quot;cat_name&quot;&gt;&lt;?php _e('Category Name') ?&gt;&lt;/label&gt;
+	&lt;input name=&quot;cat_name&quot; id=&quot;cat_name&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;40&quot; aria-required=&quot;true&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;form-field&quot;&gt;
+	&lt;label for=&quot;category_nicename&quot;&gt;&lt;?php _e('Category Slug') ?&gt;&lt;/label&gt;
+	&lt;input name=&quot;category_nicename&quot; id=&quot;category_nicename&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;40&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('The &amp;#8220;slug&amp;#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;form-field&quot;&gt;
+	&lt;label for=&quot;category_parent&quot;&gt;&lt;?php _e('Category Parent') ?&gt;&lt;/label&gt;
+	&lt;?php wp_dropdown_categories(array('hide_empty' =&gt; 0, 'name' =&gt; 'category_parent', 'orderby' =&gt; 'name', 'selected' =&gt; $category-&gt;parent, 'hierarchical' =&gt; true, 'show_option_none' =&gt; __('None'))); ?&gt;
+    &lt;p&gt;&lt;?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;form-field&quot;&gt;
+	&lt;label for=&quot;category_description&quot;&gt;&lt;?php _e('Description') ?&gt;&lt;/label&gt;
+	&lt;textarea name=&quot;category_description&quot; id=&quot;category_description&quot; rows=&quot;5&quot; cols=&quot;40&quot;&gt;&lt;/textarea&gt;
+    &lt;p&gt;&lt;?php _e('The description is not prominent by default, however some themes may show it.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Add Category'); ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;?php do_action('edit_category_form', $category); ?&gt;
+&lt;/form&gt;&lt;/div&gt;
 
-&lt;?php endif; ?&gt;
+&lt;?php } ?&gt;
+
+&lt;/div&gt;
+&lt;/div&gt;&lt;!-- /col-left --&gt;
+
+&lt;/div&gt;&lt;!-- /col-container --&gt;
+&lt;/div&gt;&lt;!-- /wrap --&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+(function($){
+	$(document).ready(function(){
+		$('#doaction, #doaction2').click(function(){
+			if ( $('select[name^=&quot;action&quot;]').val() == 'delete' ) {
+				var m = '&lt;?php echo js_escape(__(&quot;You are about to delete the selected categories.\n  'Cancel' to stop, 'OK' to delete.&quot;)); ?&gt;';
+				return showNotice.warn(m);
+			}
+		});
+	});
+})(jQuery);
+/* ]]&gt; */
+&lt;/script&gt;
 
 &lt;?php
+inline_edit_term_row('categories');
+
 break;
 }
 </diff>
      <filename>wp-admin/categories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,12 @@
 &lt;?php
+/**
+ * Comment Management Panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
 require_once('admin.php');
 
 $parent_file = 'edit-comments.php';
@@ -9,7 +17,12 @@ wp_reset_vars( array('action') );
 if ( isset( $_POST['deletecomment'] ) )
 	$action = 'deletecomment';
 
-function comment_footer_die( $msg ) {  // $msg is assumed to contain HTML and be sanitized
+/**
+ * Display error message at bottom of comments.
+ *
+ * @param string $msg Error Message. Assumed to contain HTML and be sanitized.
+ */
+function comment_footer_die( $msg ) {  //
 	echo &quot;&lt;div class='wrap'&gt;&lt;p&gt;$msg&lt;/p&gt;&lt;/div&gt;&quot;;
 	include('admin-footer.php');
 	die;
@@ -21,7 +34,6 @@ case 'editcomment' :
 	$title = __('Edit Comment');
 
 	wp_enqueue_script('comment');
-
 	require_once('admin-header.php');
 
 	$comment_id = absint( $_GET['c'] );
@@ -111,7 +123,7 @@ if ( 'spam' == $_GET['dt'] ) {
 &lt;/tr&gt;
 &lt;?php } ?&gt;
 &lt;tr&gt;
-&lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;?php _e('Comment'); ?&gt;&lt;/th&gt;
+&lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;?php echo _c('Comment|noun'); ?&gt;&lt;/th&gt;
 &lt;td&gt;&lt;?php echo $comment-&gt;comment_content; ?&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/table&gt;
@@ -171,7 +183,7 @@ case 'unapprovecomment' :
 	if ( '' != wp_get_referer() &amp;&amp; false == $noredir )
 		wp_redirect( wp_get_referer() );
 	else
-		wp_redirect( admin_url('edit.php?p=' . absint( $comment-&gt;comment_post_ID ) . '#comments') );
+		wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment-&gt;comment_post_ID ) . '#comments') );
 
 	exit();
 	break;
@@ -196,7 +208,7 @@ case 'approvecomment' :
 	if ( '' != wp_get_referer() &amp;&amp; false == $noredir )
 		wp_redirect( wp_get_referer() );
 	else
-		wp_redirect( admin_url('edit.php?p=' . absint( $comment-&gt;comment_post_ID ) . '#comments') );
+		wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment-&gt;comment_post_ID ) . '#comments') );
 
 	exit();
 	break;
@@ -210,7 +222,7 @@ case 'editedcomment' :
 
 	edit_comment();
 
-	$location = ( empty( $_POST['referredby'] ) ? &quot;edit.php?p=$comment_post_id&quot; : $_POST['referredby'] ) . '#comment-' . $comment_id;
+	$location = ( empty( $_POST['referredby'] ) ? &quot;edit-comments.php?p=$comment_post_id&quot; : $_POST['referredby'] ) . '#comment-' . $comment_id;
 	$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
 	wp_redirect( $location );
 
@@ -225,4 +237,4 @@ default:
 
 include('admin-footer.php');
 
-?&gt;
+?&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/comment.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,80 @@
-.post-com-count {
-}
-#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
-	background-image: url(../images/comment-stalk-rtl.gif);
-	background-position:right bottom;
-}
-#footer {
-	background-position:99% 10px;
-}
-#poststuff .closed .togbox, #poststuff .togbox {
-	background-image: url(../images/toggle-arrow-rtl.gif) !important;
-}
 .bar {
 	border-right-color: transparent;
 	border-left-color: #99d;
 }
+
 .plugins .togl {
 	border-right-color: transparent;
 	border-left-color: #ccc;
 }
+
+.post-com-count {
+	background-image: url(../images/bubble_bg-rtl.gif);
+}
+.tablenav .tablenav-pages a {
+	background: #eee url('../images/menu-bits-rtl.gif') repeat-x scroll right -379px;
+}
 #upload-menu li.current {
 	border-right-color: transparent;
 	border-left-color: #448abd;
 }
+
+#adminmenu .wp-submenu .current a.current {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll  right -289px;
+}
+
+#adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
+}
+
+.folded #adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-menu-toggle,
+#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+	background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -207px;
+}
+
+#adminmenu .wp-has-current-submenu ul li a.current {
+	background: url(../images/menu-dark-rtl.gif) top right no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu .menu-top .current {
+	background: url(../images/menu-bits-rtl.gif) top right repeat-x;
+}
+
+#adminmenu li.wp-has-current-submenu ul li a {
+	background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat right -207px;
+}
+
+#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
+#adminmenu .wp-menu-open .wp-menu-toggle {
+	background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -109px;
+}
+
+#adminmenu a.wp-has-submenu {
+	background: #f1f1f1 url(../images/menu-bits-rtl.gif) repeat-x scroll right -379px;
+}
+
+#adminmenu .wp-submenu a {
+	background: #FFFFFF url(../images/menu-bits-rtl.gif) no-repeat scroll right -310px;
+}
+
+#adminmenu li.current a,
+#adminmenu .wp-submenu a:hover {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll  right -289px;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-submenu {
+	background: #b5b5b5 url(../images/menu-bits-rtl.gif) repeat-x scroll right top;
+}
+
+.meta-box-sortables .postbox:hover .handlediv {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -111px;
+}</diff>
      <filename>wp-admin/css/colors-classic-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,27 @@
+html {
+	background-color: #F5FCFD;
+}
+
+.find-box-search {
+	border-color: #dfdfdf;
+	background-color: #f1f1f1;
+}
+
+.find-box {
+	background-color: #f1f1f1;
+}
+
+.find-box-inside {
+	background-color: #fff;
+}
+
 a.page-numbers:hover {
 	border-color: #999;
 }
 
-body, .form-table .pre {
-	background-color: #fff;
+body,
+#wpbody,
+.form-table .pre {
 	color: #333;
 }
 
@@ -11,51 +29,118 @@ body &gt; #upload-menu {
 	border-bottom-color: #fff;
 }
 
-div#current-widgets, #postcustomstuff table, #your-profile fieldset, a.page-numbers, #rightnow, div.dashboard-widget, .widefat {
+kbd, code {
+	background: #eaeaea;
+}
+
+div#current-widgets,
+#postcustomstuff table,
+#your-profile fieldset,
+#rightnow,
+div.dashboard-widget,
+#dashboard-widgets p.dashboard-widget-links,
+#replyrow #ed_reply_toolbar input {
 	border-color: #ccc;
 }
 
+#poststuff .inside label.spam {
+	color: red;
+}
+
+#poststuff .inside label.waiting {
+	color: orange;
+}
+
+#poststuff .inside label.approved {
+	color: green;
+}
+
+#postcustomstuff table {
+	border-color: #dfdfdf;
+	background-color: #F9F9F9;
+}
+
+#postcustomstuff thead th {
+	background-color: #F1F1F1;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table textarea {
+	border-color: #dfdfdf;
+	background-color: #fff;
+}
+
+.widefat {
+	border-color: #BBD8E7;
+	background-color: #fff;
+}
+
 div.dashboard-widget-error {
 	background-color: #c43;
 }
 
 div.dashboard-widget-notice {
-	background-color: #F0F6FB;
+	background-color: #cfe1ef;
 }
 
-div.dashboard-widget-submit, ul.widget-control-list div.widget-control-actions {
+div.dashboard-widget-submit,
+ul.widget-control-list div.widget-control-actions {
 	border-top-color: #ccc;
 }
 
-input.disabled, textarea.disabled {
-	background-color: #ccc;
+div.ui-tabs-panel {
+	border-color: #f1f1f1;
+}
+
+ul#category-tabs li.ui-tabs-selected {
+	background-color: #f1f1f1;
 }
 
-#user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a,
+input.disabled,
+textarea.disabled {
+	background-color: #ccc;
+}
+/* #upload-menu li a.upload-tab-link, */
+li.widget-list-control-item h4.widget-title a:hover,
+li.widget-list-control-item h4.widget-title a,
 #dragHelper li.widget-list-control-item h4.widget-title a,
-#draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover {
+#draghelper li.widget-list-control-item h4.widget-title a:visited,
+.login #backtoblog a:hover,
+#plugin-information .action-button a,
+#plugin-information .action-button a:hover,
+#plugin-information .action-button a:visited {
 	color: #fff;
 }
 
-ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
-	background-color: #cfebf7;
+li.widget-list-control-item div.widget-control {
+	background-color: #fff;
+	border-color: #dfdfdf;
 }
 
-div.ui-tabs-panel {
-	border-color: #cfebf7;
+.metabox-holder .postbox h3,
+#poststuff .postbox h3,
+#poststuff .stuffbox h3 {
+	background: #dfdfdf url(&quot;../images/blue-grad.png&quot;) repeat-x left top;
+	text-shadow: #fff 0 1px 0;
+}
+
+.form-table th,
+.form-wrap label {
+	color: #222;
+	text-shadow: #fff 0 1px 0;
+}
+
+.setting-description, .form-wrap p {
+	color: #666;
 }
 
 select {
 	background-color: #fff;
-	border-color: #ddd;
+	border-color: #8CBDD5;
 }
 
 strong .post-com-count span {
-	background-color: #2583ad;
-}
-
-.button-secondary, #login form .submit input {
-	background-color: #8ebddc !important;
+	background-color: #21759b;
 }
 
 ul#widget-list li.widget-list-item h4.widget-title {
@@ -67,10 +152,14 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	background-color: #ccf3fa;
 }
 
-.ac_match, .subsubsub a.current, h2 {
+.ac_match, .subsubsub a.current {
 	color: #000;
 }
 
+.wrap h2 {
+	color: #093E56;
+}
+
 .ac_over {
 	background-color: #f0f0b8;
 }
@@ -84,13 +173,13 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #101010;
 }
 
-.alternate {
-	background-color: #f9f9f9;
+.alternate, .alt {
+	background-color: #EDFBFC;
 }
 
 .available-theme a.screenshot {
 	background-color: #f1f1f1;
-	border-color: #ccc;
+	border-color: #ddd;
 }
 
 .bar {
@@ -98,8 +187,11 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	border-right-color: #99d;
 }
 
-.describe {
-	border-top-color: #d0d0d0;
+#media-upload {
+	background: #fff;
+}
+#media-upload .slidetoggle {
+	border-top-color: #dfdfdf;
 }
 
 .error, #login #login_error {
@@ -119,44 +211,45 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	border-color: #c00 !important;
 }
 
-.form-table input, .form-table textarea {
-	border-color: #c6d9e9;
-}
-
-.form-table td, .form-table th {
-	border-bottom-color: #fff;
+.form-table input,
+.form-table textarea,
+.search-input,
+.form-field input,
+.form-field textarea,
+.submit {
+	border-color: #8CBDD5;
 }
 
 .highlight {
-	background-color: #cfebf7;
+	background-color: #e4f2fd;
 	color: #d54e21;
 }
 
-.howto, .nonessential, #sidemenu, #edit-slug-box, .form-input-tip, #dashboard_primary span.rss-date, .subsubsub, #dashboard_secondary div.dashboard-widget-content ul li a cite {
-	color: #999;
-}
-
-#dashmenu a, #user_info a {
-	color: #88b4d7;
+.howto,
+.nonessential,
+#edit-slug-box,
+.form-input-tip,
+.rss-widget span.rss-date,
+.subsubsub {
+	color: #666;
 }
 
 .media-item {
-	border-bottom-color: #d0d0d0;
+	border-bottom-color: #dfdfdf;
 }
 
-.media-upload-form label.form-help, td.help {
-	color: #9a9a9a;
+#wpbody-content #media-items .describe {
+	border-top-color: #dfdfdf;
 }
 
-.page-numbers {
-	background-color: #fff;
-	border-color: #fff;
+.describe input[type=&quot;text&quot;],
+.describe textarea {
+	border-color: #dfdfdf;
 }
 
-.page-numbers.current {
-	background-color: #328ab2;
-	border-color: #328ab2;
-	color: #fff;
+.media-upload-form label.form-help,
+td.help {
+	color: #9a9a9a;
 }
 
 .post-com-count {
@@ -186,46 +279,100 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #666;
 }
 
-.submit input, .button, .button-secondary, #login form .submit input, div.dashboard-widget-submit input, #edit-slug-buttons a.save {
-	background-color: #e5e5e5;
-	color: #07273e;
-	border-color: #a3a3a3;
+.button,
+.button-secondary,
+.submit input,
+input[type=button],
+input[type=submit] {
+	border-color: #8CBDD5;
+	color: #093E56;
 }
 
-.button[disabled], .button:disabled {
-	background-color: #999;
+.button:hover,
+.button-secondary:hover,
+.submit input:hover,
+input[type=button]:hover,
+input[type=submit]:hover {
+	color: #000;
+	border-color: #21759B;
 }
 
-.tablenav .button-secondary {
-	border-color: #5396c5;
+.button,
+.submit input,
+.button-secondary {
+	background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
 }
 
-.submit input:hover, .button:hover, #edit-slug-buttons a.save:hover {
-	border-color: #535353;
+.button:active,
+.submit input:active,
+.button-secondary:active {
+	background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
 }
 
-.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.del-link:hover {
+.button-primary,
+.submit .button-primary,
+#login form .submit input {
+	border-color: #298cba !important;
+	font-weight: bold;
+	color: #FFF !important;
+	background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
+}
+
+.button-primary:active,
+#login form .submit input:active {
+	background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top !important;
+}
+
+.button[disabled],
+.button:disabled,
+.button-secondary[disabled],
+.button-secondary:disabled,
+a.button.disabled {
+	color: #ccc !important;
+	border-color: #ccc;
+}
+
+.button-primary[disabled],
+.button-primary:disabled {
+	color: #2fa0d5 !important;
+}
+
+a:active,
+a:focus {
 	color: #d54e21;
 }
 
-#adminmenu a:hover, #sidemenu a:hover, .ui-tabs-nav a:hover {
-	color: #97c4d8;
+a:hover,
+#wphead #viewsite a:hover,
+#adminmenu a:hover,
+#adminmenu ul.wp-submenu a:hover,
+#the-comment-list .comment a:hover,
+#rightnow a:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover,
+#login form .submit input:hover,
+div.dashboard-widget-submit input:hover,
+#media-upload a.del-link:hover,
+.ui-tabs-nav a:hover {
+	color: #d54e21;
 }
 
-.button-secondary:hover, #login form .submit input:hover {
-	border-color: #328ab2;
-	background-color: #a6d2e5 !important;
+#the-comment-list .comment-item,
+#dashboard-widgets #dashboard_quick_press form p.submit {
+	border-color: #dfdfdf;
 }
 
-.submitbox #autosave .error, ul.view-switch li.current a {
-	color: #333;
+.button-primary:hover,
+#login form .submit input:hover {
+	border-color: #13455b !important;
+	color: #EAF2FA !important;
 }
 
-.submitbox #previewview {
-	background-color: #5488af;
+#side-info-column #category-tabs .ui-tabs-selected a {
+	color: #333;
 }
 
-.submitbox #previewview a, #rightnow .rbutton {
+#rightnow .rbutton {
 	background-color: #ebebeb;
 	color: #264761;
 }
@@ -235,8 +382,9 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #ccc;
 }
 
-.submitbox .submitdelete {
-	border-bottom-color: #999;
+.submitbox .submitdelete, a.delete {
+	color: #f00;
+	border-bottom-color: #f00;
 }
 
 .submitbox .submitdelete:hover,
@@ -246,94 +394,136 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	border-bottom-color: #f00;
 }
 
+#normal-sortables .submitbox .submitdelete:hover {
+	color: #000;
+	background-color: #f00;
+	border-bottom-color: #f00;
+}
+
 .tablenav .dots {
-	background-color: #cfebf7;
-	border-color: #cfebf7;
+	border-color: transparent;
 }
 
-.tablenav .next, .tablenav .prev{
-	background-color: #cfebf7;
-	border-bottom-color: #cfebf7;
-	border-color: #cfebf7;
-	color: #2583ad;
+.tablenav .next,
+.tablenav .prev {
+	border-color: transparent;
+	color: #21759b;
 }
 
-.tablenav .next:hover, .tablenav .prev:hover {
-	border-bottom-color: #d54e21;
-	border-color: #cfebf7;
+.tablenav .next:hover,
+.tablenav .prev:hover {
+	border-color: transparent;
 	color: #d54e21;
 }
 
-.updated, .login #login_error, .login .message {
+.updated,
+.login #login_error,
+.login .message {
 	background-color: #ffffe0;
 	border-color: #e6db55;
 }
 
-.updated a {
-	border-bottom-color: #2583ad;
+a.page-numbers {
+	border-bottom-color: #B8D3E2;
 }
 
-.widefat td, .widefat th, div#available-widgets-filter, ul#widget-list li.widget-list-item, .commentlist li {
+div#available-widgets-filter,
+ul#widget-list li.widget-list-item,
+.commentlist li {
 	border-bottom-color: #ccc;
 }
 
-.widefat thead, .thead {
-	background-color: #464646;
-	color: #d7d7d7;
+.widefat td,
+.widefat th {
+	border-bottom-color: #BBD8E7;
 }
 
-.widget-control-save, .widget-control-remove {
-	background-color: #83b4d5;
-	color: #246;
+.widefat th {
+	text-shadow: rgba(255,255,255,0.8) 0 1px 0;
 }
 
-.wrap h2 {
-	border-bottom-color: #dadada;
-	color: #5a5a5a;
+.widefat thead tr th,
+.widefat tfoot tr th,
+h3.dashboard-widget-title,
+h3.dashboard-widget-title span,
+h3.dashboard-widget-title small,
+.find-box-head {
+	color: #333;
+	background: #dfdfdf url(../images/blue-grad.png) repeat-x scroll left top;
 }
 
-#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, a {
-	color: #2e7ca0;
+h3.dashboard-widget-title small a {
+	color: #d7d7d7;
 }
 
-#adminmenu a, .ui-tabs-nav a {
-	color: #cfebf6;
+h3.dashboard-widget-title small a:hover {
+	color: #fff;
 }
 
-#submenu a {
-	color: #2782af
+#adminmenu a,
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML,
+#the-comment-list p.comment-author strong a,
+#media-upload a.del-link,
+#media-upload a.delete,
+.ui-tabs-nav a, a {
+	color: #1C6280;
 }
+
 /* Because we don't want visited on these links */
-#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
+body.press-this .ui-tabs-selected a,
+body.press-this .ui-tabs-selected a:hover {
 	background-color: #fff;
-	border-color: #07273e;
+	border-color: #c6d9e9;
 	border-bottom-color: #fff;
 	color: #d54e21;
-	font-weight: bold;
 }
 
-#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
-	background-image: url(../images/comment-stalk-classic.gif);
-}
-
-#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span {
+#adminmenu #awaiting-mod,
+#adminmenu .update-plugins,
+#sidemenu a .update-plugins,
+#rightnow .reallynow,
+#plugin-information .action-button {
 	background-color: #d54e21;
 	color: #fff;
 }
 
-#rightnow .reallynow {
-	background-color: #114973;
+#adminmenu li a:hover #awaiting-mod,
+#adminmenu li a:hover .update-plugins,
+#sidemenu li a:hover .update-plugins {
+	background-color: #264761;
 	color: #fff;
 }
 
+#adminmenu li.current a #awaiting-mod,
+#adminmenu li.current a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins {
+	background-color: #ddd;
+	color: #000;
+	text-shadow: none;
+	-moz-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+	-khtml-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+	-webkit-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+	box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+}
+
+#adminmenu li.current a:hover #awaiting-mod,
+#adminmenu li.current a:hover .update-plugins,
+#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,
+#adminmenu li.wp-has-current-submenu a:hover .update-plugins {
+	background-color: #264761;
+	color: #fff;
+}
 
-#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
-	background-color: #07273E;
+div#media-upload-header {
+	background-color: #f9f9f9;
+	border-bottom-color: #dfdfdf;
 }
 
-#adminmenu, div#media-upload-header {
-	background-color: #14568a;
-	border-bottom-color: #07273e;
+div#plugin-information-header {
+	background-color: #e4f2fd;
+	border-bottom-color: #c6d9e9;
 }
 
 #currenttheme img {
@@ -348,75 +538,83 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	background-color: #f9f9f9;
 }
 
-input.readonly {
+input.readonly, textarea.readonly {
 	background-color: #ddd;
 }
 
-#dashmenu a.current {
-	background-color: #14568a;
-	color: #cfebf6;
-}
-
-#dragHelper h4.widget-title, li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 {
+#dragHelper h4.widget-title,
+li.widget-list-control-item h4,
+#dragHelper li.widget-list-control-item h4 {
 	background-color: #2683ae;
 	color: #fff;
 }
 
-#ed_toolbar input {
-	background: url( ../images/fade-butt.png ) #fff repeat-x 0 -2px;
+#ed_toolbar input,
+#ed_reply_toolbar input {
+	background: #fff url(&quot;../images/fade-butt.png&quot;) repeat-x 0 -2px;
 }
 
 #editable-post-name {
 	background-color: #fffbcc;
 }
 
-#edit-slug-box strong, .login #nav a {
+#edit-slug-box strong,
+.tablenav .displaying-num,
+#submitted-on {
 	color: #777;
 }
 
-#edit-slug-buttons a.save {
-	background-color: #ebebeb;
+.login #nav a {
+	color: #21759b !important;
+}
+
+.login #nav a:hover {
+	color: #d54e21 !important;
 }
 
-#footer {
-	background: url(../images/logo-ghost.png) #464646 no-repeat 20px 10px;
+#footer,
+#footer-upgrade {
+	background: #073447;
 	color: #999;
 }
 
 #media-items {
-	border-color: #c0c0c0;
+	border-color: #dfdfdf;
 }
 
 #pass-strength-result {
-	background-color: #e3e3e3;
-	border-color: #000;
+	background-color: #eee;
+	border-color: #ddd !important;
 }
 
 #pass-strength-result.bad {
-	background-color: #ffeff7;
-	border-color: #c69;
+	background-color: #ffb78c;
+	border-color: #ff853c !important;
 }
 
 #pass-strength-result.good {
-	background-color: #effff4;
-	border-color: #66cc87;
+	background-color: #ffec8b;
+	border-color: #fc0 !important;
 }
 
 #pass-strength-result.short {
-	background-color: #e3e3e3;
+	background-color: #ffa0a0;
+	border-color: #f04040 !important;
 }
 
 #pass-strength-result.strong {
-	background-color: #59ef86;
-	border-color: #319f52;
+	background-color: #c3ff88;
+	border-color: #8dff1c !important;
 }
 
-.checkbox, .side-info, #your-profile #rich_editing {
+.checkbox,
+.side-info,
+#your-profile #rich_editing {
 	background-color: #fff;
 }
 
 .plugins .active {
-	background-color: #BBEEBB;
+	background-color: #e7f7d3;
 }
 
 .plugins .togl {
@@ -427,29 +625,49 @@ input.readonly {
 	background-color: #ffffe0;
 }
 
+#the-comment-list .approve a {
+	color: #006505;
+}
+
+#the-comment-list .unapprove a {
+	color: #d98500;
+}
+
+#the-comment-list .delete a {
+	color: #bc0b0b;
+}
+
 .plugins tr {
 	background-color: #fff;
 }
 
-#poststuff #editor-toolbar .active {
-	background-color: #83b4d5;
-	color: #333;
+.metabox-holder .postbox,
+#poststuff .postbox,
+#titlediv,
+#poststuff .postarea,
+#poststuff .stuffbox,
+.postbox input[type=&quot;text&quot;],
+.postbox textarea,
+.stuffbox input[type=&quot;text&quot;],
+.stuffbox textarea {
+	border-color: #BBD8E7;
 }
 
-#poststuff .closed .togbox {
-	background-color: #2583ad;
-	background-image: url(../images/toggle-arrow.gif);
+.metabox-holder .postbox,
+#poststuff .postbox {
+	background-color: #FFF;
 }
 
-#poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox {
-	border-color: #ebebeb;
-	border-right-color: #ccc;
-	border-bottom-color: #ccc;
+.ui-sortable .postbox h3 {
+	color: #093E56;
 }
 
-#poststuff .togbox {
-	background-color: #b2b2b2;
-	background-image: url(../images/toggle-arrow.gif);
+.ui-sortable .postbox h3:hover {
+	color: #000;
+}
+
+.curtime #timestamp {
+	background-image: url(../images/date-button.gif);
 }
 
 #quicktags #ed_link {
@@ -464,26 +682,16 @@ input.readonly {
 	color: #448abd;
 }
 
-#sidemenu a {
-	background-color: #14568a;
-	border-bottom-color: #07273e;
-	border-top-color: #14568a;
-	color: #cfebf6;
-}
-
-#tagchecklist span a {
+#tagchecklist span a,
+#bulk-titles div a {
 	background: url(../images/xit.gif) no-repeat;
 }
 
-#tagchecklist span a:hover {
+#tagchecklist span a:hover,
+#bulk-titles div a:hover {
 	background: url(../images/xit.gif) no-repeat -10px 0;
 }
 
-#the-comment-list .comment a {
-	border-bottom-color: #ababab;
-	color: #666;
-}
-
 #update-nag, .plugin-update {
 	background-color: #fffeeb;
 	border-bottom-color: #ccc;
@@ -491,159 +699,185 @@ input.readonly {
 	color: #555;
 }
 
-#upload-files a.file-link {
-	background-color: #d1e2ef;
+.login #backtoblog a {
+	color: #ccc;
 }
 
-#upload-file-view a img {
-	border-bottom-color: #69c;
+#wphead {
+	background-color: #073447;
 }
 
-#upload-menu li #current-tab-nav, #upload-file {
-	background-color: #f9fcfe;
+body.login {
+	border-top-color: #093E56;
 }
 
-#upload-menu li span a.page-numbers {
-	color: #00019b;
+#wphead h1 a {
+	color: #fff;
 }
 
-#upload-menu li.current {
-	border-right-color: #448abd;
-	color: #000;
+#login form input {
+	color: #555;
 }
 
-#upload-menu li.current a.upload-tab-link, #upload-menu li a:hover {
-	background-color: #f9fcfe;
-	color: #000;
+#wphead h1 a:hover {
+	text-decoration: underline;
 }
 
-#upload-menu, #upload-menu li {
-	border-top-color: #247fab;
+#user_info {
+	color: #999;
 }
 
-#user_info, .login #backtoblog a {
+#user_info a:link, #user_info a:visited, #footer a:link, #footer a:visited {
 	color: #ccc;
+	text-decoration: none;
 }
 
-#wphead {
-	background-color: #14568a;
+#user_info a:hover, #footer a:hover {
+	color: #fff;
+	text-decoration: underline !important;
 }
 
-#wphead, body.login {
-	border-top-color: #07273e;
+#user_info a:active, #footer a:active {
+	color: #ccc !important;
 }
 
-#wphead #viewsite a {
-	background-color: #5488af;
-	color: #cfebf7;
-	border-color: #0b3d64;
+div#media-upload-error,
+.file-error,
+abbr.required,
+.widget-control-remove:hover,
+.delete a:hover {
+	color: #f00;
 }
 
-#wphead #viewsite a:hover {
-	color: #07273e;
+#media-upload a.delete {
+	color: #888;
 }
 
-#wphead h1, #dashmenu a.current:hover {
-	color: #cfebf6;
+/* editors */
+#quicktags {
+	border-color: #dfdfdf;
+	background-color: #dfdfdf;
 }
 
-div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover, .delete:hover {
-	color: #f00;
+#ed_toolbar input {
+	border-color: #C3C3C3;
+}
+
+#ed_toolbar input:hover {
+	border-color: #aaa;
+	background: #ddd;
+}
+
+#poststuff .wp_themeSkin .mceStatusbar {
+	border-color: #EDEDED;
+}
+
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+	background-color: #f1f1f1;
+	border-color: #dfdfdf;
+	color: #999;
+}
+
+#poststuff #editor-toolbar .active {
+	border-bottom-color: #e9e9e9;
+	background-color: #e9e9e9;
+	color: #333;
 }
 
 /* TinyMCE */
+#post-status-info {
+	background-color: #EDEDED;
+}
+
 .wp_themeSkin *,
-.wp_themeSkin a:hover, 
-.wp_themeSkin a:link, 
-.wp_themeSkin a:visited, 
+.wp_themeSkin a:hover,
+.wp_themeSkin a:link,
+.wp_themeSkin a:visited,
 .wp_themeSkin a:active {
 	 color: #000;
 }
 
 /* Containers */
-.wp_themeSkin table, #wp_editbtns {
-	background: #83B4D5;
-}
-
 .wp_themeSkin iframe {
 	background: #fff;
 }
 
 /* Layout */
 .wp_themeSkin .mceStatusbar {
-	 color:#000;
-	 background-color: #eaf3fa;
+	color: #000;
+	background-color: #f5f5f5;
 }
 
 /* Button */
-.wp_themeSkin .mceButton { 
+.wp_themeSkin .mceButton {
 	background-color: #e9e8e8;
-	border-color: #83B4D5;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin a.mceButtonEnabled:hover,
-.wp_themeSkin a.mceButtonActive, 
+.wp_themeSkin a.mceButtonActive,
 .wp_themeSkin a.mceButtonSelected {
-	background-color: #d6d8da;
-	border-color: #7789ba !important;
+	background-color: #d5d5d5;
+	border-color: #777 !important;
 }
 
 .wp_themeSkin .mceButtonDisabled {
-	border-color: #83B4D5 !important;
+	border-color: #ccc !important;
 }
 
 /* ListBox */
 .wp_themeSkin .mceListBox .mceText,
 .wp_themeSkin .mceListBox .mceOpen  {
-	border-color: #83B4D5;
-	background-color: #e9e8e8;
+	border-color: #B2B2B2;
+	background-color: #d5d5d5;
 }
 
-.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 
+.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,
 .wp_themeSkin .mceListBoxHover .mceOpen,
 .wp_themeSkin .mceListBoxSelected .mceOpen,
 .wp_themeSkin .mceListBoxSelected .mceText {
-	border-color: #7789ba !important;
-	background-color: #d6d8da;
+	border-color: #777 !important;
+	background-color: #d5d5d5;
 }
 
-.wp_themeSkin table.mceListBoxEnabled:hover .mceText, 
+.wp_themeSkin table.mceListBoxEnabled:hover .mceText,
 .wp_themeSkin .mceListBoxHover .mceText {
-	border-color: #7789ba !important;
+	border-color: #777 !important;
 }
 
 .wp_themeSkin select.mceListBox {
-	border-color: #b3c7e1; 
+	border-color: #B2B2B2;
 	background-color: #fff;
 }
 
 /* SplitButton */
-.wp_themeSkin .mceSplitButton a.mceAction, 
+.wp_themeSkin .mceSplitButton a.mceAction,
 .wp_themeSkin .mceSplitButton a.mceOpen {
-	background-color: #e9e8e8;
-	border-color: #83B4D5;
+	background-color: #e8e8e8;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin .mceSplitButton a.mceOpen:hover,
 .wp_themeSkin .mceSplitButtonSelected a.mceOpen,
 .wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
 .wp_themeSkin .mceSplitButton a.mceAction:hover {
-	background-color: #d6d8da;
-	border-color: #7789ba !important;
-} 
+	background-color: #d5d5d5;
+	border-color: #777 !important;
+}
 
 .wp_themeSkin .mceSplitButtonActive {
-	background-color: #d6d8da;
+	background-color: #B2B2B2;
 }
 
 /* ColorSplitButton */
 .wp_themeSkin div.mceColorSplitMenu table {
-	background-color: #ebeaeb;
-	border-color: #808080;
+	background-color: #ebebeb;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin .mceColorSplitMenu a {
-	border-color: #808080;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
@@ -669,18 +903,18 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
 }
 
 .wp_themeSkin .mceMenu .mceText {
-	color: #000; 
+	color: #000;
 }
 
 .wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
-.wp_themeSkin .mceMenu .mceMenuItemActive, #quicktags {
-	background-color: #83B4D5;
+.wp_themeSkin .mceMenu .mceMenuItemActive {
+	background-color: #f5f5f5;
 }
 .wp_themeSkin td.mceMenuItemSeparator {
 	background-color: #aaa;
 }
 .wp_themeSkin .mceMenuItemTitle a {
-	background-color: #ccc; 
+	background-color: #ccc;
 	border-bottom-color: #aaa;
 }
 .wp_themeSkin .mceMenuItemTitle span.mceText {
@@ -690,23 +924,80 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
 	color: #888;
 }
 
-/* pop-up */
-.clearlooks2 .mceTop .mceLeft, .clearlooks2 .mceTop .mceRight {
-	background-color: #cee1ef;
-	border-color: #c6d9e9;
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+	background-color: #dfdfdf;
+	border-color: #dfdfdf;
 }
 
-.clearlooks2 .mceFocus .mceTop .mceLeft, .clearlooks2 .mceFocus .mceTop .mceRight {
-	background-color: #5488AF;
-	border-color: #464646;
+.wp-admin #mceModalBlocker {
+	background: #000;
 }
 
-#editorcontainer {
-	border-color: #ccc;
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
+	background: #444444;
+	border-left: 1px solid #999;
+	border-top: 1px solid #999;
+	-moz-border-radius: 4px 0 0 0;
+	-webkit-border-top-left-radius: 4px;
+	-khtml-border-top-left-radius: 4px;
+	border-top-left-radius: 4px;
 }
 
-#poststuff #titlewrap {
-	border-color: #ccc;
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
+	background: #444444;
+	border-right: 1px solid #999;
+	border-top: 1px solid #999;
+	border-top-right-radius: 4px;
+	-khtml-border-top-right-radius: 4px;
+	-webkit-border-top-right-radius: 4px;
+	-moz-border-radius: 0 4px 0 0;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceLeft {
+	background: #f1f1f1;
+	border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceRight {
+	background: #f1f1f1;
+	border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceLeft {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+	border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceCenter {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceRight {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+	border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop span {
+	color: #e5e5e5;
+}
+/* end TinyMCE */
+
+#editorcontainer,
+#post-status-info,
+#titlediv #title {
+	border-color: #dfdfdf;
+}
+
+#titlediv #title {
+	background-color: #fff;
 }
 
 #tTips p#tTips_inside {
@@ -714,8 +1005,223 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
 	color: #333;
 }
 
-/* Diff */
+#timestampdiv input,
+#namediv input,
+#tagsdiv #the-tagcloud {
+	border-color: #ddd;
+}
+
+/* menu */
+#adminmenu * {
+	border-color: #BBD8E7;
+}
+
+#adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
+}
+
+.folded #adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
+}
 
+#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
+#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;
+}
+
+#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
+#adminmenu .wp-menu-open .wp-menu-toggle {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
+}
+
+#adminmenu a.menu-top {
+	background: #EAF3FA url(../images/menu-bits.gif) repeat-x scroll left -379px;
+}
+
+#adminmenu .wp-submenu a {
+	background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;
+}
+
+#adminmenu .wp-has-current-submenu ul li a {
+	background: none;
+}
+
+#adminmenu .wp-has-current-submenu ul li a.current {
+	background: url(../images/menu-dark.gif) top left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu .menu-top .current {
+	background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x;
+	border-color: #6d6d6d;
+	color: #fff;
+	text-shadow: rgba(0,0,0,0.4) 0px -1px 0px;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-submenu,
+#adminmenu li.wp-has-current-submenu ul li a {
+	border-color: #aaa !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul li a {
+	background: url(../images/menu-dark.gif) bottom left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul {
+	border-bottom-color: #aaa;
+}
+
+#adminmenu li.menu-top .current:hover {
+	border-color: #B5B5B5;
+}
+
+#adminmenu .wp-submenu .current a.current {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll  0 -289px;
+}
+
+#adminmenu .wp-submenu a:hover {
+	background-color: #EAF2FA !important;
+	color: #333 !important;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover {
+	color: #333;
+	background-color: #f5f5f5;
+	background-image: none;
+	border-color: #e3e3e3;
+	text-shadow: rgba(255,255,255,1) 0px 1px 0px;
+}
+
+#adminmenu .wp-submenu ul {
+	background-color: #fff;
+}
+
+.folded #adminmenu li.menu-top,
+#adminmenu .wp-submenu .wp-submenu-head {
+	background-color: #EAF2FA;
+}
+
+.folded #adminmenu li.wp-has-current-submenu,
+.folded #adminmenu li.menu-top.current {
+	background-color: #BBD8E7;
+}
+
+#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
+	background-color: #BBD8E7;
+	border-color: #8CBDD5;
+}
+
+#adminmenu div.wp-submenu {
+	background-color: transparent;
+}
+
+/* menu icons */
+#adminmenu #menu-dashboard div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -61px -33px;
+}
+
+#adminmenu #menu-dashboard:hover div.wp-menu-image,
+#adminmenu  #menu-dashboard.wp-has-current-submenu div.wp-menu-image,
+#adminmenu  #menu-dashboard.current div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -61px -1px;
+}
+
+#adminmenu #menu-posts div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -272px -33px;
+}
+
+#adminmenu #menu-posts:hover div.wp-menu-image,
+#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -272px -1px;
+}
+
+#adminmenu #menu-media div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -121px -33px;
+}
+
+#adminmenu #menu-media:hover div.wp-menu-image,
+#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -121px -1px;
+}
+
+#adminmenu #menu-links div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -91px -33px;
+}
+
+#adminmenu #menu-links:hover div.wp-menu-image,
+#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -91px -1px;
+}
+
+#adminmenu #menu-pages div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -151px -33px;
+}
+
+#adminmenu #menu-pages:hover div.wp-menu-image,
+#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -151px -1px;
+}
+
+#adminmenu #menu-comments div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -31px -33px;
+}
+
+#adminmenu #menu-comments:hover div.wp-menu-image,
+#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,
+#adminmenu #menu-comments.current div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -31px -1px;
+}
+
+#adminmenu #menu-appearance div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -1px -33px;
+}
+
+#adminmenu #menu-appearance:hover div.wp-menu-image,
+#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -1px -1px;
+}
+
+#adminmenu #menu-plugins div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -181px -33px;
+}
+
+#adminmenu #menu-plugins:hover div.wp-menu-image,
+#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -181px -1px;
+}
+
+#adminmenu #menu-users div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -301px -33px;
+}
+
+#adminmenu #menu-users:hover div.wp-menu-image,
+#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -301px -1px;
+}
+
+#adminmenu #menu-tools div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -211px -33px;
+}
+
+#adminmenu #menu-tools:hover div.wp-menu-image,
+#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -211px -1px;
+}
+
+#adminmenu #menu-settings div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -241px -33px;
+}
+
+#adminmenu #menu-settings:hover div.wp-menu-image,
+#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu-vs.png&quot;) no-repeat scroll -241px -1px;
+}
+/* end menu */
+
+
+/* Diff */
 table.diff .diff-deletedline {
 	background-color: #ffdddd;
 }
@@ -728,3 +1234,344 @@ table.diff .diff-addedline {
 table.diff .diff-addedline ins {
 	background-color: #99ff99;
 }
+
+#att-info {
+	background-color: #E4F2FD;
+}
+
+/* edit image */
+#sidemenu a {
+	background-color: #f9f9f9;
+	border-color: #f9f9f9;
+	border-bottom-color: #dfdfdf;
+}
+
+#sidemenu a.current {
+	background-color: #fff;
+	border-color: #dfdfdf #dfdfdf #fff;
+	color: #D54E21;
+}
+
+
+#screen-options-wrap,
+#contextual-help-wrap {
+	background-color: #f1f1f1;
+	border-color: #dfdfdf;
+}
+
+#screen-meta-links a.show-settings {
+	color: #606060;
+}
+
+#screen-meta-links a.show-settings:hover {
+	color: #000;
+}
+
+#replysubmit {
+	background-color: #f1f1f1;
+	border-top-color: #ddd;
+}
+
+#replyerror {
+	border-color: #ddd;
+	background-color: #f9f9f9;
+}
+
+#edithead,
+#replyhead {
+	background-color: #f1f1f1;
+}
+
+#ed_reply_toolbar {
+	background-color: #e9e9e9;
+}
+
+/* table vim shortcuts */
+.vim-current {
+	background-color: #E4F2FD !important;
+}
+
+/* Install Plugins */
+.star-average,
+.star.star-rating {
+	background-color: #fc0;
+}
+
+div.star.select:hover {
+	background-color: #d00;
+}
+
+#plugin-information .fyi ul {
+	background-color: #eaf3fa;
+}
+
+#plugin-information .fyi h2.mainheader {
+	background-color: #cee1ef;
+}
+
+#plugin-information pre,
+#plugin-information code {
+	background-color: #ededff;
+}
+
+#plugin-information pre {
+	border: 1px solid #ccc;
+}
+
+/* inline editor */
+.inline-edit-row fieldset input[type=&quot;text&quot;],
+.inline-edit-row fieldset textarea,
+#bulk-titles,
+#replyrow input {
+	border-color: #ddd;
+}
+
+.inline-editor div.title {
+	background-color: #EAF3FA;
+}
+
+.inline-editor ul.cat-checklist {
+	background-color: #FFFFFF;
+	border-color: #ddd;
+}
+
+.inline-edit-row p.submit {
+	background-color: #f1f1f1;
+}
+
+.inline-editor .categories .catshow,
+.inline-editor .categories .cathide {
+	color: #21759b;
+}
+
+.inline-editor .quick-edit-save {
+	background-color: #f1f1f1;
+}
+
+#replyrow #ed_reply_toolbar input:hover {
+	border-color: #aaa;
+	background: #ddd;
+}
+
+fieldset.inline-edit-col-right .inline-edit-col {
+	border-color: #dfdfdf;
+}
+
+.attention {
+	color: #D54E21;
+}
+
+.meta-box-sortables .postbox:hover .handlediv {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;
+}
+
+#major-publishing-actions {
+	background: #eaf2fa;
+}
+
+.tablenav .tablenav-pages {
+	color: #555;
+}
+
+.tablenav .tablenav-pages a {
+	border-color: #e3e3e3;
+	background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px;
+}
+
+.tablenav .tablenav-pages a:hover {
+	color: #d54e21;
+	border-color: #d54321;
+}
+
+.tablenav .tablenav-pages a:active {
+	color: #fff !important;
+}
+
+.tablenav .tablenav-pages .current {
+	background: #dfdfdf;
+	border-color: #d3d3d3;
+}
+
+#availablethemes,
+#availablethemes td {
+	border-color: #ddd;
+}
+
+#current-theme img {
+	border-color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link,
+#TB_window #TB_title a.tb-theme-preview-link:visited {
+	color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link:hover,
+#TB_window #TB_title a.tb-theme-preview-link:focus {
+	color: #ccc;
+}
+
+.misc-pub-section {
+	border-bottom-color: #eee;
+}
+
+#minor-publishing {
+	border-bottom-color: #ddd;
+}
+
+#post-body .misc-pub-section {
+	border-right-color: #eee;
+}
+
+.post-com-count span {
+	background-color: #bbb;
+}
+
+.form-table .color-palette td {
+	border-color: #fff;
+}
+
+.sortable-placeholder {
+	border-color: #bbb;
+	background-color: #f5f5f5;
+}
+
+#post-body ul#category-tabs li.ui-tabs-selected a {
+	color: #333;
+}
+
+#wp_editimgbtn,
+#wp_delimgbtn,
+#wp_editgallery,
+#wp_delgallery {
+	border-color: #999;
+	background-color: #eee;
+}
+
+#wp_editimgbtn:hover,
+#wp_delimgbtn:hover,
+#wp_editgallery:hover,
+#wp_delgallery:hover {
+	border-color: #555;
+	background-color: #ccc;
+}
+
+#favorite-first {
+	background: #797979 url(../images/fav.png) repeat-x 0 center;
+	border-color: #777 !important;
+	border-bottom-color: #666 !important;
+}
+
+#favorite-inside {
+	border-color: #797979;
+	background-color: #797979;
+}
+
+#favorite-toggle {
+	background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;
+}
+
+#favorite-actions a {
+	color: #ddd;
+}
+
+#favorite-actions a:hover {
+	color: #fff;
+}
+
+#favorite-inside a:hover {
+	text-decoration: underline;
+}
+
+#favorite-actions .slide-down {
+	border-bottom-color: #626262;
+}
+
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+	text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+.button-primary,
+.submit .button-primary {
+	text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
+}
+
+#screen-meta a.show-settings {
+	background-color: transparent;
+	text-shadow: rgba(255,255,255,0.7) 0 1px 0;
+}
+
+#icon-edit,
+#icon-post {
+	background: transparent url(../images/icons32-vs.png) no-repeat -552px -5px;
+}
+
+#icon-index {
+	background: transparent url(../images/icons32-vs.png) no-repeat -137px -5px;
+}
+
+#icon-upload {
+	background: transparent url(../images/icons32-vs.png) no-repeat -251px -5px;
+}
+
+#icon-link-manager,
+#icon-link,
+#icon-link-category {
+	background: transparent url(../images/icons32-vs.png) no-repeat -190px -5px;
+}
+
+#icon-edit-pages,
+#icon-page {
+	background: transparent url(../images/icons32-vs.png) no-repeat -312px -5px;
+}
+
+#icon-edit-comments {
+	background: transparent url(../images/icons32-vs.png) no-repeat -72px -5px;
+}
+
+#icon-themes {
+	background: transparent url(../images/icons32-vs.png) no-repeat -11px -5px;
+}
+
+#icon-plugins {
+	background: transparent url(../images/icons32-vs.png) no-repeat -370px -5px;
+}
+
+#icon-users,
+#icon-user-edit {
+	background: transparent url(../images/icons32-vs.png) no-repeat -600px -5px;
+}
+
+#icon-tools,
+#icon-admin {
+	background: transparent url(../images/icons32-vs.png) no-repeat -432px -5px;
+}
+
+#icon-options-general {
+	background: transparent url(../images/icons32-vs.png) no-repeat -492px -5px;
+}
+
+.view-switch #view-switch-list {
+	background: transparent url(../images/list-vs.png) no-repeat 0 0;
+}
+
+.view-switch #view-switch-list.current {
+	background: transparent url(../images/list-vs.png) no-repeat -40px 0;
+}
+
+.view-switch #view-switch-excerpt {
+	background: transparent url(../images/list-vs.png) no-repeat -20px 0;
+}
+
+.view-switch #view-switch-excerpt.current {
+	background: transparent url(../images/list-vs.png) no-repeat -60px 0;
+}
+
+#header-logo {
+	background: transparent url(../images/wp-logo.gif) no-repeat scroll center center;
+}</diff>
      <filename>wp-admin/css/colors-classic.css</filename>
    </modified>
    <modified>
      <diff>@@ -2,23 +2,82 @@
 	border-right-color: transparent;
 	border-left-color: #99d;
 }
-.post-com-count {
-}
-#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
-	background-image: url(../images/comment-stalk-rtl.gif);
-	background-position:right bottom;
-}
-#footer {
-	background-position:99% 10px;
-}
+
 .plugins .togl {
 	border-right-color: transparent;
 	border-left-color: #ccc;
 }
-#poststuff .closed .togbox, #poststuff .togbox {
-	background-image: url(../images/toggle-arrow-rtl.gif);
+
+.post-com-count {
+	background-image: url(../images/bubble_bg-rtl.gif);
+}
+.tablenav .tablenav-pages a {
+	background: #eee url('../images/menu-bits-rtl.gif') repeat-x scroll right -379px;
 }
 #upload-menu li.current {
-	border-right-color:transparent;
+	border-right-color: transparent;
 	border-left-color: #448abd;
 }
+
+#adminmenu .wp-submenu .current a.current {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll  right -289px;
+}
+
+#adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
+}
+
+.folded #adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-menu-toggle,
+#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+	background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -207px;
+}
+
+#adminmenu .wp-has-current-submenu ul li a.current {
+	background: url(../images/menu-dark-rtl.gif) top right no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu .menu-top .current {
+	background: url(../images/menu-bits-rtl.gif) top right repeat-x;
+}
+
+#adminmenu li.wp-has-current-submenu ul li a {
+	background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat right -207px;
+}
+
+#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
+#adminmenu .wp-menu-open .wp-menu-toggle {
+	background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -109px;
+}
+
+#adminmenu a.wp-has-submenu {
+	background: #f1f1f1 url(../images/menu-bits-rtl.gif) repeat-x scroll right -379px;
+}
+
+#adminmenu .wp-submenu a {
+	background: #FFFFFF url(../images/menu-bits-rtl.gif) no-repeat scroll right -310px;
+}
+
+#adminmenu li.current a,
+#adminmenu .wp-submenu a:hover {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll  right -289px;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-submenu {
+	background: #b5b5b5 url(../images/menu-bits-rtl.gif) repeat-x scroll right top;
+}
+
+.meta-box-sortables .postbox:hover .handlediv {
+	background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -111px;
+}
+#favorite-toggle {
+	background: transparent url(../images/fav-arrow-rtl.gif) no-repeat right -4px;
+}</diff>
      <filename>wp-admin/css/colors-fresh-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,27 @@
+html {
+	background-color: #f9f9f9;
+}
+
+.find-box-search {
+	border-color: #dfdfdf;
+	background-color: #f1f1f1;
+}
+
+.find-box {
+	background-color: #f1f1f1;
+}
+
+.find-box-inside {
+	background-color: #fff;
+}
+
 a.page-numbers:hover {
 	border-color: #999;
 }
 
-body, .form-table .pre {
-	background-color: #fff;
+body,
+#wpbody,
+.form-table .pre {
 	color: #333;
 }
 
@@ -11,10 +29,52 @@ body &gt; #upload-menu {
 	border-bottom-color: #fff;
 }
 
-div#current-widgets, #postcustomstuff table, #your-profile fieldset, a.page-numbers, #rightnow, div.dashboard-widget, .widefat {
+kbd, code {
+	background: #eaeaea;
+}
+
+div#current-widgets,
+#postcustomstuff table,
+#your-profile fieldset,
+#rightnow,
+div.dashboard-widget,
+#dashboard-widgets p.dashboard-widget-links,
+#replyrow #ed_reply_toolbar input {
 	border-color: #ccc;
 }
 
+#poststuff .inside label.spam {
+	color: red;
+}
+
+#poststuff .inside label.waiting {
+	color: orange;
+}
+
+#poststuff .inside label.approved {
+	color: green;
+}
+
+#postcustomstuff table {
+	border-color: #dfdfdf;
+	background-color: #F9F9F9;
+}
+
+#postcustomstuff thead th {
+	background-color: #F1F1F1;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table textarea {
+	border-color: #dfdfdf;
+	background-color: #fff;
+}
+
+.widefat {
+	border-color: #dfdfdf;
+	background-color: #fff;
+}
+
 div.dashboard-widget-error {
 	background-color: #c43;
 }
@@ -23,26 +83,55 @@ div.dashboard-widget-notice {
 	background-color: #cfe1ef;
 }
 
-div.dashboard-widget-submit, ul.widget-control-list div.widget-control-actions {
+div.dashboard-widget-submit,
+ul.widget-control-list div.widget-control-actions {
 	border-top-color: #ccc;
 }
 
 div.ui-tabs-panel {
-	border-color: #cee1ef;
+	border-color: #f1f1f1;
 }
 
-input.disabled, textarea.disabled {
-	background-color: #ccc;
+ul#category-tabs li.ui-tabs-selected {
+	background-color: #f1f1f1;
 }
 
-#user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a,
+input.disabled,
+textarea.disabled {
+	background-color: #ccc;
+}
+/* #upload-menu li a.upload-tab-link, */
+li.widget-list-control-item h4.widget-title a:hover,
+li.widget-list-control-item h4.widget-title a,
 #dragHelper li.widget-list-control-item h4.widget-title a,
-#draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover {
+#draghelper li.widget-list-control-item h4.widget-title a:visited,
+.login #backtoblog a:hover,
+#plugin-information .action-button a,
+#plugin-information .action-button a:hover,
+#plugin-information .action-button a:visited {
 	color: #fff;
 }
 
-li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
-	background-color: #eaf3fa;
+li.widget-list-control-item div.widget-control {
+	background-color: #fff;
+	border-color: #dfdfdf;
+}
+
+.metabox-holder .postbox h3,
+#poststuff .postbox h3,
+#poststuff .stuffbox h3 {
+	background: #dfdfdf url(&quot;../images/gray-grad.png&quot;) repeat-x left top;
+	text-shadow: #fff 0 1px 0;
+}
+
+.form-table th,
+.form-wrap label {
+	color: #222;
+	text-shadow: #fff 0 1px 0;
+}
+
+.setting-description, .form-wrap p {
+	color: #666;
 }
 
 select {
@@ -51,11 +140,7 @@ select {
 }
 
 strong .post-com-count span {
-	background-color: #2583ad;
-}
-
-ul#category-tabs li.ui-tabs-selected, .button-secondary, #quicktags, #login form .submit input {
-	background-color: #cee1ef !important;
+	background-color: #21759b;
 }
 
 ul#widget-list li.widget-list-item h4.widget-title {
@@ -67,10 +152,14 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	background-color: #ccf3fa;
 }
 
-.ac_match, .subsubsub a.current, h2 {
+.ac_match, .subsubsub a.current {
 	color: #000;
 }
 
+.wrap h2 {
+	color: #464646;
+}
+
 .ac_over {
 	background-color: #f0f0b8;
 }
@@ -84,13 +173,13 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #101010;
 }
 
-.alternate {
+.alternate, .alt {
 	background-color: #f9f9f9;
 }
 
 .available-theme a.screenshot {
 	background-color: #f1f1f1;
-	border-color: #ccc;
+	border-color: #ddd;
 }
 
 .bar {
@@ -98,8 +187,11 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	border-right-color: #99d;
 }
 
-.describe {
-	border-top-color: #d0d0d0;
+#media-upload {
+	background: #fff;
+}
+#media-upload .slidetoggle {
+	border-top-color: #dfdfdf;
 }
 
 .error, #login #login_error {
@@ -119,12 +211,13 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	border-color: #c00 !important;
 }
 
-.form-table input, .form-table textarea {
-	border-color: #c6d9e9;
-}
-
-.form-table td, .form-table th {
-	border-bottom-color: #fff;
+.form-table input,
+.form-table textarea,
+.search-input,
+.form-field input,
+.form-field textarea,
+.submit {
+	border-color: #DFDFDF;
 }
 
 .highlight {
@@ -132,27 +225,31 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #d54e21;
 }
 
-#user_info, .howto, .nonessential, #dashmenu a, #sidemenu, #edit-slug-box, .form-input-tip, #dashboard_primary span.rss-date, .subsubsub, #dashboard_secondary div.dashboard-widget-content ul li a cite {
-	color: #999;
+.howto,
+.nonessential,
+#edit-slug-box,
+.form-input-tip,
+.rss-widget span.rss-date,
+.subsubsub {
+	color: #666;
 }
 
 .media-item {
-	border-bottom-color: #d0d0d0;
+	border-bottom-color: #dfdfdf;
 }
 
-.media-upload-form label.form-help, td.help {
-	color: #9a9a9a;
+#wpbody-content #media-items .describe {
+	border-top-color: #dfdfdf;
 }
 
-.page-numbers {
-	background-color: #fff;
-	border-color: #fff;
+.describe input[type=&quot;text&quot;],
+.describe textarea {
+	border-color: #dfdfdf;
 }
 
-.page-numbers.current {
-	background-color: #328ab2;
-	border-color: #328ab2;
-	color: #fff;
+.media-upload-form label.form-help,
+td.help {
+	color: #9a9a9a;
 }
 
 .post-com-count {
@@ -182,37 +279,100 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #666;
 }
 
-.submit input, .button, .button-secondary, #login form .submit input, div.dashboard-widget-submit input, #edit-slug-buttons a.save {
-	background-color: #e5e5e5;
-	color: #246;
-	border-color: #80b5d0;
+.button,
+.button-secondary,
+.submit input,
+input[type=button],
+input[type=submit] {
+	border-color: #bbb;
+	color: #464646;
+}
+
+.button:hover,
+.button-secondary:hover,
+.submit input:hover,
+input[type=button]:hover,
+input[type=submit]:hover {
+	color: #000;
+	border-color: #666;
+}
+
+.button,
+.submit input,
+.button-secondary {
+	background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
+}
+
+.button:active,
+.submit input:active,
+.button-secondary:active {
+	background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
+}
+
+.button-primary,
+.submit .button-primary,
+#login form .submit input {
+	border-color: #298cba !important;
+	font-weight: bold;
+	color: #FFF !important;
+	background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
+}
+
+.button-primary:active,
+#login form .submit input:active {
+	background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top !important;
 }
 
-.button[disabled], .button:disabled {
-	background-color: #999;
+.button[disabled],
+.button:disabled,
+.button-secondary[disabled],
+.button-secondary:disabled,
+a.button.disabled {
+	color: #ccc !important;
+	border-color: #ccc;
 }
 
-.submit input:hover, .button:hover, #edit-slug-buttons a.save:hover {
-	border-color: #535353;
+.button-primary[disabled],
+.button-primary:disabled {
+	color: #2fa0d5 !important;
 }
 
-.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover, #media-upload a.del-link:hover, .ui-tabs-nav a:hover {
+a:active,
+a:focus {
 	color: #d54e21;
 }
 
-.button-secondary:hover, #login form .submit input:hover {
-	border-color: #328ab2;
+a:hover,
+#wphead #viewsite a:hover,
+#adminmenu a:hover,
+#adminmenu ul.wp-submenu a:hover,
+#the-comment-list .comment a:hover,
+#rightnow a:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover,
+#login form .submit input:hover,
+div.dashboard-widget-submit input:hover,
+#media-upload a.del-link:hover,
+.ui-tabs-nav a:hover {
+	color: #d54e21;
 }
 
-.submitbox #autosave .error, ul.view-switch li.current a {
-	color: #333;
+#the-comment-list .comment-item,
+#dashboard-widgets #dashboard_quick_press form p.submit {
+	border-color: #dfdfdf;
 }
 
-.submitbox #previewview {
-	background-color: #2683ae;
+.button-primary:hover,
+#login form .submit input:hover {
+	border-color: #13455b !important;
+	color: #EAF2FA !important;
+}
+
+#side-info-column #category-tabs .ui-tabs-selected a {
+	color: #333;
 }
 
-.submitbox #previewview a, #rightnow .rbutton {
+#rightnow .rbutton {
 	background-color: #ebebeb;
 	color: #264761;
 }
@@ -222,8 +382,9 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	color: #ccc;
 }
 
-.submitbox .submitdelete {
-	border-bottom-color: #999;
+.submitbox .submitdelete, a.delete {
+	color: #f00;
+	border-bottom-color: #f00;
 }
 
 .submitbox .submitdelete:hover,
@@ -233,78 +394,134 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	border-bottom-color: #f00;
 }
 
+#normal-sortables .submitbox .submitdelete:hover {
+	color: #000;
+	background-color: #f00;
+	border-bottom-color: #f00;
+}
+
 .tablenav .dots {
-	background-color: #e4f2fd;
-	border-color: #e4f2fd;
+	border-color: transparent;
 }
 
-.tablenav .next, .tablenav .prev{
-	background-color: #e4f2fd;
-	border-bottom-color: #2583ad;
-	border-color: #e4f2fd;
-	color: #2583ad;
+.tablenav .next,
+.tablenav .prev {
+	border-color: transparent;
+	color: #21759b;
 }
 
-.tablenav .next:hover, .tablenav .prev:hover {
-	border-bottom-color: #d54e21;
-	border-color: #e4f2fd;
+.tablenav .next:hover,
+.tablenav .prev:hover {
+	border-color: transparent;
 	color: #d54e21;
 }
 
-.updated, .login #login_error, .login .message {
+.updated,
+.login #login_error,
+.login .message {
 	background-color: #ffffe0;
 	border-color: #e6db55;
 }
 
-.updated a {
-	border-bottom-color: #2583ad;
+a.page-numbers {
+	border-bottom-color: #B8D3E2;
 }
 
-.widefat td, .widefat th, div#available-widgets-filter, ul#widget-list li.widget-list-item, .commentlist li {
+div#available-widgets-filter,
+ul#widget-list li.widget-list-item,
+.commentlist li {
 	border-bottom-color: #ccc;
 }
 
-.widefat thead, .thead {
-	background-color: #464646;
-	color: #d7d7d7;
+.widefat td,
+.widefat th {
+	border-color: #dfdfdf;
 }
 
-.widget-control-save, .widget-control-remove {
-	background-color: #cee1ef;
-	color: #246;
+.widefat th {
+	text-shadow: rgba(255,255,255,0.8) 0 1px 0;
 }
 
-.wrap h2 {
-	border-bottom-color: #dadada;
-	color: #666;
+.widefat thead tr th,
+.widefat tfoot tr th,
+h3.dashboard-widget-title,
+h3.dashboard-widget-title span,
+h3.dashboard-widget-title small,
+.find-box-head {
+	color: #333;
+	background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;
 }
 
-#adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, .ui-tabs-nav a, a {
-	color: #2583ad;
+h3.dashboard-widget-title small a {
+	color: #d7d7d7;
+}
+
+h3.dashboard-widget-title small a:hover {
+	color: #fff;
+}
+
+#adminmenu a,
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML,
+#the-comment-list p.comment-author strong a,
+#media-upload a.del-link,
+#media-upload a.delete,
+.ui-tabs-nav a, a {
+	color: #21759b;
 }
 
 /* Because we don't want visited on these links */
-#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
+body.press-this .ui-tabs-selected a,
+body.press-this .ui-tabs-selected a:hover {
 	background-color: #fff;
 	border-color: #c6d9e9;
 	border-bottom-color: #fff;
 	color: #d54e21;
 }
 
-#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
-	background-image: url(../images/comment-stalk-fresh.gif);
+#adminmenu #awaiting-mod,
+#adminmenu .update-plugins,
+#sidemenu a .update-plugins,
+#rightnow .reallynow,
+#plugin-information .action-button {
+	background-color: #d54e21;
+	color: #fff;
 }
 
-#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow {
-	background-color: #d54e21;
+#adminmenu li a:hover #awaiting-mod,
+#adminmenu li a:hover .update-plugins,
+#sidemenu li a:hover .update-plugins {
+	background-color: #264761;
 	color: #fff;
 }
 
-#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
+#adminmenu li.current a #awaiting-mod,
+#adminmenu li.current a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins {
+	background-color: #ddd;
+	color: #000;
+	text-shadow: none;
+	-moz-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+	-khtml-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+	-webkit-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+	box-shadow: rgba(0,0,0,0.2) 0px -1px 0px;
+}
+
+#adminmenu li.current a:hover #awaiting-mod,
+#adminmenu li.current a:hover .update-plugins,
+#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,
+#adminmenu li.wp-has-current-submenu a:hover .update-plugins {
 	background-color: #264761;
+	color: #fff;
 }
 
-#adminmenu, div#media-upload-header {
+div#media-upload-header {
+	background-color: #f9f9f9;
+	border-bottom-color: #dfdfdf;
+}
+
+div#plugin-information-header {
 	background-color: #e4f2fd;
 	border-bottom-color: #c6d9e9;
 }
@@ -321,66 +538,78 @@ ul#widget-list li.widget-list-item h4.widget-title {
 	background-color: #f9f9f9;
 }
 
-input.readonly {
+input.readonly, textarea.readonly {
 	background-color: #ddd;
 }
 
-#dashmenu a.current {
-	background-color: #e4f2fd;
-	color: #555;
-}
-
-#dragHelper h4.widget-title, li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 {
+#dragHelper h4.widget-title,
+li.widget-list-control-item h4,
+#dragHelper li.widget-list-control-item h4 {
 	background-color: #2683ae;
 	color: #fff;
 }
 
-#ed_toolbar input {
-	background: url( ../images/fade-butt.png ) #fff repeat-x 0 -2px;
+#ed_toolbar input,
+#ed_reply_toolbar input {
+	background: #fff url(&quot;../images/fade-butt.png&quot;) repeat-x 0 -2px;
 }
 
 #editable-post-name {
 	background-color: #fffbcc;
 }
 
-#edit-slug-box strong, .login #nav a {
+#edit-slug-box strong,
+.tablenav .displaying-num,
+#submitted-on {
 	color: #777;
 }
 
-#footer {
-	background: url(../images/logo-ghost.png) #464646 no-repeat 20px 10px;
+.login #nav a {
+	color: #21759b !important;
+}
+
+.login #nav a:hover {
+	color: #d54e21 !important;
+}
+
+#footer,
+#footer-upgrade {
+	background: #464646;
 	color: #999;
 }
 
 #media-items {
-	border-color: #c0c0c0;
+	border-color: #dfdfdf;
 }
 
 #pass-strength-result {
-	background-color: #e3e3e3;
-	border-color: #000;
+	background-color: #eee;
+	border-color: #ddd !important;
 }
 
 #pass-strength-result.bad {
-	background-color: #ffeff7;
-	border-color: #c69;
+	background-color: #ffb78c;
+	border-color: #ff853c !important;
 }
 
 #pass-strength-result.good {
-	background-color: #effff4;
-	border-color: #66cc87;
+	background-color: #ffec8b;
+	border-color: #fc0 !important;
 }
 
 #pass-strength-result.short {
-	background-color: #e3e3e3;
+	background-color: #ffa0a0;
+	border-color: #f04040 !important;
 }
 
 #pass-strength-result.strong {
-	background-color: #59ef86;
-	border-color: #319f52;
+	background-color: #c3ff88;
+	border-color: #8dff1c !important;
 }
 
-.checkbox, .side-info, #your-profile #rich_editing {
+.checkbox,
+.side-info,
+#your-profile #rich_editing {
 	background-color: #fff;
 }
 
@@ -396,29 +625,49 @@ input.readonly {
 	background-color: #ffffe0;
 }
 
+#the-comment-list .approve a {
+	color: #006505;
+}
+
+#the-comment-list .unapprove a {
+	color: #d98500;
+}
+
+#the-comment-list .delete a {
+	color: #bc0b0b;
+}
+
 .plugins tr {
 	background-color: #fff;
 }
 
-#poststuff #editor-toolbar .active {
-	background-color: #cee1ef;
-	color: #333;
+.metabox-holder .postbox,
+#poststuff .postbox,
+#titlediv,
+#poststuff .postarea,
+#poststuff .stuffbox,
+.postbox input[type=&quot;text&quot;],
+.postbox textarea,
+.stuffbox input[type=&quot;text&quot;],
+.stuffbox textarea {
+	border-color: #dfdfdf;
 }
 
-#poststuff .closed .togbox {
-	background-color: #2583ad;
-	background-image: url(../images/toggle-arrow.gif);
+.metabox-holder .postbox,
+#poststuff .postbox {
+	background-color: #FFF;
 }
 
-#poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox {
-	border-color: #ebebeb;
-	border-right-color: #ccc;
-	border-bottom-color: #ccc;
+.ui-sortable .postbox h3 {
+	color: #464646;
 }
 
-#poststuff .togbox {
-	background-color: #b2b2b2;
-	background-image: url(../images/toggle-arrow.gif);
+.ui-sortable .postbox h3:hover {
+	color: #000;
+}
+
+.curtime #timestamp {
+	background-image: url(../images/date-button.gif);
 }
 
 #quicktags #ed_link {
@@ -433,25 +682,16 @@ input.readonly {
 	color: #448abd;
 }
 
-#sidemenu a {
-	background-color: #e4f2fd;
-	border-bottom-color: #c6d9e9;
-	border-top-color: #e4f2fd;
-}
-
-#tagchecklist span a {
+#tagchecklist span a,
+#bulk-titles div a {
 	background: url(../images/xit.gif) no-repeat;
 }
 
-#tagchecklist span a:hover {
+#tagchecklist span a:hover,
+#bulk-titles div a:hover {
 	background: url(../images/xit.gif) no-repeat -10px 0;
 }
 
-#the-comment-list .comment a {
-	border-bottom-color: #ababab;
-	color: #666;
-}
-
 #update-nag, .plugin-update {
 	background-color: #fffeeb;
 	border-bottom-color: #ccc;
@@ -459,163 +699,185 @@ input.readonly {
 	color: #555;
 }
 
-#upload-files a.file-link {
-	background-color: #d1e2ef;
+.login #backtoblog a {
+	color: #ccc;
 }
 
-#upload-file-view a img {
-	border-bottom-color: #69c;
+#wphead {
+	background-color: #464646;
 }
 
-#upload-menu li #current-tab-nav, #upload-file {
-	background-color: #f9fcfe;
+body.login {
+	border-top-color: #464646;
 }
 
-#upload-menu li span a.page-numbers {
-	color: #00019b;
+#wphead h1 a {
+	color: #fff;
 }
 
-#upload-menu li.current {
-	border-right-color: #448abd;
-	color: #000;
+#login form input {
+	color: #555;
 }
 
-#upload-menu li.current a.upload-tab-link, #upload-menu li a:hover {
-	background-color: #f9fcfe;
-	color: #000;
+#wphead h1 a:hover {
+	text-decoration: underline;
 }
 
-#upload-menu, #upload-menu li {
-	border-top-color: #247fab;
+#user_info {
+	color: #999;
 }
 
-.login #backtoblog a, .curtime, #user_info a {
+#user_info a:link, #user_info a:visited, #footer a:link, #footer a:visited {
 	color: #ccc;
+	text-decoration: none;
 }
 
-#wphead {
-	background-color: #e4f2fd;
+#user_info a:hover, #footer a:hover {
+	color: #fff;
+	text-decoration: underline !important;
 }
 
-#wphead, body.login {
-	border-top-color: #464646;
+#user_info a:active, #footer a:active {
+	color: #ccc !important;
 }
 
-#wphead #viewsite a {
-	background-color: #c6d9e9;
-	color: #246;
-	border-color: #80b5d0;
+div#media-upload-error,
+.file-error,
+abbr.required,
+.widget-control-remove:hover,
+.delete a:hover {
+	color: #f00;
 }
 
-#wphead #viewsite a:hover {
-	border-color: #328ab2;
+#media-upload a.delete {
+	color: #888;
 }
 
-#wphead h1, #dashmenu a.current:hover, #login form input {
-	color: #555;
+/* editors */
+#quicktags {
+	border-color: #dfdfdf;
+	background-color: #dfdfdf;
 }
 
-div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover, .delete:hover {
-	color: #f00;
+#ed_toolbar input {
+	border-color: #C3C3C3;
 }
 
-#media-upload a.delete {
-	color: #888;
+#ed_toolbar input:hover {
+	border-color: #aaa;
+	background: #ddd;
+}
+
+#poststuff .wp_themeSkin .mceStatusbar {
+	border-color: #EDEDED;
+}
+
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+	background-color: #f1f1f1;
+	border-color: #dfdfdf;
+	color: #999;
+}
+
+#poststuff #editor-toolbar .active {
+	border-bottom-color: #e9e9e9;
+	background-color: #e9e9e9;
+	color: #333;
 }
 
 /* TinyMCE */
+#post-status-info {
+	background-color: #EDEDED;
+}
+
 .wp_themeSkin *,
-.wp_themeSkin a:hover, 
-.wp_themeSkin a:link, 
-.wp_themeSkin a:visited, 
+.wp_themeSkin a:hover,
+.wp_themeSkin a:link,
+.wp_themeSkin a:visited,
 .wp_themeSkin a:active {
 	 color: #000;
 }
 
 /* Containers */
-.wp_themeSkin table, #wp_editbtns {
-	background: #cee1ef;
-}
-
 .wp_themeSkin iframe {
 	background: #fff;
 }
 
 /* Layout */
 .wp_themeSkin .mceStatusbar {
-	 color:#000;
-	 background-color: #eaf3fa;
+	color: #000;
+	background-color: #f5f5f5;
 }
 
 /* Button */
-.wp_themeSkin .mceButton { 
+.wp_themeSkin .mceButton {
 	background-color: #e9e8e8;
-	border-color: #abc0fb;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin a.mceButtonEnabled:hover,
-.wp_themeSkin a.mceButtonActive, 
+.wp_themeSkin a.mceButtonActive,
 .wp_themeSkin a.mceButtonSelected {
-	background-color: #d6d8da;
-	border-color: #7789ba !important;
+	background-color: #d5d5d5;
+	border-color: #777 !important;
 }
 
 .wp_themeSkin .mceButtonDisabled {
-	border-color: #bdd !important;
+	border-color: #ccc !important;
 }
 
 /* ListBox */
 .wp_themeSkin .mceListBox .mceText,
 .wp_themeSkin .mceListBox .mceOpen  {
-	border-color: #abc0fb;
-	background-color: #e9e8e8;
+	border-color: #B2B2B2;
+	background-color: #d5d5d5;
 }
 
-.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 
+.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,
 .wp_themeSkin .mceListBoxHover .mceOpen,
 .wp_themeSkin .mceListBoxSelected .mceOpen,
 .wp_themeSkin .mceListBoxSelected .mceText {
-	border-color: #7789ba !important;
-	background-color: #d6d8da;
+	border-color: #777 !important;
+	background-color: #d5d5d5;
 }
 
-.wp_themeSkin table.mceListBoxEnabled:hover .mceText, 
+.wp_themeSkin table.mceListBoxEnabled:hover .mceText,
 .wp_themeSkin .mceListBoxHover .mceText {
-	border-color: #7789ba !important;
+	border-color: #777 !important;
 }
 
 .wp_themeSkin select.mceListBox {
-	border-color: #b3c7e1; 
+	border-color: #B2B2B2;
 	background-color: #fff;
 }
 
 /* SplitButton */
-.wp_themeSkin .mceSplitButton a.mceAction, 
+.wp_themeSkin .mceSplitButton a.mceAction,
 .wp_themeSkin .mceSplitButton a.mceOpen {
-	background-color: #e9e8e8;
-	border-color: #abc0fb;
+	background-color: #e8e8e8;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin .mceSplitButton a.mceOpen:hover,
 .wp_themeSkin .mceSplitButtonSelected a.mceOpen,
 .wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
 .wp_themeSkin .mceSplitButton a.mceAction:hover {
-	background-color: #d6d8da;
-	border-color: #7789ba !important;
-} 
+	background-color: #d5d5d5;
+	border-color: #777 !important;
+}
 
 .wp_themeSkin .mceSplitButtonActive {
-	background-color: #d6d8da;
+	background-color: #B2B2B2;
 }
 
 /* ColorSplitButton */
 .wp_themeSkin div.mceColorSplitMenu table {
-	background-color: #ebeaeb;
-	border-color: #808080;
+	background-color: #ebebeb;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin .mceColorSplitMenu a {
-	border-color: #808080;
+	border-color: #B2B2B2;
 }
 
 .wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
@@ -641,18 +903,18 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
 }
 
 .wp_themeSkin .mceMenu .mceText {
-	color: #000; 
+	color: #000;
 }
 
 .wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
 .wp_themeSkin .mceMenu .mceMenuItemActive {
-	background-color: #CEE1EF;
+	background-color: #f5f5f5;
 }
 .wp_themeSkin td.mceMenuItemSeparator {
 	background-color: #aaa;
 }
 .wp_themeSkin .mceMenuItemTitle a {
-	background-color: #ccc; 
+	background-color: #ccc;
 	border-bottom-color: #aaa;
 }
 .wp_themeSkin .mceMenuItemTitle span.mceText {
@@ -662,27 +924,80 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
 	color: #888;
 }
 
-/* pop-up */
-.clearlooks2 .mceTop .mceLeft, .clearlooks2 .mceTop .mceRight {
-	background-color: #cee1ef;
-	border-color: #c6d9e9;
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+	background-color: #dfdfdf;
+	border-color: #dfdfdf;
 }
 
-.clearlooks2 .mceFocus .mceTop .mceLeft, .clearlooks2 .mceFocus .mceTop .mceRight {
-	background-color: #2683ae;
-	border-color: #464646;
+.wp-admin #mceModalBlocker {
+	background: #000;
 }
 
-#editorcontainer {
-	border-color: #ccc;
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
+	background: #444444;
+	border-left: 1px solid #999;
+	border-top: 1px solid #999;
+	-moz-border-radius: 4px 0 0 0;
+	-webkit-border-top-left-radius: 4px;
+	-khtml-border-top-left-radius: 4px;
+	border-top-left-radius: 4px;
 }
 
-#poststuff #titlewrap {
-	border-color: #ccc;
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
+	background: #444444;
+	border-right: 1px solid #999;
+	border-top: 1px solid #999;
+	border-top-right-radius: 4px;
+	-khtml-border-top-right-radius: 4px;
+	-webkit-border-top-right-radius: 4px;
+	-moz-border-radius: 0 4px 0 0;
 }
 
-.curtime {
-	color: #666;
+.wp-admin .clearlooks2 .mceMiddle .mceLeft {
+	background: #f1f1f1;
+	border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceRight {
+	background: #f1f1f1;
+	border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceLeft {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+	border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceCenter {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceRight {
+	background: #f1f1f1;
+	border-bottom: 1px solid #999;
+	border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop span {
+	color: #e5e5e5;
+}
+/* end TinyMCE */
+
+#editorcontainer,
+#post-status-info,
+#titlediv #title {
+	border-color: #dfdfdf;
+}
+
+#titlediv #title {
+	background-color: #fff;
 }
 
 #tTips p#tTips_inside {
@@ -690,8 +1005,223 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
 	color: #333;
 }
 
-/* Diff */
+#timestampdiv input,
+#namediv input,
+#tagsdiv #the-tagcloud {
+	border-color: #ddd;
+}
+
+/* menu */
+#adminmenu * {
+	border-color: #e3e3e3;
+}
+
+#adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
+}
+
+.folded #adminmenu li.wp-menu-separator {
+	background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
+}
+
+#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
+#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;
+}
+
+#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
+#adminmenu .wp-menu-open .wp-menu-toggle {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
+}
+
+#adminmenu a.menu-top {
+	background: #f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px;
+}
+
+#adminmenu .wp-submenu a {
+	background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;
+}
+
+#adminmenu .wp-has-current-submenu ul li a {
+	background: none;
+}
 
+#adminmenu .wp-has-current-submenu ul li a.current {
+	background: url(../images/menu-dark.gif) top left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu .menu-top .current {
+	background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x;
+	border-color: #6d6d6d;
+	color: #fff;
+	text-shadow: rgba(0,0,0,0.4) 0px -1px 0px;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-submenu,
+#adminmenu li.wp-has-current-submenu ul li a {
+	border-color: #aaa !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul li a {
+	background: url(../images/menu-dark.gif) bottom left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul {
+	border-bottom-color: #aaa;
+}
+
+#adminmenu li.menu-top .current:hover {
+	border-color: #B5B5B5;
+}
+
+#adminmenu .wp-submenu .current a.current {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll  0 -289px;
+}
+
+#adminmenu .wp-submenu a:hover {
+	background-color: #EAF2FA !important;
+	color: #333 !important;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover {
+	color: #333;
+	background-color: #f5f5f5;
+	background-image: none;
+	border-color: #e3e3e3;
+	text-shadow: rgba(255,255,255,1) 0px 1px 0px;
+}
+
+#adminmenu .wp-submenu ul {
+	background-color: #fff;
+}
+
+.folded #adminmenu li.menu-top,
+#adminmenu .wp-submenu .wp-submenu-head {
+	background-color: #F1F1F1;
+}
+
+.folded #adminmenu li.wp-has-current-submenu,
+.folded #adminmenu li.menu-top.current {
+	background-color: #e6e6e6;
+}
+
+#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
+	background-color: #EAEAEA;
+	border-color: #aaa;
+}
+
+#adminmenu div.wp-submenu {
+	background-color: transparent;
+}
+
+/* menu icons */
+#adminmenu #menu-dashboard div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -61px -33px;
+}
+
+#adminmenu #menu-dashboard:hover div.wp-menu-image,
+#adminmenu  #menu-dashboard.wp-has-current-submenu div.wp-menu-image,
+#adminmenu  #menu-dashboard.current div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -61px -1px;
+}
+
+#adminmenu #menu-posts div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -272px -33px;
+}
+
+#adminmenu #menu-posts:hover div.wp-menu-image,
+#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -272px -1px;
+}
+
+#adminmenu #menu-media div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -121px -33px;
+}
+
+#adminmenu #menu-media:hover div.wp-menu-image,
+#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -121px -1px;
+}
+
+#adminmenu #menu-links div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -91px -33px;
+}
+
+#adminmenu #menu-links:hover div.wp-menu-image,
+#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -91px -1px;
+}
+
+#adminmenu #menu-pages div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -151px -33px;
+}
+
+#adminmenu #menu-pages:hover div.wp-menu-image,
+#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -151px -1px;
+}
+
+#adminmenu #menu-comments div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -31px -33px;
+}
+
+#adminmenu #menu-comments:hover div.wp-menu-image,
+#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,
+#adminmenu #menu-comments.current div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -31px -1px;
+}
+
+#adminmenu #menu-appearance div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -1px -33px;
+}
+
+#adminmenu #menu-appearance:hover div.wp-menu-image,
+#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -1px -1px;
+}
+
+#adminmenu #menu-plugins div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -181px -33px;
+}
+
+#adminmenu #menu-plugins:hover div.wp-menu-image,
+#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -181px -1px;
+}
+
+#adminmenu #menu-users div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -301px -33px;
+}
+
+#adminmenu #menu-users:hover div.wp-menu-image,
+#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -301px -1px;
+}
+
+#adminmenu #menu-tools div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -211px -33px;
+}
+
+#adminmenu #menu-tools:hover div.wp-menu-image,
+#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -211px -1px;
+}
+
+#adminmenu #menu-settings div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -241px -33px;
+}
+
+#adminmenu #menu-settings:hover div.wp-menu-image,
+#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image {
+	background: transparent url(&quot;../images/menu.png&quot;) no-repeat scroll -241px -1px;
+}
+/* end menu */
+
+
+/* Diff */
 table.diff .diff-deletedline {
 	background-color: #ffdddd;
 }
@@ -704,3 +1234,344 @@ table.diff .diff-addedline {
 table.diff .diff-addedline ins {
 	background-color: #99ff99;
 }
+
+#att-info {
+	background-color: #E4F2FD;
+}
+
+/* edit image */
+#sidemenu a {
+	background-color: #f9f9f9;
+	border-color: #f9f9f9;
+	border-bottom-color: #dfdfdf;
+}
+
+#sidemenu a.current {
+	background-color: #fff;
+	border-color: #dfdfdf #dfdfdf #fff;
+	color: #D54E21;
+}
+
+
+#screen-options-wrap,
+#contextual-help-wrap {
+	background-color: #f1f1f1;
+	border-color: #dfdfdf;
+}
+
+#screen-meta-links a.show-settings {
+	color: #606060;
+}
+
+#screen-meta-links a.show-settings:hover {
+	color: #000;
+}
+
+#replysubmit {
+	background-color: #f1f1f1;
+	border-top-color: #ddd;
+}
+
+#replyerror {
+	border-color: #ddd;
+	background-color: #f9f9f9;
+}
+
+#edithead,
+#replyhead {
+	background-color: #f1f1f1;
+}
+
+#ed_reply_toolbar {
+	background-color: #e9e9e9;
+}
+
+/* table vim shortcuts */
+.vim-current {
+	background-color: #E4F2FD !important;
+}
+
+/* Install Plugins */
+.star-average,
+.star.star-rating {
+	background-color: #fc0;
+}
+
+div.star.select:hover {
+	background-color: #d00;
+}
+
+#plugin-information .fyi ul {
+	background-color: #eaf3fa;
+}
+
+#plugin-information .fyi h2.mainheader {
+	background-color: #cee1ef;
+}
+
+#plugin-information pre,
+#plugin-information code {
+	background-color: #ededff;
+}
+
+#plugin-information pre {
+	border: 1px solid #ccc;
+}
+
+/* inline editor */
+.inline-edit-row fieldset input[type=&quot;text&quot;],
+.inline-edit-row fieldset textarea,
+#bulk-titles,
+#replyrow input {
+	border-color: #ddd;
+}
+
+.inline-editor div.title {
+	background-color: #EAF3FA;
+}
+
+.inline-editor ul.cat-checklist {
+	background-color: #FFFFFF;
+	border-color: #ddd;
+}
+
+.inline-edit-row p.submit {
+	background-color: #f1f1f1;
+}
+
+.inline-editor .categories .catshow,
+.inline-editor .categories .cathide {
+	color: #21759b;
+}
+
+.inline-editor .quick-edit-save {
+	background-color: #f1f1f1;
+}
+
+#replyrow #ed_reply_toolbar input:hover {
+	border-color: #aaa;
+	background: #ddd;
+}
+
+fieldset.inline-edit-col-right .inline-edit-col {
+	border-color: #dfdfdf;
+}
+
+.attention {
+	color: #D54E21;
+}
+
+.meta-box-sortables .postbox:hover .handlediv {
+	background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;
+}
+
+#major-publishing-actions {
+	background: #eaf2fa;
+}
+
+.tablenav .tablenav-pages {
+	color: #555;
+}
+
+.tablenav .tablenav-pages a {
+	border-color: #e3e3e3;
+	background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px;
+}
+
+.tablenav .tablenav-pages a:hover {
+	color: #d54e21;
+	border-color: #d54321;
+}
+
+.tablenav .tablenav-pages a:active {
+	color: #fff !important;
+}
+
+.tablenav .tablenav-pages .current {
+	background: #dfdfdf;
+	border-color: #d3d3d3;
+}
+
+#availablethemes,
+#availablethemes td {
+	border-color: #ddd;
+}
+
+#current-theme img {
+	border-color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link,
+#TB_window #TB_title a.tb-theme-preview-link:visited {
+	color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link:hover,
+#TB_window #TB_title a.tb-theme-preview-link:focus {
+	color: #ccc;
+}
+
+.misc-pub-section {
+	border-bottom-color: #eee;
+}
+
+#minor-publishing {
+	border-bottom-color: #ddd;
+}
+
+#post-body .misc-pub-section {
+	border-right-color: #eee;
+}
+
+.post-com-count span {
+	background-color: #bbb;
+}
+
+.form-table .color-palette td {
+	border-color: #fff;
+}
+
+.sortable-placeholder {
+	border-color: #bbb;
+	background-color: #f5f5f5;
+}
+
+#post-body ul#category-tabs li.ui-tabs-selected a {
+	color: #333;
+}
+
+#wp_editimgbtn,
+#wp_delimgbtn,
+#wp_editgallery,
+#wp_delgallery {
+	border-color: #999;
+	background-color: #eee;
+}
+
+#wp_editimgbtn:hover,
+#wp_delimgbtn:hover,
+#wp_editgallery:hover,
+#wp_delgallery:hover {
+	border-color: #555;
+	background-color: #ccc;
+}
+
+#favorite-first {
+	background: #797979 url(../images/fav.png) repeat-x left center;
+	border-color: #777 !important;
+	border-bottom-color: #666 !important;
+}
+
+#favorite-inside {
+	border-color: #797979;
+	background-color: #797979;
+}
+
+#favorite-toggle {
+	background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;
+}
+
+#favorite-actions a {
+	color: #ddd;
+}
+
+#favorite-actions a:hover {
+	color: #fff;
+}
+
+#favorite-inside a:hover {
+	text-decoration: underline;
+}
+
+#favorite-actions .slide-down {
+	border-bottom-color: #626262;
+}
+
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+	text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+.button-primary,
+.submit .button-primary {
+	text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
+}
+
+#screen-meta a.show-settings {
+	background-color: transparent;
+	text-shadow: rgba(255,255,255,0.7) 0 1px 0;
+}
+
+#icon-edit,
+#icon-post {
+	background: transparent url(../images/icons32.png) no-repeat -552px -5px;
+}
+
+#icon-index {
+	background: transparent url(../images/icons32.png) no-repeat -137px -5px;
+}
+
+#icon-upload {
+	background: transparent url(../images/icons32.png) no-repeat -251px -5px;
+}
+
+#icon-link-manager,
+#icon-link,
+#icon-link-category {
+	background: transparent url(../images/icons32.png) no-repeat -190px -5px;
+}
+
+#icon-edit-pages,
+#icon-page {
+	background: transparent url(../images/icons32.png) no-repeat -312px -5px;
+}
+
+#icon-edit-comments {
+	background: transparent url(../images/icons32.png) no-repeat -72px -5px;
+}
+
+#icon-themes {
+	background: transparent url(../images/icons32.png) no-repeat -11px -5px;
+}
+
+#icon-plugins {
+	background: transparent url(../images/icons32.png) no-repeat -370px -5px;
+}
+
+#icon-users,
+#icon-user-edit {
+	background: transparent url(../images/icons32.png) no-repeat -600px -5px;
+}
+
+#icon-tools,
+#icon-admin {
+	background: transparent url(../images/icons32.png) no-repeat -432px -5px;
+}
+
+#icon-options-general {
+	background: transparent url(../images/icons32.png) no-repeat -492px -5px;
+}
+
+.view-switch #view-switch-list {
+	background: transparent url(../images/list.png) no-repeat 0 0;
+}
+
+.view-switch #view-switch-list.current {
+	background: transparent url(../images/list.png) no-repeat -40px 0;
+}
+
+.view-switch #view-switch-excerpt {
+	background: transparent url(../images/list.png) no-repeat -20px 0;
+}
+
+.view-switch #view-switch-excerpt.current {
+	background: transparent url(../images/list.png) no-repeat -60px 0;
+}
+
+#header-logo {
+	background: transparent url(../images/wp-logo.gif) no-repeat scroll center center;
+}</diff>
      <filename>wp-admin/css/colors-fresh.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,62 +1,93 @@
-/* Right Now */
-#rightnow {
-	margin-right:0;
-	margin-left: 7px;
+#dashboard-widgets-wrap .has-sidebar {
+	margin-right: 0;
+	margin-left: -51%;
 }
-#rightnow .reallynow span {
-	text-align: right;
-	float: right;
+#dashboard-widgets-wrap .has-sidebar .has-sidebar-content {
+	margin-right: 0;
+	margin-left: 51%;
+}
+.view-all {
+	right: auto;
+	left: 0;
 }
-#rightnow .reallynow a {
+#dashboard_right_now p.sub, #dashboard-widgets h4, #dashboard_quick_press h4, a.rsswidget, #dashboard_plugins h4, #dashboard_plugins h5, #dashboard_recent_comments .comment-meta .approve {
+	font-family: Tahoma, Arial;
+}
+#dashboard_right_now td.b {
+	padding-right: 0;
+	padding-left: 6px;
 	text-align: left;
+	font-family: Tahoma, Arial;
+}
+#dashboard_right_now .t {
+	padding-right: 0;
+	padding-left: 12px;
+}
+#dashboard_right_now .versions a {
+	font-family: Tahoma, Arial;
+}
+#dashboard_right_now a.button {
 	float: left;
-	margin: 1px 0 0 6px;
+	clear: left;
 }
-/* Widgets */
-div#dashboard-widgets-wrap {
-	margin-right:0;
-	margin-left:-13px;
+#dashboard-widgets h3 .postbox-title-action {
+	right: auto;
+	left: 30px;
 }
-div.dashboard-widget-holder {
-	float:right;
+#the-comment-list .pingback {
+	padding-left: 0 !important;
+	padding-right: 9px !important;
 }
-div.dashboard-widget {
-	margin-right:0;
-	margin-left: 20px;
+/* Recent Comments */
+#the-comment-list .comment-item {
+	padding: 1em 70px 1em 10px;
 }
-h3.dashboard-widget-title span {
-	text-align: right;
+#the-comment-list .comment-item .avatar {
 	float: right;
+	margin-left: 0;
+	margin-right: -60px;
 }
-h3.dashboard-widget-title small {
+/* Feeds */
+.rss-widget cite {
 	text-align: left;
-	float:left;
-}
-div.dashboard-widget-submit input  {
-	font-family: Tahoma;
 }
-div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl {
-	padding-left:0;
-	padding-right:15px;
+.rss-widget span.rss-date {
+	font-family: Tahoma, Arial;
+	margin-left: 0;
+	margin-right: 3px;
 }
-#dashboard_secondary div.dashboard-widget-content ul li {
-	float:right;
+/* QuickPress */
+#dashboard_quick_press h4 {
+	float: right;
+	text-align: left;
 }
-#dashboard_secondary div.dashboard-widget-content ul li .post {
-	font-family:arial;
+#dashboard_quick_press h4 label {
+	margin-right: 0;
+	margin-left: 10px;
 }
-#dashboard_secondary div.dashboard-widget-content ul li a {
-	border-right:0 none;
-	border-left: 1px solid #dadada;
-	height:110px;
+#dashboard_quick_press .input-text-wrap, #dashboard_quick_press .textarea-wrap {
+	margin: 0 5em 1em 0;
 }
-#dashboard_secondary div.dashboard-widget-content ul li a cite {
-	font-family: Tahoma;
+#dashboard_quick_press #media-buttons {
+	margin: 0 5em .5em 0;
+	padding: 0 10px 0 0;
 }
-#dashboard-widgets .widget_rss ul li span.rss-date {
-	float:right;
+#dashboard-widgets #dashboard_quick_press form p.submit {
+	margin-left: 0;
+	margin-right: 4.6em;
 }
-#dashboard-widgets .widget_rss ul li a {
+#dashboard-widgets #dashboard_quick_press form p.submit input {
 	float: right;
-	margin: 0 0 .2em .5em;
+}
+#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
+	margin: 0 10px 0 1em;
+}
+#dashboard-widgets #dashboard_quick_press form p.submit #publish {
+	float: left;
+}
+/* Recent Drafts */
+#dashboard_recent_drafts h4 abbr {
+	font-family: Tahoma, Arial;
+	margin-left:0;
+	margin-right: 3px;
 }</diff>
      <filename>wp-admin/css/dashboard-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,282 +1,396 @@
-/* Right Now */
+.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; }
+
+.edit-box {
+	display: none;
+}
+
+h3:hover .edit-box {
+	display: inline;
+}
 
-#rightnow {
+form .input-text-wrap {
+	border-style: solid;
 	border-width: 1px;
+	padding: 2px 3px;
+	border-color: #ccc;
+}
+
+#dashboard-widgets form .input-text-wrap input {
+	border: 0 none;
+	outline: none;
+	margin: 0;
+	padding: 0;
+	width: 99%;
+	color: #333;
+}
+
+form .textarea-wrap {
 	border-style: solid;
+	border-width: 1px;
 	padding: 2px;
-	margin-top: 10px;
-	margin-right: 7px;
+	border-color: #ccc;
 }
 
-#rightnow .reallynow {
-	padding: 6px;
-	font-size: 15px;
-	line-height: 2;
+#dashboard-widgets form .textarea-wrap textarea {
+	border: 0 none;
+	padding: 0;
+	outline: none;
+	width: 99%;
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+#dashboard-widgets .postbox form .submit {
+	float: none;
+	margin: .5em 0 0;
+	padding: 0;
+	border: none;
+}
+
+#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input {
 	margin: 0;
 }
 
-#rightnow .rbutton {
-	font-weight: normal;
-	padding: 6px;
-	border-bottom: none;
-	-moz-border-radius: 2px;
-	-khtml-border-radius: 2px;
-	-webkit-border-radius: 2px;
-	border-radius: 2px;
-	text-decoration: none;
+#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
+	min-width: 0;
 }
 
-#rightnow .reallynow span {
-	display: block;
-	text-align: left;
-	float: left;
-	padding: 0 6px;
+#dashboard-widgets-wrap .has-sidebar {
+	margin-right: -51%;
 }
 
-#rightnow .reallynow a {
-	display: block;
-	text-align: right;
-	float: right;
-	padding: 0 6px;
-	font-size: 14px;
-	margin: 1px 6px 0 0;
+#dashboard-widgets-wrap .inner-sidebar {
+	width: 49%;
 }
 
-#rightnow .youhave {
-	font-size:  14px;
-	padding: 10px;
+#dashboard-widgets-wrap .has-sidebar .has-sidebar-content {
+	margin-right: 51%;
 }
 
-#rightnow h3, #rightnow p {
-	padding: 0 10px;
+div.postbox div.inside {
+	margin: 10px;
+	position: relative;
 }
 
-#rightnow a {
-	font-weight: bold;
+#dashboard-widgets a {
+	text-decoration: none;
 }
 
-/* Widgets */
+#dashboard-widgets h3 a {
+	text-decoration: underline;
+}
 
-div#dashboard-widgets-wrap {
-	margin-top: -20px;
-	margin-right: -13px; /* 20 (div.dashboard-widget margin-right) - 7 (#rightnow margin-right) */
+#dashboard-widgets h3 .postbox-title-action {
+	position: absolute;
+	right: 30px;
+	padding: 0;
 }
 
-div#dashboard-widgets {
-	width: 100%;
+#dashboard-widgets h4 {
+	font-family: Georgia, &quot;Times New Roman&quot;, &quot;Bitstream Charter&quot;, Times, serif;
+	font-size: 13px;
+	margin: 0 0 .2em;
+	padding: 0;
 }
 
-div.dashboard-widget-holder {	
-	margin-top: 20px;
-	width: 50%;
-	float: left;
+/* Right Now */
+
+#dashboard_right_now p.sub,
+#dashboard_right_now .table, #dashboard_right_now .versions {
+	margin: -12px;
+}
+
+#dashboard_right_now .inside {
+	font-size: 12px;
 }
 
-div.dashboard-widget-holder.third {
-	width: 33.3%;
+#dashboard_right_now p.sub {
+	font-style: italic;
+	font-family: Georgia, &quot;Times New Roman&quot;, &quot;Bitstream Charter&quot;, Times, serif;
+	padding: 5px 10px 15px;
+	color: #777;
+	font-size: 13px;
 }
 
-div.dashboard-widget-holder.fourth {
-	width: 25%;
+#dashboard_right_now .table {
+	background: #f9f9f9;
+	border-top: #ececec 1px solid;
+	border-bottom: #ececec 1px solid;
+	margin: 0 -9px 10px;
+	padding: 0 10px;
 }
 
-div.dashboard-widget-holder.full {
+#dashboard_right_now table {
 	width: 100%;
 }
 
-div.dashboard-widget-holder.double div.dashboard-widget {
-	height: 54em;
-	padding-bottom: 28px /* lame */
+#dashboard_right_now table  td {
+	border-top: #ececec 1px solid;
+	padding: 3px 0;
+	white-space: nowrap;
 }
 
-div.dashboard-widget {
-	position: relative;
-	margin-right: 20px;
-	border-width: 1px;
-	border-style: solid;
-	padding: 2px;
-	height: 27em;
-	overflow: auto;
-	font-size: 11px;
+#dashboard_right_now table tr.first td {
+	border-top: none;
 }
 
-h3.dashboard-widget-title  {
-	margin: 0;
-	padding: 0 7px;
+#dashboard_right_now td.b {
+	padding-right: 6px;
+	text-align: right;
+	font-family: Georgia, &quot;Times New Roman&quot;, &quot;Bitstream Charter&quot;, Times, serif;
 	font-size: 14px;
-	line-height: 2;
 }
 
-h3.dashboard-widget-title span {
-	display: block;
-	text-align: left;
-	float: left;
+#dashboard_right_now td.b a {
+	font-size: 18px;
 }
 
-h3.dashboard-widget-title small {
-	display: block;
-	text-align: right;
-	float: right;
-	font-size: 75%;
-	line-height: 2.67; /* math: it works, bitches */
+#dashboard_right_now td.b a:hover {
+	color: #d54e21;
 }
 
-h3.dashboard-widget-title img.rss-icon {
-	vertical-align: middle;
-	margin: .5em 0;
+#dashboard_right_now .t {
+	font-size: 12px;
+	padding-right: 12px;
+	padding-top: 6px;
+	color: #777;
 }
 
-div.dashboard-widget-notice {
-	padding: 0 14px;
-	font-size: 1.2em;
-	line-height: 2;
+#dashboard_right_now td.first,
+#dashboard_right_now td.last {
+	width: 1px;
 }
 
-div.dashboard-widget-error {
-	padding: 0 20px;
-	font-size: 1.2em;
-	line-height: 2;
+#dashboard_right_now .spam {
+	color: red;
 }
 
-div.dashboard-widget-content {
-	padding: 10px 15px;
+#dashboard_right_now .waiting {
+	color: orange;
 }
 
-div.dashboard-widget-submit {
-	border-top: 1px solid #ccc;
-	padding: 1em 0 0 0;
-	margin: 10px 0 0 0;
+#dashboard_right_now .approved {
+	color: green;
 }
-div.dashboard-widget-submit input {
-	font-family: &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
-	padding: 4px 6px;
-	border: none;
-	font-size: 13px;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	cursor: pointer;
-	text-decoration: none;	
+
+#dashboard_right_now .versions {
+	padding: 6px 10px 12px;
 }
 
-div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl {
-	margin: 0;
-	text-indent: 0;
-	padding-left: 15px;
+#dashboard_right_now .versions .b {
+	font-weight: bold;
+}
+
+#dashboard_right_now a.button {
+	float: right;
+	clear: right;
+	position: relative;
+	top: -5px;
 }
-div.dashboard-widget-content li {
-	margin: .5em 0 1em;
+
+/* Recent Comments */
+
+#dashboard_recent_comments h3 {
+	margin-bottom: 0;
 }
 
-div.dashboard-widget-content blockquote {
-	margin: -1em 0;
+#dashboard_recent_comments .inside {
+	margin-top: 0;
 }
 
-div#dashboard_recent_comments p {
-	font-size: 14px;
+#dashboard_recent_comments .comment-meta .approve {
+	font-style: italic;
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+	font-size: 10px;
 }
 
-div.dashboard-widget-content p.comment-meta {
-	font-size: 11px !important;
+#the-comment-list {
+	position: relative;
 }
 
-#dashboard_secondary div.dashboard-widget {
-	height: auto;
+#the-comment-list .comment-item {
+	padding: 1em 10px 1em 70px;
+	border-top: 1px solid;
 }
 
-#dashboard_secondary div.dashboard-widget-content ul {
-	list-style: none;
-	padding: 0;
+#the-comment-list .pingback {
+	padding-left: 9px !important;
 }
 
-#dashboard_secondary div.dashboard-widget-content ul li {
-	display: block;
-	width: 19.95%;
-	padding-bottom: 10px;
-	margin: 0;
+#the-comment-list .comment-item,
+#the-comment-list #replyrow {
+	margin: 0 -10px;
+}
+
+#the-comment-list .comment-item:first-child {
+	border-top: none;
+}
+
+#the-comment-list .comment-item .avatar {
 	float: left;
-	font-size: 95%;
+	margin-left: -60px;
 }
 
-#dashboard_secondary div.dashboard-widget-content {
-	margin: 10px 5px;
-	padding: 0;
+#the-comment-list .comment-item h4 {
+	line-height: 1.4;
+	margin-top: -.2em;
+	font-weight: normal;
+	color: #999;
 }
 
-#dashboard_secondary div.dashboard-widget-content ul li .post {
-	display:block;
-	font-family:Georgia,&quot;Times New Roman&quot;,Times,serif;
-	font-size:18px;
-	line-height: 1.2em;
-	height:90px;
-	overflow:hidden;
+#the-comment-list .comment-item h4 cite {
+	font-style: normal;
+	font-weight: normal;
 }
 
-#dashboard_secondary div.dashboard-widget-content ul li a {
-	display: block;
-	height:100%;
-	overflow:hidden;
-	margin: 5px 10px;
-	text-decoration: none;
-	padding: .5em;
-	border-right: 1px solid #dadada;
-	border-bottom: 1px solid #dadada;
+#the-comment-list .comment-item blockquote,
+#the-comment-list .comment-item blockquote p {
+	margin: 0;
+	padding: 0;
+	display: inline;
 }
 
-#dashboard_secondary div.dashboard-widget-content ul li a cite {
+#dashboard_recent_comments #the-comment-list .trackback blockquote,
+#dashboard_recent_comments #the-comment-list .pingback blockquote {
 	display: block;
-	font-family: &quot;Lucida Sans&quot;, &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
 }
 
-#dashboard-widgets .widget_rss ul {
-	list-style: none;
+#the-comment-list .comment-item p.row-actions {
+	margin: 3px 0 0;
 	padding: 0;
+	font-size: 10px;
 }
 
-#dashboard-widgets .widget_rss ul li {
+/* QuickPress */
+
+#dashboard_quick_press h4 {
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+	float: left;
+	width: 5.5em;
 	clear: both;
+	font-weight: normal;
+	text-align: right;
+	padding-top: 5px;
+	font-size: 12px;
+}
+
+#dashboard_quick_press h4 label {
+	margin-right: 10px;
 }
 
-#dashboard-widgets .widget_rss ul li span.rss-date {
+#dashboard_quick_press .input-text-wrap,
+#dashboard_quick_press .textarea-wrap {
+	margin: 0 0 1em 5em;
+}
+
+#dashboard_quick_press #media-buttons {
+	margin: 0 0 .5em 5em;
+	padding: 0 0 0 10px;
+	font-size: 11px;
+}
+
+#dashboard_quick_press #media-buttons a {
+	vertical-align: bottom;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit {
+	margin-left: 4.6em;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit input {
 	float: left;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
+	margin: 0 1em 0 10px;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit #publish {
+	float: right;
+}
+
+/* Recent Drafts */
+#dashboard_recent_drafts ul {
+	margin: 0;
+	padding: 0;
+	list-style: none;
+}
+
+#dashboard_recent_drafts ul li {
+	margin-bottom: 0.6em;
+}
+
+#dashboard_recent_drafts h4 {
+	font-weight: normal;
+}
+
+#dashboard_recent_drafts h4 abbr {
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+	font-size: 11px;
+	color: #999;
+	margin-left: 3px;
+}
+
+#dashboard_recent_drafts p {
 	margin: 0;
+	padding: 0;
 }
 
-#dashboard-widgets .widget_rss ul li a {
-	float: left;
-	margin: 0 .5em .2em 0;
-	font-weight: bold;
+/* Feeds */
+
+.rss-widget ul {
+	margin: 0;
+	padding: 0;
+	list-style: none;
 }
 
-#dashboard-widgets .widget_rss ul li div {
-	clear: both;
+a.rsswidget {
+	font-size: 13px;
+	font-family: Georgia, &quot;Times New Roman&quot;, &quot;Bitstream Charter&quot;, Times, serif;
+	line-height: 1.7em;
+}
+
+.rss-widget ul li {
 	line-height: 1.5em;
+	margin-bottom: 12px;
 }
 
-#dashboard_primary a.rsswidget, #dashboard_plugins h5 {
-	font-size: 14px;
+.rss-widget span.rss-date {
+	margin-left: 3px;
 }
 
-#dashboard_primary span.rss-date {
-	font-size: 14px;
+.rss-widget cite {
+	display: block;
+	text-align: right;
+	margin: 0 0 1em;
+	padding: 0;
 }
 
+.rss-widget cite:before {
+	content: '\2014';
+}
+
+/* Plugins */
+
 #dashboard_plugins h4 {
-	font-size: 1em;
-	margin: 0 0 .1em;
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
 }
 
 #dashboard_plugins h5 {
+	font-family: Georgia, &quot;Times New Roman&quot;, &quot;Bitstream Charter&quot;, Times, serif;
+	font-size: 13px !important;
 	margin: 0;
 	display: inline;
 	line-height: 1.4em;
 }
 
-#dashboard_plugins p {
-	margin: 0 0 1em;
-	line-height: 1.5em;
+#dashboard_plugins h5 a {
+	font-weight: normal;
+	line-height: 1.7em;
 }
 
-.widget-loading {
+#dashboard_plugins p {
+	margin: 0 0 1.4em;
+	line-height: 1.4em;
 }</diff>
      <filename>wp-admin/css/dashboard.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,31 +1,74 @@
-body, td {
-	font-family: Tahoma;
+/* 2 column liquid layout */
+#adminmenu {
+	float: right;
+	clear: right;
+	margin-right:-160px;
+	margin-left: 5px;
 }
-textarea, input, select {
-	font-family: Tahoma;
+div.folded #adminmenu {
+	margin-left: 0;
+	margin-right: -45px;
 }
-h1, h2, h3 {
-	font-family:arial;
+/* inner 2 column liquid layout */
+.inner-sidebar {
+	float: left;
+	clear: left;
 }
-.widefat td {
-	padding: 7px 10px 9px 15px;
+.has-sidebar {
+	float: right;
+	clear: right;
+	margin-right: 0;
+	margin-left: -340px;
+}
+.has-sidebar .has-sidebar-content {
+	margin-right: 0;
+	margin-left: 305px;
+}
+#wpbody {
+	margin-left:0;
+	margin-right: 175px;
+}
+.folded #wpbody {
+	margin-left: 0;
+	margin-right: 60px;
+}
+#wpbody-content {
+	float: right;
+}
+/* 2 columns main area */
+#col-right {
+	float: left;
+	clear: left;
+}
+.wrap {
+	margin: 0 5px 0 15px;
+}
+/* styles for use by people extending the WordPress interface */
+body, td, textarea, input, select {
+	font-family: Tahoma, arial;
+}
+.alignleft {
+	float: right;
+}
+.alignright {
+	float: left;
+}
+.subsubsub {
+	float: right;
 }
 .widefat th {
-	padding: 9px 10px 6px 15px;
 	text-align: right;
 }
 .widefat th input {
 	margin: 0 8px 0 0;
 }
-.widefat .check-column {
-	text-align: left;
-}
 .wrap h2 {
-	font-family:arial;
-	margin: 5px -4px 0 0;
-	padding-right:0;
-	padding-left: 280px;
+	font-family: arial;
+	padding: 14px 0 3px 15px;
 }
 .wrap h2.long-header {
 	padding-left: 0;
 }
+.updated, .error {
+	clear: both;
+}</diff>
      <filename>wp-admin/css/global-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,40 +1,244 @@
-/* styles for use by people extending the WordPress interface */
+/* http://meyerweb.com/eric/tools/css/reset/ */
+/* v1.0 | 20080212 */
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+	margin: 0;
+	padding: 0;
+	border: 0;
+	outline: 0;
+/*	font-size: 100%;
+	vertical-align: baseline; */
+	background: transparent;
+}
+body {
+	line-height: 1;
+}
+ol, ul {
+	list-style: none;
+}
+blockquote, q {
+	quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+	content: '';
+	content: none;
+}
 
+/* remember to define focus styles! */
+/*
+:focus {
+	outline: 0;
+}
+*/
+/* remember to highlight inserts somehow! */
+ins {
+	text-decoration: none;
+}
+del {
+	text-decoration: line-through;
+}
 
-body	{
+/* tables still need 'cellspacing=&quot;0&quot;' in the markup */
+/*
+table {
+	border-collapse: collapse;
+	border-spacing: 0;
+}
+*/
+/* end reset css */
+
+
+/* 2 column liquid layout */
+#wpwrap {
+	height: auto;
+	min-height: 100%;
+	width: 100%;
+}
+
+#wpcontent {
+	height: 100%;
+	padding-bottom: 50px;
+}
+
+#wpbody {
+	clear: both;
+	margin-left: 175px;
+}
+
+.folded #wpbody {
+	margin-left: 60px;
+}
+
+#wpbody-content {
+	float: left;
+	width: 100%;
+}
+
+#adminmenu {
+	float: left;
+	clear: left;
+	width: 145px;
+	margin-top: 15px;
+	margin-right: 5px;
+	margin-bottom: 15px;
+	margin-left: -160px;
+	position: relative;
+	padding: 0;
+	list-style: none;
+}
+
+.folded #adminmenu {
+	margin-left: -45px;
+}
+
+.folded #adminmenu,
+.folded #adminmenu li.menu-top {
+	width: 28px;
+}
+
+#footer {
+	clear: both;
+	position: relative;
+	width: 100%;
+}
+
+/* inner 2 column liquid layout */
+
+.inner-sidebar {
+	float: right;
+	clear: right;
+	width: 280px;
+	position: relative;
+}
+
+.has-sidebar {
+	float: left;
+	clear: left;
+	width: 100%;
+	margin-right: -340px;
+}
+
+.has-sidebar .has-sidebar-content {
+	margin-right: 305px;
+}
+
+/* 2 columns main area */
+
+#col-container {
+	overflow: hidden;
+	padding: 0;
 	margin: 0;
+}
+
+#col-left {
 	padding: 0;
+	margin: 0;
+	overflow: hidden;
+	width: 39%;
+}
+
+#col-right {
+	float: right;
+	clear: right;
+	overflow: hidden;
+	padding: 0;
+	margin: 0;
+	width: 59%;
+}
+
+/* utility classes */
+.alignleft {
+	float: left;
+}
+
+.alignright {
+	float: right;
+}
+
+.textleft {
+	text-align: left;
 }
 
-body, td {
-	font: 13px &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
+.textright {
+	text-align: right;
 }
 
-form, label input { margin: 0; padding: 0; }
+.clear {
+	clear: both;
+}
 
-img { border: 0; }
+.hidden,
+.closed .inside,
+.hide-if-no-js {
+	display: none;
+}
 
-label { cursor: pointer; }
+/* include margin and padding in the width calculation of input and textarea */
+input[type=&quot;text&quot;],
+textarea {
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	-ms-box-sizing: border-box; /* ie8 only */
+	box-sizing: border-box;
+}
+
+input[type=&quot;checkbox&quot;],
+input[type=&quot;radio&quot;] {
+	vertical-align: text-top;
+}
 
-li, dd { margin-bottom: 6px; }
+/* styles for use by people extending the WordPress interface */
+html,
+body {
+	height: 100%;
+}
 
-p, li, dl, dd, dt { line-height: 140%; }
+body,
+td {
+	font: 13px &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+}
 
-textarea, input, select {
-	font: 13px Verdana, Arial, Helvetica, sans-serif;
-	margin: 1px;
-	padding: 3px;
+p {
+	margin: 1em 0;
 }
 
-.alignleft { float: left; }
-.alignright { float: right; }
+blockquote {
+	margin: 1em;
+}
 
-.textleft { text-align: left; }
-.textright { text-align: right; }
+label {
+	cursor: pointer;
+}
 
-.clear { clear: both; height: 2px; }
+li,
+dd {
+	margin-bottom: 6px;
+}
 
-.hidden { display: none; }
+p,
+li,
+dl,
+dd,
+dt {
+	line-height: 140%;
+}
+
+textarea,
+input,
+select {
+	font: 13px/19px &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+	margin: 1px;
+	padding: 3px;
+}
 
 h1 {
   display: block;
@@ -79,50 +283,105 @@ h6 {
 
 .subsubsub {
 	list-style: none;
-	margin: 14px 0 8px 0;
+	margin: 8px 0 5px;
 	padding: 0;
 	white-space: nowrap;
-	font-size: 12px;
+	font-size: 11px;
+	float: left;
 }
 
-.subsubsub a { line-height: 200%; padding: 3px; text-decoration: none; }
+.subsubsub a {
+	line-height: 2;
+	padding: .2em;
+	text-decoration: none;
+}
 
-.subsubsub a.current { font-weight: bold; background: none; border: none;}
+.subsubsub a .count, .subsubsub a.current .count {
+	color: #999;
+	font-weight: normal;
+}
 
-.subsubsub li { display: inline; margin: 0; padding: 0; }
+.subsubsub a.current {
+	font-weight: bold;
+	background: none;
+	border: none;
+}
+
+.subsubsub li {
+	display: inline;
+	margin: 0;
+	padding: 0;
+}
 
 .widefat {
 	border-width: 1px;
 	border-style: solid;
-	border-collapse: collapse;
+	border-collapse: separate;
+	border-spacing: 0;
 	width: 100%;
 	clear: both;
 	margin: 0;
+	-moz-border-radius: 4px;
+	-khtml-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	border-radius: 4px;
 }
 
-.widefat a {
-	text-decoration: none;
+.widefat * {
+	word-wrap: break-word;
 }
 
-.widefat abbr {
-	white-space: nowrap;
+.widefat a {
+	text-decoration: none;
 }
 
-.widefat td, .widefat th {
+.widefat td,
+.widefat th {
 	border-bottom-width: 1px;
 	border-bottom-style: solid;
-	border-bottom-color: #ccc;
 	font-size: 11px;
 	vertical-align: text-top;
 }
 
 .widefat td {
-	padding: 7px 15px 9px 10px;
+	padding: 7px 7px 5px;
 	vertical-align: top;
 }
 
+.widefat thead tr th:first {
+	-moz-border-radius-topleft: 4px;
+	-webkit-border-top-left-radius: 4px;
+	-khtml-border-top-left-radius: 4px;
+	border-top-left-radius: 4px;
+}
+
+.widefat thead tr th:last {
+	-moz-border-radius-topright: 4px;
+	-webkit-border-top-right-radius: 4px;
+	-khtml-border-top-right-radius: 4px;
+	border-top-right-radius: 4px;
+}
+
+.widefat tfoot tr th:first {
+	-moz-border-radius-bottomleft: 4px;
+	-webkit-border-bottom-left-radius: 4px;
+	-khtml-border-bottom-left-radius: 4px;
+	border-bottom-left-radius: 4px;
+}
+
+.widefat tfoot tr th:last {
+	-moz-border-radius-bottomright: 4px;
+	-webkit-border-bottom-right-radius: 4px;
+	-khtml-border-bottom-right-radius: 4px;
+	border-bottom-right-radius: 4px;
+}
+
+.widefat td p {
+	font-size: 11px;
+}
+
 .widefat th {
-	padding: 9px 15px 6px 10px;
+	padding: 7px 7px 8px;
 	text-align: left;
 	line-height: 1.3em;
 }
@@ -130,69 +389,65 @@ h6 {
 .widefat th input {
 	margin: 0 0 0 8px;
 	padding: 0;
+	vertical-align: text-top;
 }
 
 .widefat .check-column {
-	text-align: right;
-	width: 1.5em;
+	width: 2.2em;
 	padding: 0;
 
 }
 
 .widefat tbody th.check-column {
-	padding: 8px 0 22px;
-}
-/*
-th.check-column + th, th.check-column + td {
-	padding-left: 5px;
+	padding: 7px 0 22px;
 }
-*/
-.widefat .num {
+
+.widefat .num,
+.column-comments,
+.column-links,
+.column-posts,
+.column-parent {
 	text-align: center;
 }
 
-.wrap, .updated, .error {
-	margin: 0;
-	margin-left: 15px;
-	margin-right: 15px;
-	padding: 0;
-	max-width: 980px;
+.widefat th#comments {
+	vertical-align: middle;
 }
 
-.updated, .error {
+.wrap {
+	margin: 0 15px 0 5px;
+}
+
+.updated,
+.error {
 	border-width: 1px;
 	border-style: solid;
 	padding: 0 0.6em;
-	max-width: 950px;
-	margin-bottom: 1em;
-}
-
-.updated p, .error p {
-	margin: 0.6em 0;
+	margin: 5px 15px 2px;
+	-moz-border-radius: 3px;
+	-khtml-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
 }
 
-.wrap .updated, .wrap .error {
-	margin: auto 0 0;
+.updated p,
+.error p {
+	margin: 0.5em 0;
+	line-height: 1;
+	padding: 2px;
 }
 
-.updated a, .error a {
-	text-decoration: underline;
-}
-
-.updated a {
-	text-decoration: none;
-	padding-bottom: 2px;
+.wrap .updated,
+.wrap .error {
+	margin: 5px 0;
 }
 
 .wrap h2 {
-	border-bottom-width: 1px;
-	border-bottom-style: solid;
-	clear: both;
-	font: 24px Georgia, &quot;Times New Roman&quot;, Times, serif;
-	margin: 5px 0 0 -4px;
-	padding: 0;
-	padding-bottom: 7px;
-	padding-right: 280px;
+	font: italic normal normal 24px/29px Georgia, &quot;Times New Roman&quot;, &quot;Bitstream Charter&quot;, Times, serif;
+	margin: 0;
+	padding: 14px 15px 3px 0;
+	line-height: 35px;
+	text-shadow: rgba(255,255,255,1) 0px 1px 0px;
 }
 
 .wrap h2.long-header {</diff>
      <filename>wp-admin/css/global.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,73 +1,91 @@
-#poststuff .postbox h3 {
-	padding-left:0;
-	padding-right: 23px;
+* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle {
+	background: url(../images/menu-bits-rtl.gif) no-repeat scroll right -109px;
 }
-* html #poststuff .postarea, * html #poststuff #titlediv {
+
+* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle {
+	background: url(../images/menu-bits-rtl.gif) no-repeat scroll right -206px;
+}
+* html #adminmenu {
 	margin-left:0;
-	margin-right: 3%;
+	margin-right: -80px;
+}
+* html div.folded #adminmenu {
+	margin-left: 0;
+	margin-right: -22px;
+}
+#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
+	padding: 3px 10px 4px 4px;
+}
+.inline-edit-row fieldset label span.title {
+	float: right;
+}
+.inline-edit-row fieldset label span.input-text-wrap {
+	margin-right: 0;
+}
+p.search-box {
+	float: left;
 }
 * html #poststuff h2 {
 	margin-right: 0;
 }
 #bh {
-	padding-right:0;
-	padding-left: 15px;
+	margin: 7px 10px 0 0;
+	float: left;
+}
+#user_info + div#favorite-actions {
+	right: auto;
+	left: 15px;
+}
+#wphead-info {
+	float: left;
 }
+/* without this dashboard widgets appear in one column for some screen widths */
 div#dashboard-widgets {
-	padding-right:0;
+	padding-right: 0;
 	padding-left: 1px;
 }
 #tagchecklist span a {
 	margin: 4px -9px 0 0;
 }
-#poststuff .togbox {
-	margin-left:0;
-	margin-right: -19px;
-}
 .widefat th input {
 	margin: 0 5px 0 0;
 }
 /* ---------- add by navid */
-#dashmenu { /* fix top right bottom in admin */
-	direction:ltr;
-}
-#sidemenu a { /* fix left admin buttom ex. plugins, options */
-	float:left;
+#TB_window {
+	width: 670px;
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	margin-right: 335px !important;
 }
-.wrap h2 {
-	margin:5px 4px 0 0;
+#dashboard_plugins {
+	direction: ltr;
 }
-#editor-toolbar {/* fix hover in media uploader icon */
-	direction:ltr;
+#dashboard_plugins h3.hndle {
+	direction: rtl;
 }
-#TB_window { /* fix theme preview */
-	left:2%;
+#dashboard_incoming_links ul li,
+#dashboard_secondary ul li,
+#dashboard_primary ul li,
+p.row-actions {
+	width: 100%;
 }
-/* fix widget page */
-form#widgets-filter {
-	position:static;
+#favorite-inside {
+	position: absolute;
+	right:0;
 }
-#widget-search {
-	display:none;
+#post-status-info {
+	height: 25px;
 }
-/* fix manage comment page */
-ul.view-switch li {
-	float:left;
+#screen-meta {
+	position: static;
 }
-form#posts-filter {
-	position:static;
+p.submit { /* quick edit and reply in edit-comments.php */
+	height:22px;
 }
-#post-search {
-	display:none;
+.inner-sidebar { /* fix edit single comment */
+	position: static;
 }
-#submenu {
-	margin-right: 20px;
+form#widgets-filter { /* fix widget page */
+	position: static;
 }
-/* Fixes for media-upload window */
-/* Center media-upload panel on screen */
-#TB_window { 
-	width: 670px; 
-	position: absolute; 
-	top: 50%; 
-	left: 50%; 
-	margin-right: 335px !important; }</diff>
      <filename>wp-admin/css/ie-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,44 @@
 /* Fixes for IE bugs */
 
-#poststuff .postbox h3 {
-	padding-left: 23px;
+input.button,
+input.button-secondary,
+input.button-highlighted {
+	padding: 0;
+}
+
+#minor-publishing-actions input,
+#major-publishing-actions input,
+#minor-publishing-actions .preview {
+	min-width: auto;
+	padding-left: 0;
+	padding-right: 0;
+}
+
+#wpbody-content .postbox {
+	border: 1px solid #dfdfdf;
+}
+
+#wpbody-content .postbox h3 {
+	margin-bottom: -1px;
 }
 
-#submenu li a.current {
-	background:none;
-	border:none;
+* html #side-info-column {
+	height: auto;
 }
 
+* html #wpbody-content #screen-options-link-wrap {
+	display: inline-block;
+	width: 150px;
+	text-align: center;
+}
+
+* html #wpbody-content #contextual-help-link-wrap {
+	display: inline-block;
+	width: 100px;
+	text-align: center;
+}
+
+/*
 * html body.minwidth {
 	_width: expression(document.documentElement.clientWidth &lt; 810 ? &quot;808px&quot; : &quot;99.9%&quot;);
 }
@@ -16,34 +46,225 @@
 * html #wpbody {
 	_width: expression(document.documentElement.clientWidth &gt; 982 ? &quot;980px&quot; : &quot;99.9%&quot;);
 }
+*/
 
-* html #poststuff .postarea, * html #poststuff #titlediv {
-	width: 95%;
-	margin-left: 3%;
+* html #adminmenu {
+	margin-left: -80px;
+}
+
+* html div.folded #adminmenu {
+	margin-left: -22px;
+}
+
+* html #wpcontent #adminmenu li.menu-top {
+	display: inline;
+	padding: 0;
+	margin: 0;
+}
+
+#wpcontent.folded #adminmenu li.menu-top {
+	display: block;
+}
+
+ul#adminmenu {
+	z-index: 99;
+}
+
+#adminmenu li.menu-top a.menu-top {
+	min-width: auto;
+	width: auto;
+}
+
+#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu {
+	font-style: normal;
+}
+
+* html #wpcontent #adminmenu .wp-menu-open .wp-menu-toggle {
+	background: none;
+}
+
+* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle {
+	background: url(../images/menu-bits.gif) no-repeat scroll left -109px;
+}
+
+* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle {
+	background: url(../images/menu-bits.gif) no-repeat scroll left -206px;
+}
+
+* html #adminmenu div.wp-menu-image {
+	height: 29px;
+}
+
+#wpcontent #adminmenu .wp-submenu li {
+	padding: 0;
+}
+
+#adminmenu,
+.wp-submenu,
+.wp-submenu li,
+.wp-menu-toggle {
+	zoom: 100%;
+}
+
+#wpcontent.folded #adminmenu li.wp-menu-separator {
+	width: 28px;
+}
+
+#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
+	padding: 3px 4px 4px 10px;
+	zoom: 100%;
+}
+
+#wpcontent.folded #adminmenu .menu-top {
+	height: 30px;
+}
+
+.folded #adminmenu .wp-submenu {
+	margin: -1px 0 0 0;
+}
+
+#template,
+#template div,
+#editcat,
+#addcat {
+	zoom: 100%;
 }
 
 .submitbox {
 	margin-top: 10px;
 }
 
-* html div.widget-liquid-left-holder, * html div.widget-liquid-right {
+/* Inline Editor */
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+	width: 39%;
+}
+
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+	width: 19%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+	width: 49%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+	width: 29%;
+}
+
+.inline-edit-row p.submit {
+	zoom: 100%;
+}
+
+.inline-edit-row fieldset label span.title {
+	display: block;
+	float: left;
+	width: 5em;
+}
+
+.inline-edit-row fieldset label span.input-text-wrap {
+	margin-left: 0;
+	zoom: 100%;
+}
+
+#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input {
+	line-height: 130%;
+}
+
+#wpbody-content .inline-edit-row .input-text-wrap input {
+	width: 95%;
+}
+
+#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input {
+	width: 8em;
+}
+/* end Inline Editor */
+
+* html .row-actions {
+	visibility: visible;
+}
+
+#dashboard-widgets h3 a {
+	height: 20px;
+	line-height: 20px;
+}
+
+#the-comment-list .comment-item,
+ul#widget-list li.widget-list-item {
+	zoom: 100%;
+}
+
+#wphead-info {
+	float: right;
+}
+
+#titlediv #title {
+	width: 98%;
+}
+
+a.button {
+	line-height: 1.4em;
+	margin: 1px;
+}
+
+* html div.widget-liquid-left-holder,
+* html div.widget-liquid-right {
 	display: block;
 	position: relative;
 }
 
-#wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions {
+#screen-options-wrap {
+	overflow: hidden;
+}
+
+#favorite-actions {
+	z-index: 12;
+}
+
+#favorite-inside,
+#favorite-inside a,
+.favorite-action {
+	zoom: 100%;
+}
+
+#post-status-info,
+#wpwrap,
+#wpcontent,
+#post,
+#wrap,
+#postdivrich,
+#postdiv,
+#poststuff,
+.metabox-holder,
+#titlediv,
+#post-body,
+#editorcontainer,
+.tablenav,
+.widget-control-list,
+li.widget-list-control-item,
+#dragHelper,
+li.widget-list-control-item h4,
+.widget-sortable,
+.widget-control-actions,
+#tagchecklist,
+#col-container,
+#col-left,
+#col-right {
 	display: block;
 	zoom: 100%;
 }
 
+p.search-box {
+	position: static;
+	float: right;
+	margin: -3px 0 4px;
+}
+
 * html #editorcontainer {
 	padding: 0;
 }
 
-* html #editorcontainer #content {
-	position: relative;
+#editorcontainer #content {
 	overflow: auto;
-	padding: 6px;
 	margin: auto;
 	width: 98%;
 }
@@ -66,7 +287,8 @@ form#template div {
 }
 
 #bh {
-	padding-right: 15px;
+	margin: 7px 10px 0 0;
+	float: right;
 }
 
 /* without this dashboard widgets appear in one column for some screen widths */
@@ -74,11 +296,6 @@ div#dashboard-widgets {
 	padding-right: 1px;
 }
 
-#tagchecklist {
-	display: block;
-	zoom: 100%;
-}
-
 #tagchecklist span, #tagchecklist span a {
 	display: inline-block;
 	display: block;
@@ -88,10 +305,6 @@ div#dashboard-widgets {
 	margin: 4px 0 0 -9px;
 }
 
-#poststuff .togbox {
-	margin-left: -19px;
-}
-
 .tablenav .button-secondary, .nav .button-secondary {
 	padding: 0 1px;
 	vertical-align: middle;
@@ -104,23 +317,10 @@ div#dashboard-widgets {
 	margin-top: 2px;
 }
 
-.tablenav-pages .page-numbers {
-	display: inline-block;
-}
-
-.tablenav-pages {
-	display: block;
-	margin-top: -3px;
-}
-
 table.ie-fixed {
 	table-layout: fixed;
 }
 
-#post-search .button, #widget-search .button {
-	padding: 1px;
-}
-
 .widefat tr, .widefat th {
 	margin-bottom: 0;
 	border-spacing: 0;</diff>
      <filename>wp-admin/css/ie.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,27 +1,16 @@
 body {
-	font-family: Tahoma;
+	font-family: Tahoma, arial;
 }
-/* Half the page disapears on IE6 */
-* html body {
-	width: 700px; 
-	position: absolute; 
-	left: 50%; 
-	margin-right: 350px;
-}
-ul, ol {
-	padding: 5px 22px 5px 5px;
-}
-.step, th {
-	text-align:right;
+h1 {
+	font-family: arial;
+	margin: 5px -4px 0 0;
 }
-.submit input, .button, .button-secondary  {
-	font-family: Tahoma;
+ul, ol { padding: 5px 22px 5px 5px; }
+.step, th { text-align: right; }
+.submit input, .button, .button-secondary {
+	font-family: Tahoma, arial;
 	margin-right:0;
 }
 .form-table th {
-	text-align:right;
-}
-h1 {
-	font-family:arial;
-	margin: 5px -4px 0 0;
+	text-align: right;
 }</diff>
      <filename>wp-admin/css/install-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,78 +1,83 @@
-html { background: #f1f1f1; }
+html { background: #f7f7f7; }
 
 body {
 	background: #fff;
 	color: #333;
-	font-family: &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
 	margin: 2em auto 0 auto;
 	width: 700px;
 	padding: 1em 2em;
-	-moz-border-radius: 12px;
-	-khtml-border-radius: 12px;
-	-webkit-border-radius: 12px;
-	border-radius: 12px;
+	-moz-border-radius: 11px;
+	-khtml-border-radius: 11px;
+	-webkit-border-radius: 11px;
+	border-radius: 11px;
+	border: 1px solid #dfdfdf;
 }
 
 a { color: #2583ad; text-decoration: none; }
 
 a:hover { color: #d54e21; }
 
-
 h1 {
-	font-size: 18px;
-	margin-bottom: 0;
+	border-bottom: 1px solid #dadada;
+	clear: both;
+	color: #666;
+	font: 24px Georgia, &quot;Times New Roman&quot;, Times, serif;
+	margin: 5px 0 0 -4px;
+	padding: 0;
+	padding-bottom: 7px;
 }
 
 h2 { font-size: 16px; }
 
 p, li {
 	padding-bottom: 2px;
-	font-size: 13px;
+	font-size: 12px;
 	line-height: 18px;
 }
 
-code {
-	font-size: 13px;
-}
+code { font-size: 13px; }
 
 ul, ol { padding: 5px 5px 5px 22px; }
 
-#logo { margin: 6px 0 14px 0px; border-bottom: none;}
+#logo { margin: 6px 0 14px 0; border-bottom: none;}
 
 .step {
 	margin: 20px 0 15px;
 }
 
-.step input {
-	font-size: 18px;
-}
-
-a.button {
-	font-size: 18px;
-}
-
 .step, th { text-align: left; padding: 0; }
 
 .submit input, .button, .button-secondary {
-	font-family: &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
-	padding: 5px 7px 7px;
-	border: 1px solid #a3a3a3;
-	margin-left: 0;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	color: #246;
-	background: #e5e5e5;
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+	text-decoration: none;
+	font-size: 14px !important;
+	line-height: 16px;
+	padding: 6px 12px;
+	cursor: pointer;
+	border: 1px solid #bbb;
+	color: #464646;
+	-moz-border-radius: 15px;
+	-khtml-border-radius: 15px;
+	-webkit-border-radius: 15px;
+	border-radius: 15px;
+	-moz-box-sizing: content-box;
+	-webkit-box-sizing: content-box;
+	-khtml-box-sizing: content-box;
+	box-sizing: content-box;
+}
+
+.button:hover, .button-secondary:hover, .submit input:hover {
+	color: #000;
+	border-color: #666;
 }
 
-.button-secondary {
-	background: #cee1ef;
+.button, .submit input, .button-secondary {
+	background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
 }
 
-.submit input:hover, .button:hover, .button-secondary:hover {
-	color: #d54e21;
-	border-color: #535353;
+.button:active, .submit input:active, .button-secondary:active {
+	background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
 }
 
 .form-table {
@@ -98,7 +103,7 @@ a.button {
 }
 
 .form-table tr {
-	background: #eaf3fa;
+	background: #f3f3f3;
 }
 
 .form-table code {
@@ -117,26 +122,12 @@ a.button {
 	padding: 2px;
 }
 
-h1 {
-	border-bottom: 1px solid #dadada;
-	clear: both;
-	color: #666666;
-	font: 24px Georgia, &quot;Times New Roman&quot;, Times, serif;
-	margin: 5px 0 0 -4px;
-	padding: 0;
-	padding-bottom: 7px;
-}
-
-#error-page {
-	margin-top: 50px;
-}
+#error-page { margin-top: 50px; }
 
 #error-page p {
-	font-size: 14px;
-	line-height: 16px;
+	font-size: 12px;
+	line-height: 18px;
 	margin: 25px 0 20px;
 }
 
-#error-page code {
-	font-size: 15px;
-}
\ No newline at end of file
+#error-page code { font-family: Consolas, Monaco, Courier, monospace; }</diff>
      <filename>wp-admin/css/install.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,30 @@
 body {
-	font-family: Tahoma;
+	font-family: Tahoma, arial;
 }
 form {
-	margin-left:0;
 	margin-right: 8px;
+	margin-left: 0;
 }
 form .forgetmenot {
-	float:right;
+	float: right;
 }
-#login form .submit input  {
-	font-family: Tahoma;
-}
-form .submit {
-	float:left;
+#login form .submit input {
+	font-family: Tahoma, arial;
 }
+form .submit { float: left; }
 #backtoblog a {
-	left:auto;
-	right:15px;
+	left: auto;
+	right: 15px;
 }
 #login_error, .message {
 	margin: 0 8px 16px 0;
 }
-#nav {
-	margin:0 8px 0 0;
-}
+#nav { margin: 0 8px 0 0; }
 #user_pass, #user_login, #user_email {
-	margin-right:0;
 	margin-left: 6px;
+	margin-right: 0;
+	direction:ltr;
 }
 h1 a {
-	text-decoration:none;
-}
-/* ltr input */
-#user_login, #user_pass {
-	direction:ltr;
+	text-decoration: none;
 }</diff>
      <filename>wp-admin/css/login-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -3,35 +3,56 @@
 body {
 	border-top-width: 30px;
 	border-top-style: solid;
-	font: 12px &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
+	font: 11px &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
 }
 
 form {
 	margin-left: 8px;
 	padding: 16px 16px 40px 16px;
-	font-weight: bold;
-	-moz-border-radius: 5px;
-	-khtml-border-radius: 5px;
-	-webkit-border-radius: 5px;
+	font-weight: normal;
+	-moz-border-radius: 11px;
+	-khtml-border-radius: 11px;
+	-webkit-border-radius: 11px;
 	border-radius: 5px;
+	background: #fff;
+	border: 1px solid #e5e5e5;
+	-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
+	-webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
+	-khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
+	box-shadow: rgba(200,200,200,1) 0 4px 18px;
 }
 
-form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0;}
+form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0; }
 
 #login form .submit input {
-	font-family: &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
-	padding: 3px 5px;
+	font-family: &quot;Lucida Grande&quot;, Verdana, Arial, &quot;Bitstream Vera Sans&quot;, sans-serif;
+	padding: 3px 10px;
 	border: none;
-	font-size: 13px;
+	font-size: 12px;
 	border-width: 1px;
 	border-style: solid;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	cursor: default;
-	text-decoration: none;	
-	margin-top: -6px;
+	-moz-border-radius: 11px;
+	-khtml-border-radius: 11px;
+	-webkit-border-radius: 11px;
+	border-radius: 11px;
+	cursor: pointer;
+	text-decoration: none;
+	margin-top: -3px;
+	text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
+}
+
+#login form p {
+	margin-bottom: 0;
+}
+
+label {
+	color: #777;
+	font-size: 13px;
+}
+
+form .forgetmenot label {
+	font-size: 11px;
+	line-height: 19px;
 }
 
 form .submit { float: right; }
@@ -39,15 +60,19 @@ form .submit { float: right; }
 form p { margin-bottom: 24px; }
 
 h1 a {
-	background: url(../images/logo-login.gif) no-repeat;
-	width: 292px;
-	height: 66px;
+	background: url(../images/logo-login.gif) no-repeat top center;
+	width: 326px;
+	height: 67px;
 	text-indent: -9999px;
 	overflow: hidden;
 	padding-bottom: 15px;
 	display: block;
 }
 
+#nav {
+	text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
 #backtoblog a {
 	position: absolute;
 	top: 7px;
@@ -55,20 +80,28 @@ h1 a {
 	text-decoration: none;
 }
 
-#login { width: 292px; margin: 7em auto; }
+#login { width: 320px; margin: 7em auto; }
 
 #login_error, .message {
 	margin: 0 0 16px 8px;
 	border-width: 1px;
 	border-style: solid;
 	padding: 12px;
+	-moz-border-radius: 3px;
+	-khtml-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
 }
 
 #nav { margin: 0 0 0 8px; padding: 16px; }
 
 #user_pass, #user_login, #user_email {
-	font-size: 20px;
+	font-size: 24px;
 	width: 97%;
 	padding: 3px;
+	margin-top: 2px;
 	margin-right: 6px;
-}
\ No newline at end of file
+	margin-bottom: 16px;
+	border: 1px solid #e5e5e5;
+	background: #fbfbfb;
+}</diff>
      <filename>wp-admin/css/login.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,66 +1,93 @@
 body#media-upload ul#sidemenu {
-	left:auto;
-	right:0;
-	width: 620px;
+	left: auto;
+	right: 0;
 }
 #search-filter {
-	text-align:left;
+	text-align: left;
 }
+/* specific to the image upload form */
 .align .field label {
 	padding: 0 28px 0 0;
 	margin: 0 0 0 1em;
 }
 .image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
-	background-position:center right;
+	background-position: center right;
+}
+tr.image-size div.image-size-item {
+	float: right;
 }
 tr.image-size label {
-	margin: 0 0 0 1em;
+	margin: 0 1em 0 0;
 }
 .filename.original {
 	float: right;
 }
 .crunching {
 	text-align: left;
-	margin-right:0;
+	margin-right: 0;
 	margin-left: 5px;
 }
 button.dismiss {
-	right:auto;
-	left:5px;
+	right: auto;
+	left: 5px;
 }
 .file-error {
 	margin: 0 50px 5px 0;
 }
 .progress {
-	left:auto;
-	right:0;
+	left: auto;
+	right: 0;
+}
+.describe td {
+	padding: 0 0 0 5px;
 }
 .bar {
-	border-right-width:0;
+	border-right-width: 0;
 	border-left-width: 3px;
+	border-right-style: none;
 	border-left-style: solid;
 }
 .media-item .pinkynail {
-	float:right;
+	float: right;
 }
-.describe-toggle-on, .describe-toggle-off {
+.describe-toggle-on,
+.describe-toggle-off {
 	float: left;
-	margin-right:0;
+	margin-right: 0;
 	margin-left: 20px;
 }
 /* Specific to Uploader */
-
 #media-upload .media-upload-form p {
 	margin: 0 0 1em 1em;
 }
 .filename {
 	float: right;
-	margin-left:0;
+	margin-left: 0;
 	margin-right: 10px;
 }
 #media-upload .describe th.label {
-	text-align:right;
+	text-align: right;
 }
 .menu_order {
-	float:left;
+	float: left;
+}
+.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help {
+	font-family: Tahoma, Arial;
+}
+#gallery-settings #basic th.label {
+	padding: 5px 0 5px 5px;
+}
+#gallery-settings .title, h3.media-title {
+	font-family: Tahoma, Arial;
+}
+#gallery-settings .describe th.label {
+	text-align: right;
+}
+#gallery-settings label,
+#gallery-settings legend {
+	margin-right: 0;
+	margin-left: 15px;
+}
+#gallery-settings .align .field label {
+	margin: 0 0 0 1.5em;
 }</diff>
      <filename>wp-admin/css/media-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -29,17 +29,21 @@ form {
 	text-align: right;
 }
 
-.media-upload-form label, .media-upload-form legend {
-	display:block;
+.media-upload-form label,
+.media-upload-form legend {
+	display: block;
 	font-weight: bold;
 	font-size: 13px;
 	margin-bottom: 0.5em;
 	margin: 0 0 0.5em 0;
 }
 
-th { position: relative; }
+th {
+	position: relative;
+}
 
 .media-upload-form label.form-help, td.help {
+	font-family: &quot;Lucida Grande&quot;, &quot;Bitstream Vera Sans&quot;, Verdana, Arial, sans-serif;
 	font-style: italic;
 	font-weight: normal;
 }
@@ -63,6 +67,7 @@ th { position: relative; }
 	padding: 0 0 0 28px;
 	margin: 0 1em 0 0;
 }
+
 .image-align-none-label {
 	background: url(../images/align-none.png) no-repeat center left;
 }
@@ -79,14 +84,21 @@ th { position: relative; }
 	background: url(../images/align-right.png) no-repeat center left;
 }
 
-#flash-upload-ui, .insert-gallery {
-	display: none;
+tr.image-size td {
+	width: 460px;
+}
+
+tr.image-size div.image-size-item {
+	float: left;
+	width: 25%;
+	margin: 0;
 }
 
 tr.image-size label {
 	display: inline;
-	margin: 0 1em 0 0;
+	margin: 0 0 0 1em;
 }
+
 .pinkynail {
 	max-width: 40px;
 	max-height: 40px;
@@ -95,38 +107,49 @@ tr.image-size label {
 .filename.original {
 	float: left;
 }
+
 .crunching {
 	display: block;
 	line-height: 32px;
 	text-align: right;
 	margin-right: 5px;
 }
+
 button.dismiss {
 	position: absolute;
-	top: 5px;
+	top: 7px;
 	right: 5px;
 	z-index: 4;
+	width: 8em;
 }
+
 .file-error {
-	margin: 0 0 5px 50px;
+	float: left;
 	font-weight: bold;
+	padding: 10px;
 }
 
 .progress {
 	position: absolute;
-	top: 0px;
-	left: 0px;
+	top: 0;
+	left: 0;
 	width: 623px;
 	height: 36px;
 }
+
 .bar {
-	width: 0px;
+	width: 0;
 	height: 100%;
 	border-right-width: 3px;
 	border-right-style: solid;
 }
 
-#library-form .progress, #gallery-form .progress {
+#library-form .progress,
+#gallery-form .progress,
+#flash-upload-ui,
+.insert-gallery,
+.describe.startopen,
+.describe.startclosed {
 	display: none;
 }
 
@@ -134,6 +157,7 @@ button.dismiss {
 	max-width: 128px;
 	max-height: 128px;
 }
+
 .media-item .pinkynail {
 	float: left;
 	margin: 2px;
@@ -144,7 +168,9 @@ button.dismiss {
 thead.media-item-info tr {
 	background-color: transparent;
 }
-thead.media-item-info th, thead.media-item-info td {
+
+thead.media-item-info th,
+thead.media-item-info td {
 	border: none;
 	margin: 0;
 }
@@ -153,41 +179,46 @@ thead.media-item-info th, thead.media-item-info td {
 	border: 8px solid #fff;
 }
 
-.describe.startopen, .describe.startclosed {
-	display: none;
-}
 abbr.required {
 	text-decoration: none;
 	border: none;
 }
+
 .describe label {
 	display: inline;
 }
+
 .describe td {
 	vertical-align: middle;
+	padding: 0 5px 0 0;
 }
+
 .describe td.A1 {
 	width: 132px;
 }
-.describe input[type=&quot;text&quot;], .describe textarea {
+
+.describe input[type=&quot;text&quot;],
+.describe textarea {
 	width: 460px;
+	border-width: 1px;
+	border-style: solid;
 }
-.describe-toggle-on, .describe-toggle-off {
+
+.describe-toggle-on,
+.describe-toggle-off {
 	display: block;
 	line-height: 36px;
 	float: right;
 	margin-right: 20px;
 }
+
 .describe-toggle-off {
 	display: none;
 }
 
-.clickmask {
-}
-
 .hidden {
-	height: 0px;
-	width: 0px;
+	height: 0;
+	width: 0;
 	overflow: hidden;
 	border: none;
 }
@@ -202,13 +233,17 @@ abbr.required {
 	padding: 1em 0;
 }
 
-#media-upload p.help {
+#media-upload p.help,
+#media-upload label.help {
+	font-family: &quot;Lucida Grande&quot;, &quot;Bitstream Vera Sans&quot;, Verdana, Arial, sans-serif;
 	font-style: italic;
 	font-weight: normal;
 }
+
 #media-upload tr.image-size td.field {
 	text-align: center;
 }
+
 #media-upload #media-items {
 	border-width: 1px;
 	border-style: solid;
@@ -235,21 +270,29 @@ abbr.required {
 	overflow: hidden;
 	max-width: 430px;
 }
+
 #media-upload .describe {
-	border-top-width: 1px;
-	border-top-style: solid;
 	padding: 5px;
 	width: 100%;
 	clear: both;
 	cursor: default;
 }
+
+#media-upload .slidetoggle {
+	border-top-width: 1px;
+	border-top-style: solid;
+}
+
 #media-upload .describe th.label {
 	padding-top: .5em;
 	text-align: left;
+	min-width: 120px;
 }
+
 #media-upload tr.align td.field {
 	text-align: center;
 }
+
 #media-upload tr.image-size {
 	margin-bottom: 1em;
 	height: 3em;
@@ -264,10 +307,11 @@ abbr.required {
 }
 
 #filter .tablenav select {
-	border-style:solid;
-	border-width:1px;
-	padding:2px;
-	vertical-align:top;
+	border-style: solid;
+	border-width: 1px;
+	padding: 2px;
+	vertical-align: top;
+	width: auto;
 }
 
 #media-upload a.delete,
@@ -287,7 +331,7 @@ abbr.required {
 }
 
 .menu_order_input {
-	border: 1px solid #DDDDDD;
+	border: 1px solid #ddd;
 	font-size: 10px;
 	padding: 1px;
 	width: 23px;
@@ -301,8 +345,8 @@ abbr.required {
 }
 
 #media-upload th.order-head {
-	 width: 25%;
-	 text-align: center;
+	width: 25%;
+	text-align: center;
 }
 
 #media-upload .widefat {
@@ -313,3 +357,70 @@ abbr.required {
 .sorthelper {
 	z-index: -1;
 }
+
+#gallery-settings th.label {
+	width: 160px;
+}
+
+#gallery-settings #basic th.label {
+	padding: 5px 5px 5px 0;
+}
+
+#gallery-settings .title {
+	clear: both;
+	padding: 0 0 3px;
+	border-bottom-style: solid;
+	border-bottom-width: 1px;
+	font-family: Georgia,&quot;Times New Roman&quot;,Times,serif;
+	font-size: 1.6em;
+	border-bottom-color: #DADADA;
+	color: #5A5A5A;
+}
+
+h3.media-title  {
+	color: #5A5A5A;
+	font-family: Georgia,&quot;Times New Roman&quot;,Times,serif;
+	font-size: 1.6em;
+	font-weight: normal;
+}
+
+#gallery-settings .describe td {
+	vertical-align: middle;
+	height: 3.5em;
+}
+
+#gallery-settings .describe th.label {
+	padding-top: .5em;
+	text-align: left;
+}
+
+#gallery-settings .describe {
+	padding: 5px;
+	width: 615px;
+	clear: both;
+	cursor: default;
+}
+
+#gallery-settings .describe select {
+	width: 15em;
+	border: 1px solid #dfdfdf;
+}
+
+#gallery-settings label,
+#gallery-settings legend {
+	font-size: 13px;
+	color: #464646;
+	margin-right: 15px;
+}
+
+#gallery-settings .align .field label {
+	margin: 0 1.5em 0 0;
+}
+
+#gallery-settings p.ml-submit {
+	border-top: 1px solid #dfdfdf;
+}
+
+#gallery-settings select#columns {
+	width: 6em;
+}</diff>
      <filename>wp-admin/css/media.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,98 +1,106 @@
 body {
-	font-family: Tahoma;
+	font-family: Tahoma, Arial;
 }
-.ui-tabs-nav {
-	padding-left:0;
-	padding-right:8px;
-}
-.ui-tabs-nav li {
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+	margin: 0px 0 0 5px;
 	float: right;
 }
-.button {
-	font-family: Tahoma;
-	margin-left:0;
-	margin-right: 5px;
+/* Editor/Main Column */
+div#poststuff {
+	padding-left: 0;
+	padding-right: 10px;
 }
-#wphead #viewsite {
-	margin-left:0;
-	margin-right: 10px;
+.posting {
+	margin-right: 0;
+	margin-left: 228px;
+	left:auto;
+	right: 0;
 }
-#viewsite {
-	right:auto;
-	left: 8px;
+#side-info-column {
+	float: left;
+	right: auto;
+	left: 0;
+	margin-right: 0;
+	margin-left: 10px;
 }
-#wphead #viewsite a {
-	font-family: Tahoma;
+#side-info-column .sleeve {
+	padding-left: 0;
+	padding-right: 10px;
 }
-h1 {
-	right:auto;
-	left:0;
+h3.tb {
+	margin-left: 0;
+	margin-right: 5px;
 }
-div#posting {
-	padding-left:0;
-	padding-right: 16px;
+#actions {
+	float: left;
 }
-#photo_directions span {
-	right:auto;
-	left:3px;
+#extra_fields #actions {
+	right: auto;
+	left: 4px;
 }
-#img_container a {
-	float:right;
+#actions li {
+	float: right;
+	margin-right: 0;
+	margin-left: 10px;
+}
+#extra_fields .button {
+	margin-right: 0;
+	margin-left: 5px;
 }
-#img_container a, #img_container a:link, #img_container a:visited {
-	margin:0 0 4px 4px;
+/* Photo Styles */
+#img_container a {
+	float: right;
 }
-div#categories {
-	right:auto;
-	left:16px;
+#category-add input, #category-add select {
+	font-family: Tahoma, Arial;
 }
-div#categories h2 {
-	margin: .5em 1em .5em 0;
+#categorydiv ul.categorychecklist ul {
+	margin-left: 0;
+	margin-right: 18px;
 }
+/* Tags */
 #tagsdiv #newtag {
-	margin-right:0;	
-	margin-left: 5px;	
-}
-#jaxtag {
-	padding-left:0;
-	padding-right: 1em;
+	margin-right: 0;
+	margin-left: 5px;
 }
-#tagchecklist {
-	padding-left:0;
-	padding-right: 1em;
+#tagadd {
+	margin-left: 0;
+	margin-right: 3px;
 }
 #tagchecklist span {
-	margin-right: 10px;
 	margin-left: .5em;
+	margin-right: 10px;
 	float: right;
 }
 #tagchecklist span a {
-	margin: 6px -9px 0pt 0;
+	margin: 6px -9px 0 0;
 	float: right;
 }
-.submitbox {
-	float: left;
-}
-.submitbox .submit input {
-	text-align:right;
+#content {
+	margin-left: 0;
+	margin-right: 1%;
 }
-.video_split #extra_fields {
-	float:right;
-}
-.video_split .editor_area {
-	float: left;
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+	font-family: tahoma;
 }
 .ac_results li {
-	text-align:right;
+	text-align: right;
 }
 #TB_ajaxContent #options {
-	right:auto;
-	left:25px;
+	right: auto;
+	left: 25px;
 }
 #post_status {
-	margin-left:0;
+	margin-left: 0;
 	margin-right: 10px;
 }
+/* Footer */
 #footer {
 	padding: 10px 60px 0 0;
 }</diff>
      <filename>wp-admin/css/press-this-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,235 +1,240 @@
 body {
-	font: 13px &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
+	font: 13px &quot;Lucida Grande&quot;, &quot;Bitstream Vera Sans&quot;, Verdana, Arial, sans-serif;
 	color: #333;
-	margin: 0px;
-	padding: 0px;
+	margin: 0;
+	padding: 0;
 }
 
-img { border: 0; }
-/* Tabs */
-@media projection , screen {
-	.ui-tabs-hide {
-		display: none;
-	}
+img {
+	border: none;
 }
 
-@media print {
-	.ui-tabs-nav {
-		display: none;
-	}
+/* Header */
+#wphead {
+	border-top: none;
+	padding-top: 4px;
+	background: #444 !important;
 }
 
-.ui-tabs-nav {
-	list-style: none;
-	border-bottom: 1px solid #C6D9E9;
-	padding-left: 8px;
-	margin-bottom: .5em;
-	margin-top: -2em;
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+	-moz-border-radius-bottomleft: 0;
+	-moz-border-radius-bottomright: 0;
+	-moz-border-radius-topleft: 3px;
+	-moz-border-radius-topright: 3px;
+	-khtml-border-radius-bottomleft: 0;
+	-khtml-border-radius-bottomright: 0;
+	-khtml-border-radius-topleft: 3px;
+	-khtml-border-radius-topright: 3px;
+	-webkit-border-radius-bottomleft: 0;
+	-webkit-border-radius-bottomright: 0;
+	-webkit-border-radius-topleft: 3px;
+	-webkit-border-radius-topright: 3px;
+	border-radius-bottomleft: 0;
+	border-radius-bottomright: 0;
+	border-radius-topleft: 3px;
+	border-radius-topright: 3px;
+	border-style: solid;
+	border-width: 1px;
+	cursor: pointer;
+	display: block;
+	height: 18px;
+	margin: 0px 5px 0 0;
+	padding: 0px 5px 0px;
+	background-color: #E9E9E9;
+	border-bottom-color: #E9E9E9;
+	color: #333333;
+	font-size: 10px;
+	line-height: 18px;
+	float: left;
 }
 
-/* Additional IE specific bug fixes... */
-* html .ui-tabs-nav { /* auto clear, @ IE 6 &amp; IE 7 Quirks Mode */
-	display: inline-block;
+.howto {
+	margin-top: 2px;
+	margin-bottom: 3px;
+	font-size: 11px;
+	font-style: italic;
+	display: block;
 }
 
-* :first-child+html .ui-tabs-nav {
-	/* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
-	display: inline-block;
+input.text {
+	outline-color: -moz-use-text-color;
+	outline-style: none;
+	outline-width: medium;
+	width: 100%;
 }
 
-.ui-tabs-nav:after {
-	/* clearing without presentational markup, IE gets extra treatment */
-	display: block;
-	clear: both;
-	content: &quot; &quot;;
+#message {
+	-moz-border-radius: 6px;
+	-khtml-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
 }
 
-.ui-tabs-nav li {
-	float: left;
-	margin: 0;
-	height: 2em;
-	line-height: 2em;
+/* Editor/Main Column */
+div#poststuff {
+	padding-left: 10px;
+	margin-top: 10px;
 }
 
-.ui-tabs-nav a,.ui-tabs-nav a span {
-	display: block;
+div.zerosize {
+	border: 0 none;
+	height: 0;
+	margin: 0;
+	overflow: hidden;
+	padding: 0;
+	position: absolute;
+	width: 0;
 }
 
-.ui-tabs-nav a {
-	margin: 1px 0 0;
-	/* position: relative makes opacity fail for disabled tab in IE */
-	padding-left: 0;
-	color: #27537a;
-	font-weight: bold;
-	line-height: 2em;
-	text-align: center;
-	text-decoration: none;
-	white-space: nowrap; /* required in IE 6 */
-	outline: 0; /* prevent dotted border in Firefox */
-	padding: 0 1em;
+#poststuff #edButtonPreview.active,
+#poststuff #edButtonHTML.active {
+	display: none;
 }
 
-.ui-tabs-nav .ui-tabs-selected a {
+.posting {
+	margin-right: 228px;
 	position: relative;
-	top: 1px;
-	z-index: 2;
-	margin-top: 0;
-	-moz-border-radius-topleft: 4px;
-	-moz-border-radius-topright: 4px;
-	-webkit-border-top-left-radius: 4px;
-	-webkit-border-top-right-radius: 4px;
-	border-style: solid;
-	border-width: 1px;
-	background: white;
-	border-bottom-width: 2px;
-	margin-top: -2px;
+	left: 0;
 }
 
-.ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active,
-.ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited { 
-	cursor: pointer;
+#side-info-column {
+	float: right;
+	width: 218px;
+	position: absolute;
+	right: 0;
+	margin-right: 10px;
 }
 
-/* Header */
-#wphead {
-	border-top: none;
-	height: 2em;
-	padding-top: 8px;
+#side-info-column .sleeve {
+	padding-left: 10px;
 }
 
-.button {
-	font-family: &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
-	padding: 3px 5px;
-	font-size: 12px;
-	line-height: 1.5em;
-	border-width: 1px;
-	border-style: solid;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	cursor: pointer;
-	margin-left: 5px;
-	text-decoration: none;
+#poststuff .inside {
+	font-size: 11px;
+	margin: 0 12px 12px;
 }
 
-.howto {
-	font-size: 11px;
-	font-style: italic;
-	display: block;
+#poststuff h2, #poststuff h3 {
+	font-size: 14px;
+	font-weight: bold;
+	padding: 7px;
+	margin: 0 0 10px;
+	background-image: url(../images/postbox-bg.gif);
+	background-position: left top;
+	background-repeat: repeat-x;
+	font-size: 12px;
+	font-weight: bold;
+	line-height: 1;
+	margin: 0 0 10px;
+	padding: 7px 9px;
+	text-shadow: 0 1px 0 #FFFFFF;
 }
 
-#wphead #viewsite {
-	position: absolute;
-	margin-top: 12px;
-	margin-left: 10px;
+h3.tb {
+	text-shadow: 0 1px 0 #FFFFFF;
+	font-weight: bold;
+	font-size: 12px;
+	margin-left: 5px;
 }
 
-#viewsite {
-	position: relative;
-	right: 8px;
-	top: 6px;
-	margin: 0 !important;
+#TB_window {
+	border: 1px solid #333;
+	-moz-border-radius: 6px;
+	-khtml-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
 }
 
-#wphead #viewsite a {
-	font: 12px &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Tahoma, Verdana, sans-serif;
-	padding: 3px 4px;
-	display: block;
-	letter-spacing: normal;
+.metabox-holder .postbox,
+.postbox,
+.stuffbox {
+	margin-bottom: 10px;
 	border-width: 1px;
 	border-style: solid;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	text-decoration: none;
+	line-height: 1;
+	-moz-border-radius: 6px;
+	-khtml-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
+	border-color: #DFDFDF;
 }
 
-#previewview {
-	padding-top: 8px !important;
-	padding-bottom: 8px !important;
-}
-
-h1 {
-	font-size: .75em;
-	line-height: 2.666em;
-	top: .5em;
-	right: 0;
-	margin: 0 !important;
-	padding: 0 !important;
-	width: 236px;
-	background: none;
+.titlediv {
+	border-color: #DFDFDF;
 }
 
-input.text {
-	border: 0pt none;
-	outline-color: -moz-use-text-color;
-	outline-style: none;
-	outline-width: medium;
-	padding: 0pt;
-	width: 100%;
+#title, .tbtitle {
+	-moz-border-radius: 6px;
+	-khtml-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
 	border-style: solid;
-	color: #333333;
-}
-
-/* Editor/Main Column */
-
-div#container {
-	margin: 0;
-	min-width: 500px;
+	border-width: 1px;
+	font-size: 1.7em;
+	outline: none;
+	padding: 3px 4px;
+	border-color: #DFDFDF;
 }
 
-div#container form {
-	margin: 0px;
-	padding: 0px;
+.tbtitle {
+	font-size: 12px;
+	padding: 3px;
 }
 
-div#posting {
-	padding-left: 16px;
-	position: absolute;
-	z-index: 1;
-	width: 66%;
+#title {
+	width: 98%;
 }
 
-#post_title {
-	width: 99%;
+.postbox h2 {
+	background-image: url(../images/postbox-bg.gif);
+	background-position: left top;
+	background-repeat: repeat-x;
+	background-color: #DFDFDF;
 }
 
-.titlewrap {
+.editor-container {
+	-moz-border-radius: 6px;
+	-khtml-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
+	border-collapse: separate;
 	border-style: solid;
 	border-width: 1px;
-	padding: 2px 3px;
-	border-color: #CCCCCC;
+	border-color: #DFDFDF;
 }
 
-div#posting h2 {
-	margin: .5em 0 .25em 0;
-	font-size: 12px;
-	padding: 3px;
-	background: ;
+.postdivrich {
+	position: relative;
+	padding-top: 25px;
 }
 
-.editor-container {
-	border-width: 1px;
-	border-color: #ccc;
-	border-style: solid;
-	margin-bottom: 1em;
+#actions {
+	clear: both;
+	float: right;
+	margin-top: -19px;
+	position: relative;
+}
+#extra_fields #actions {
+	clear: both;
+	position: absolute;
+	right: 4px;
+	top: 6px;
+	margin: 0;
 }
 
-/* Photo Styles */
-
-#photo_directions {
-	margin-top: .25em;
-	display: block;
-	position: relative;
+#actions li {
+	float: left;
+	list-style: none;
+	margin-right: 10px;
+}
+#extra_fields .button {
+	margin-right: 5px;
 }
 
-#photo_directions span {
-	display: block;
-	position: absolute;
-	top: 0;
-	right: 3px;
+/* Photo Styles */
+.photolist {
+	margin-top: -10px;
 }
 
 #photo_saving {
@@ -239,77 +244,162 @@ div#posting h2 {
 
 #img_container {
 	background-color: #fff;
+	height: 101px;
+	width: 100%;
+}
+
+#extra_fields {
+	margin-top: 10px;
+	position: relative;
+}
+
+#extra_fields .postbox {
+	margin-bottom: 5px;
+}
+
+#extra_fields .titlewrap {
+	padding: 0;
 	overflow: auto;
 	height: 100px;
 }
 
+#img_container {
+	position: relative;
+}
+
 #img_container a {
 	display: block;
-	width: 79px;
-	height: 79px;
 	float: left;
+	overflow: hidden;
+	vertical-align: center;
+}
+
+#img_container img, #img_container a {
+	width: 68px;
+	height: 68px;
 }
 
 #img_container img {
-	width: 75px;
-	height: 75px;
-	border: 0px;
-	padding: 2px;
+	width: 68px;
+	height: 68px;
+	border: none;
 	background-color: #f4f4f4;
 	cursor: pointer;
 }
-#img_container a, #img_container a:link, #img_container a:visited {
-	border: 2px solid #ccc;
-	margin: 0 4px 4px 0;
-} 
-#img_container a:hover, #img_container a:active {
-	border: 2px solid #000;
+
+#img_container a,
+#img_container a:link,
+#img_container a:visited {
+	border: 1px solid #ccc;
+	display: block;
+	position: relative;
+}
+
+#img_container a:hover,
+#img_container a:active {
+	border-color: #000;
+	z-index: 1000;
+	border-width: 2px;
+	margin: -1px;
+}
+
+/* Video */
+#embed-code {
+	width: 100%;
+	height: 98px;
 }
 
 /* Submit Column */
+#viewsite {
+	padding: 0;
+	margin: 0 0 20px 0;
+	font-size: 10px;
+	clear: both;
+}
 
-div#categories {
-	font-size: 85%;
-	position: absolute;
-	top: 50px;
-	right: 16px;
-	width: 27%;
-	z-index: 2;
+#viewsite .button {
+	margin: 0 0 0px 0;
+	display: block;
 }
 
-div#categories h2 {
-	color: #333;
+.wp-hidden-children .wp-hidden-child {
+	display: none;
+}
+
+#category-adder {
+	padding: 4px 0;
+}
+
+#category-adder h4 {
+	margin: 0 0 8px;
+}
+
+#category-add input {
+	width: 94%;
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 13px;
+	margin: 1px;
+	padding: 3px;
+}
+
+#category-add select {
+	width: 70%;
+	-x-system-font: none;
+	border-style: solid;
+	border-width: 1px;
+	font-family: &quot;Lucida Grande&quot;, &quot;Bitstream Vera Sans&quot;, Verdana, Arial, sans-serif;
 	font-size: 12px;
-	margin: .5em 0 .5em 1em;
-	padding: 0;
+	height: 2em;
+	line-height: 20px;
+	padding: 2px;
+	margin: 1px;
+	vertical-align: top;
 }
 
-#categories-all {
-	overflow: auto;
-	padding: 0 1em 1em 1em;
-	height: 15em;
+#category-add input#category-add-sumbit {
+	width: auto;
 }
 
-#categories ul {
+/* Categories */
+#categorydiv ul, #linkcategorydiv ul {
 	list-style: none;
 	padding: 0;
 	margin: 0;
 }
 
+#categorydiv ul.categorychecklist ul {
+	margin-left: 18px;
+}
+
+#categorydiv div.ui-tabs-panel {
+	height: 150px;
+	overflow: auto;
+}
+
+ul.categorychecklist li {
+	margin: 0;
+	padding: 0;
+	line-height: 19px;
+}
+
+/* Tags */
 #tagsdiv #newtag {
 	padding: 3px;
 	margin-right: 5px;
-	width: 16em;	
+	width: 16em;
 }
 
 #jaxtag {
 	clear: both;
-	padding-left: 1em;
 	margin: 0;
 }
 
+#tagadd {
+	margin-left: 3px;
+}
+
 #tagchecklist {
-	padding-left: 1em;
+	margin-top: 3px;
 	margin-bottom: 1em;
 	font-size: 12px;
 	overflow: auto;
@@ -332,7 +422,7 @@ div#categories h2 {
 }
 
 #tagchecklist span a {
-	margin: 6px 0pt 0pt -9px;
+	margin: 6px 0 0 -9px;
 	cursor: pointer;
 	width: 10px;
 	height: 10px;
@@ -342,68 +432,44 @@ div#categories h2 {
 	overflow: hidden;
 	position: absolute;
 }
-.submit {
-	-moz-border-radius-bottomleft: 3px;
-	-khtml-border-bottom-left-radius: 3px;
-	-webkit-border-bottom-left-radius: 3px;
-	border-bottom-left-radius: 3px;
-	-moz-border-radius-bottomright: 3px;
-	-khtml-border-bottom-right-radius: 3px;
-	-webkit-border-bottom-right-radius: 3px;
-	border-bottom-right-radius: 3px;
-	margin: 0;
-	padding: 10px;
-}
-.submitbox {
-	width: 100%;
-	float: right;
-}
 
-.submitbox .submit a:hover {
-	border-bottom-width: 1px;
-	border-bottom-style: solid;
+#content {
+	width: 96% !important;
+	margin-left: 1%;
+	margin-bottom: 10px;
+	border: 1px solid #f1f1f1;
 }
 
-.submitbox .submit input {
-	border: none;
-	text-align: left;
-	padding: 6px 4px;
-	font-size: 12px;
-	margin: 2px;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	cursor: pointer;
-}
+/* Submit */
 
-.submitbox #previewview {
-	padding: 15px 10px;
-	-moz-border-radius-topleft: 3px;
-	-khtml-border-top-left-radius: 3px;
-	-webkit-border-top-left-radius: 3px;
-	border-top-left-radius: 3px;
-	-moz-border-radius-topright: 3px;
-	-khtml-border-top-right-radius: 3px;
-	-webkit-border-top-right-radius: 3px;
-	border-top-right-radius: 3px;
+#saving {
+	display: inline;
 }
 
-/* Video Styles */
-.video_split #extra_fields {
-	width: 27%;
-	height: 300px;
-	float: left;
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+	font-family: &quot;Lucida Grande&quot;, &quot;Bitstream Vera Sans&quot;, Verdana, Arial, sans-serif;
+	text-decoration: none;
+	font-size: 11px !important;
+	line-height: 16px;
+	padding: 2px 8px;
+	cursor: pointer;
+	border-width: 1px;
+	border-style: solid;
+	-moz-border-radius: 11px;
+	-khtml-border-radius: 11px;
+	-webkit-border-radius: 11px;
+	border-radius: 11px;
 }
 
-#embed_code {
-	border: 0;
-	width: 99%;
-	height: 200px;
-}
-.video_split .editor_area {
-	width: 70%;
-	float: right;
+.button-primary {
+	background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
+	border-color: #21759B;
+	color: #FFFFFF;
 }
 
 .ac_results {
@@ -431,45 +497,32 @@ div#categories h2 {
 	text-decoration: underline;
 }
 
-.photolist {
-	display: none;
-}
-
-#extra_fields small {
-	display: block;
-	margin-top: .5em;
-	padding-bottom: .25em;
-}
-
 #TB_ajaxContent #options {
 	position: absolute;
 	top: 20px;
 	right: 25px;
 	padding: 5px;
 }
+
 #TB_ajaxContent h3 {
 	margin-bottom: .25em;
 }
 
 .updated {
-	margin: 0;
-	margin-left: 15px;
-	margin-right: 15px;
+	margin: 10px 0;
 	padding: 0;
-	max-width: 980px;
 	border-width: 1px;
 	border-style: solid;
-	padding: 0 0.6em;
-	max-width: 950px;
-	margin-top: 1em;
-	margin-bottom: 1em;
+	width: 99%;
 }
 
-.updated p, .error p {
+.updated p,
+.error p {
 	margin: 0.6em 0;
+	padding: 0 0.6em;
 }
 
-.updated a, .error a {
+.error a {
 	text-decoration: underline;
 }
 
@@ -485,7 +538,6 @@ div#categories h2 {
 }
 
 /* Footer */
-
 #footer {
 	height: 65px;
 	display: block;
@@ -505,12 +557,10 @@ div#categories h2 {
 #footer p a {
 	text-decoration: none;
 }
-
 #footer p a:hover {
 	text-decoration: underline;
 }
 
-
 /* Utility Classes */
 .centered {
 	text-align: center;
@@ -518,4 +568,4 @@ div#categories h2 {
 
 .hidden {
 	display: none;
-}
\ No newline at end of file
+}</diff>
      <filename>wp-admin/css/press-this.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,12 @@
-#template textarea {
-	font-family:monospace;
-}
 #templateside {
-	float:left;
+	float: left;
 }
 #themeselector {
-	padding-right:0;
+	padding-right: 0;
 	padding-left: 5px;
 	float: left;
 }
 div.tablenav {
-	margin-right:0;
+	margin-right: 0;
 	margin-left: 210px;
 }</diff>
      <filename>wp-admin/css/theme-editor-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 #template textarea {
-	font-family: 'Courier New', Courier, monospace;
+	font-family: Consolas, Monaco, Courier, monospace;
 	font-size: 12px;
 	width: 97%;
 }
@@ -11,7 +11,6 @@
 #templateside {
 	float: right;
 	width: 190px;
-	margin-top:-3.4em;
 }
 
 #templateside h3, #postcustomstuff p.submit {
@@ -23,7 +22,7 @@ h3#bordertitle {
 }
 
 #templateside h4 {
-	margin-bottom: 0px;
+	margin-bottom: 0;
 }
 
 #templateside ol, #templateside ul {
@@ -33,7 +32,7 @@ h3#bordertitle {
 }
 
 #templateside ol li, #templateside ul li {
-	margin: 1px 0px;
+	margin: 1px 0;
 }
 
 #themeselector {
@@ -41,6 +40,7 @@ h3#bordertitle {
 	float: right;
 	position: relative;
 	bottom: 25px;
+	top:20px;
 }
 
 #themeselector select {
@@ -58,7 +58,7 @@ h3#bordertitle {
 
 div.bordertitle h2 {
 	border: none;
-	padding-bottom: 0px;
+	padding-bottom: 0;
 }
 
 div.tablenav {</diff>
      <filename>wp-admin/css/theme-editor.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,27 @@
-/* 2 column liquid layout */
-div.widget-liquid-left-holder {
-	float: right;
-	clear: right;
-	margin-right:0;
-	margin-left: -310px;
-}
-div.widget-liquid-left {
-	margin-right:0;
-	margin-left: 320px;
-}
-div.widget-liquid-right {
-	float: left;
-	clear: left;
-}
-p#widget-search {
-	right:auto;
-	left:0;
-}
 h4.widget-title span {
 	float: right;
 }
 h4.widget-title a {
 	float: left;
-	margin-left:0;
+	margin-left: 0;
 	margin-right: 1em;
 }
 ul#widget-list li.widget-list-item h4.widget-title {
-	float:right;
+	float: right;
 }
 ul#widget-list li.widget-list-item div.widget-description {
 	margin: 0 200px 0 0;
 	padding: 0 4em 0 0;
 }
-.widget-control-save, .widget-control-remove {
-	margin-right:0;
+.widget-control-save,
+.widget-control-remove {
+	margin-right: 0;
 	margin-left: 8px;
 	float: right;
 }
 li.widget-list-control-item h4.widget-title a,
 #dragHelper li.widget-list-control-item h4.widget-title a,
 #draghelper li.widget-list-control-item h4.widget-title a:visited {
-	right:auto;
+	right: auto;
 	left: 1em;
 }</diff>
      <filename>wp-admin/css/widgets-rtl.css</filename>
    </modified>
    <modified>
      <diff>@@ -27,13 +27,6 @@ div#available-widgets-filter {
 	border-bottom-style: solid;
 }
 
-p#widget-search {
-	position: absolute;
-	right: 0;
-	top: 0;
-	margin: 0;
-}
-
 ul#widget-list {
 	list-style: none;
 	margin: 0;
@@ -112,8 +105,8 @@ li.widget-list-control-item {
 	border-radius: 3px;
 }
 
-li.widget-list-control-item h4, 
-#dragHelper li.widget-list-control-item h4, 
+li.widget-list-control-item h4,
+#dragHelper li.widget-list-control-item h4,
 li.widget-sortable h4 {
 	margin: 0;
 	cursor: move;
@@ -126,12 +119,8 @@ li.widget-sortable h4 {
 	border-radius: 3px;
 }
 
-.widget-control-save, .widget-control-remove {
-	padding: 3px 5px;
-	-moz-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	border-radius: 3px;
+.widget-control-save,
+.widget-control-remove {
 	margin-right: 8px;
 	float: left;
 	text-decoration: none;
@@ -149,6 +138,8 @@ li.widget-list-control-item h4.widget-title a:hover {
 }
 
 li.widget-list-control-item div.widget-control {
+	border-width: 0 1px 1px;
+	border-style: none solid solid;
 	display: none;
 	padding: 15px;
 	font-size: 11px;
@@ -161,8 +152,6 @@ li.widget-list-control-item div.widget-control p {
 }
 
 ul.widget-control-list div.widget-control-actions {
-	border-top-width: 1px;
-	border-top-style: solid;
 	padding: 0.5em 0 0;
 }
 
@@ -173,7 +162,7 @@ ul.widget-control-list div.widget-control-actions {
 
 div#current-widgets {
 	padding-top: 1em;
-	border-width: 1px;
+	border-width: 1px 0 0;
 	border-style: solid none none;
 }
 </diff>
      <filename>wp-admin/css/widgets.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,105 @@
 &lt;?php
-
+/**
+ * The custom header image script.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * The custom header image class.
+ *
+ * @since unknown
+ * @package WordPress
+ * @subpackage Administration
+ */
 class Custom_Image_Header {
+
+	/**
+	 * Callback for administration header.
+	 *
+	 * @var callback
+	 * @since unknown
+	 * @access private
+	 */
 	var $admin_header_callback;
 
+	/**
+	 * PHP4 Constructor - Register administration header callback.
+	 *
+	 * @since unknown
+	 * @param callback $admin_header_callback
+	 * @return Custom_Image_Header
+	 */
 	function Custom_Image_Header($admin_header_callback) {
 		$this-&gt;admin_header_callback = $admin_header_callback;
 	}
 
+	/**
+	 * Setup the hooks for the Custom Header admin page.
+	 *
+	 * @since unknown
+	 */
 	function init() {
 		$page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&amp;$this, 'admin_page'));
 
 		add_action(&quot;admin_print_scripts-$page&quot;, array(&amp;$this, 'js_includes'));
+		add_action(&quot;admin_print_styles-$page&quot;, array(&amp;$this, 'css_includes'));
 		add_action(&quot;admin_head-$page&quot;, array(&amp;$this, 'take_action'), 50);
 		add_action(&quot;admin_head-$page&quot;, array(&amp;$this, 'js'), 50);
 		add_action(&quot;admin_head-$page&quot;, $this-&gt;admin_header_callback, 51);
 	}
 
+	/**
+	 * Get the current step.
+	 *
+	 * @since unknown
+	 *
+	 * @return int Current step
+	 */
 	function step() {
-		$step = (int) @$_GET['step'];
+		if ( ! isset( $_GET['step'] ) )
+			return 1;
+
+		$step = (int) $_GET['step'];
 		if ( $step &lt; 1 || 3 &lt; $step )
 			$step = 1;
+
 		return $step;
 	}
 
+	/**
+	 * Setup the enqueue for the JavaScript files.
+	 *
+	 * @since unknown
+	 */
 	function js_includes() {
 		$step = $this-&gt;step();
+
 		if ( 1 == $step )
-			wp_enqueue_script('colorpicker');
-		elseif ( 2 == $step )	
+			wp_enqueue_script('farbtastic');
+		elseif ( 2 == $step )
 			wp_enqueue_script('cropper');
 	}
 
+	/**
+	 * Setup the enqueue for the CSS files
+	 *
+	 * @since 2.7
+	 */
+	function css_includes() {
+		$step = $this-&gt;step();
+
+		if ( 1 == $step ) {
+			wp_enqueue_style('farbtastic');
+		}
+	}
+
+	/**
+	 * Execute custom header modification.
+	 *
+	 * @since unknown
+	 */
 	function take_action() {
 		if ( isset( $_POST['textcolor'] ) ) {
 			check_admin_referer('custom-header');
@@ -48,6 +117,11 @@ class Custom_Image_Header {
 		}
 	}
 
+	/**
+	 * Execute Javascript depending on step.
+	 *
+	 * @since unknown
+	 */
 	function js() {
 		$step = $this-&gt;step();
 		if ( 1 == $step )
@@ -56,123 +130,134 @@ class Custom_Image_Header {
 			$this-&gt;js_2();
 	}
 
+	/**
+	 * Display Javascript based on Step 1.
+	 *
+	 * @since unknown
+	 */
 	function js_1() { ?&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
-	var cp = new ColorPicker();
+	var buttons = ['#name', '#desc', '#pickcolor', '#defaultcolor'];
+	var farbtastic;
 
 	function pickColor(color) {
-		$('name').style.color = color;
-		$('desc').style.color = color;
-		$('textcolor').value = color;
-	}
-	function PopupWindow_hidePopup(magicword) {
-		if ( magicword != 'prettyplease' )
-			return false;
-		if (this.divName != null) {
-			if (this.use_gebi) {
-				document.getElementById(this.divName).style.visibility = &quot;hidden&quot;;
-			}
-			else if (this.use_css) {
-				document.all[this.divName].style.visibility = &quot;hidden&quot;;
-			}
-			else if (this.use_layers) {
-				document.layers[this.divName].visibility = &quot;hidden&quot;;
-			}
-		}
-		else {
-			if (this.popupWindow &amp;&amp; !this.popupWindow.closed) {
-				this.popupWindow.close();
-				this.popupWindow = null;
-			}
-		}
-		return false;
-	}
-	function colorSelect(t,p) {
-		if ( cp.p == p &amp;&amp; document.getElementById(cp.divName).style.visibility != &quot;hidden&quot; ) {
-			cp.hidePopup('prettyplease');
-		} else {
-			cp.p = p;
-			cp.select(t,p);
-		}
+		jQuery('#name').css('color', color);
+		jQuery('#desc').css('color', color);
+		jQuery('#textcolor').val(color);
+		farbtastic.setColor(color);
 	}
+
+	jQuery(document).ready(function() {
+		jQuery('#pickcolor').click(function() {
+			jQuery('#colorPickerDiv').show();
+		});
+
+		jQuery('#hidetext').click(function() {
+			toggle_text();
+		});
+
+		farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) { pickColor(color); });
+		pickColor('#&lt;?php echo get_theme_mod('header_textcolor', HEADER_TEXTCOLOR); ?&gt;');
+
+		&lt;?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?&gt;
+		toggle_text();
+		&lt;?php } ?&gt;
+	});
+
+	jQuery(document).mousedown(function(){
+		// Make the picker disappear, since we're using it in an independant div
+		hide_picker();
+	});
+
 	function colorDefault() {
 		pickColor('#&lt;?php echo HEADER_TEXTCOLOR; ?&gt;');
 	}
 
-	function hide_text() {
-		$('name').style.display = 'none';
-		$('desc').style.display = 'none';
-		$('pickcolor').style.display = 'none';
-		$('defaultcolor').style.display = 'none';
-		$('textcolor').value = 'blank';
-		$('hidetext').value = '&lt;?php _e('Show Text'); ?&gt;';
-//		$('hidetext').onclick = 'show_text()';
-		Event.observe( $('hidetext'), 'click', show_text );
+	function hide_picker(what) {
+		var update = false;
+		jQuery('#colorPickerDiv').each(function(){
+			var id = jQuery(this).attr('id');
+			if (id == what) {
+				return;
+			}
+			var display = jQuery(this).css('display');
+			if (display == 'block') {
+				jQuery(this).fadeOut(2);
+			}
+		});
 	}
 
-	function show_text() {
-		$('name').style.display = 'block';
-		$('desc').style.display = 'block';
-		$('pickcolor').style.display = 'inline';
-		$('defaultcolor').style.display = 'inline';
-		$('textcolor').value = '&lt;?php echo HEADER_TEXTCOLOR; ?&gt;';
-		$('hidetext').value = '&lt;?php _e('Hide Text'); ?&gt;';
-		Event.stopObserving( $('hidetext'), 'click', show_text );
-		Event.observe( $('hidetext'), 'click', hide_text );
+	function toggle_text(force) {
+		if(jQuery('#textcolor').val() == 'blank') {
+			//Show text
+			jQuery( buttons.toString() ).show();
+			jQuery('#textcolor').val('&lt;?php echo HEADER_TEXTCOLOR; ?&gt;');
+			jQuery('#hidetext').val('&lt;?php _e('Hide Text'); ?&gt;');
+		}
+		else {
+			//Hide text
+			jQuery( buttons.toString() ).hide();
+			jQuery('#textcolor').val('blank');
+			jQuery('#hidetext').val('&lt;?php _e('Show Text'); ?&gt;');
+		}
 	}
 
-	&lt;?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?&gt;
-Event.observe( window, 'load', hide_text );
-	&lt;?php } ?&gt;
+
 
 &lt;/script&gt;
 &lt;?php
 	}
 
+	/**
+	 * Display Javascript based on Step 2.
+	 *
+	 * @since unknown
+	 */
 	function js_2() { ?&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 	function onEndCrop( coords, dimensions ) {
-		$( 'x1' ).value = coords.x1;
-		$( 'y1' ).value = coords.y1;
-		$( 'x2' ).value = coords.x2;
-		$( 'y2' ).value = coords.y2;
-		$( 'width' ).value = dimensions.width;
-		$( 'height' ).value = dimensions.height;
+		jQuery( '#x1' ).val(coords.x1);
+		jQuery( '#y1' ).val(coords.y1);
+		jQuery( '#x2' ).val(coords.x2);
+		jQuery( '#y2' ).val(coords.y2);
+		jQuery( '#width' ).val(dimensions.width);
+		jQuery( '#height' ).val(dimensions.height);
 	}
 
 	// with a supplied ratio
-	Event.observe(
-		window,
-		'load',
-		function() {
-			var xinit = &lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;;
-			var yinit = &lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;;
-			var ratio = xinit / yinit;
-			var ximg = $('upload').width;
-			var yimg = $('upload').height;
-			if ( yimg &lt; yinit || ximg &lt; xinit ) {
-				if ( ximg / yimg &gt; ratio ) {
-					yinit = yimg;
-					xinit = yinit * ratio;
-				} else {
-					xinit = ximg;
-					yinit = xinit / ratio;
-				}
+	jQuery(document).ready(function() {
+		var xinit = &lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;;
+		var yinit = &lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;;
+		var ratio = xinit / yinit;
+		var ximg = jQuery('#upload').width();
+		var yimg = jQuery('#upload').height();
+		if ( yimg &lt; yinit || ximg &lt; xinit ) {
+			if ( ximg / yimg &gt; ratio ) {
+				yinit = yimg;
+				xinit = yinit * ratio;
+			} else {
+				xinit = ximg;
+				yinit = xinit / ratio;
 			}
-			new Cropper.Img(
-				'upload',
-				{
-					ratioDim: { x: xinit, y: yinit },
-					displayOnInit: true,
-					onEndCrop: onEndCrop
-				}
-			)
 		}
-	);
+		new Cropper.Img(
+			'upload',
+			{
+				ratioDim: { x: xinit, y: yinit },
+				displayOnInit: true,
+				onEndCrop: onEndCrop
+			}
+		)
+	});
 &lt;/script&gt;
 &lt;?php
 	}
 
+	/**
+	 * Display first step of custom header image page.
+	 *
+	 * @since unknown
+	 */
 	function step_1() {
 		if ( $_GET['updated'] ) { ?&gt;
 &lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;
@@ -181,6 +266,7 @@ Event.observe( window, 'load', hide_text );
 		&lt;?php } ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
 &lt;h2&gt;&lt;?php _e('Your Header Image'); ?&gt;&lt;/h2&gt;
 &lt;p&gt;&lt;?php _e('This is your header image. You can change the text color or upload and crop a new image.'); ?&gt;&lt;/p&gt;
 
@@ -191,12 +277,12 @@ Event.observe( window, 'load', hide_text );
 &lt;?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?&gt;
 &lt;form method=&quot;post&quot; action=&quot;&lt;?php echo admin_url('themes.php?page=custom-header&amp;amp;updated=true') ?&gt;&quot;&gt;
 &lt;input type=&quot;button&quot; value=&quot;&lt;?php _e('Hide Text'); ?&gt;&quot; onclick=&quot;hide_text()&quot; id=&quot;hidetext&quot; /&gt;
-&lt;input type=&quot;button&quot; value=&quot;&lt;?php _e('Select a Text Color'); ?&gt;&quot; onclick=&quot;colorSelect($('textcolor'), 'pickcolor')&quot; id=&quot;pickcolor&quot; /&gt;&lt;input type=&quot;button&quot; value=&quot;&lt;?php _e('Use Original Color'); ?&gt;&quot; onclick=&quot;colorDefault()&quot; id=&quot;defaultcolor&quot; /&gt;
+&lt;input type=&quot;button&quot; value=&quot;&lt;?php _e('Select a Text Color'); ?&gt;&quot; id=&quot;pickcolor&quot; /&gt;&lt;input type=&quot;button&quot; value=&quot;&lt;?php _e('Use Original Color'); ?&gt;&quot; onclick=&quot;colorDefault()&quot; id=&quot;defaultcolor&quot; /&gt;
 &lt;?php wp_nonce_field('custom-header') ?&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;textcolor&quot; id=&quot;textcolor&quot; value=&quot;#&lt;?php attribute_escape(header_textcolor()) ?&gt;&quot; /&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;&lt;?php _e('Save Changes'); ?&gt;&quot; /&gt;&lt;/form&gt;
 &lt;?php } ?&gt;
 
-&lt;div id=&quot;colorPickerDiv&quot; style=&quot;z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;&quot;&gt; &lt;/div&gt;
+&lt;div id=&quot;colorPickerDiv&quot; style=&quot;z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;&quot;&gt; &lt;/div&gt;
 &lt;/div&gt;
 &lt;div class=&quot;wrap&quot;&gt;
 &lt;h2&gt;&lt;?php _e('Upload New Header Image'); ?&gt;&lt;/h2&gt;&lt;p&gt;&lt;?php _e('Here you can upload a custom header image to be shown at the top of your blog instead of the default one. On the next screen you will be able to crop the image.'); ?&gt;&lt;/p&gt;
@@ -226,6 +312,11 @@ Event.observe( window, 'load', hide_text );
 
 	}
 
+	/**
+	 * Display second step of custom header image page.
+	 *
+	 * @since unknown
+	 */
 	function step_2() {
 		check_admin_referer('custom-header');
 		$overrides = array('test_form' =&gt; false);
@@ -298,6 +389,11 @@ Event.observe( window, 'load', hide_text );
 		&lt;?php
 	}
 
+	/**
+	 * Display third step of custom header image page.
+	 *
+	 * @since unknown
+	 */
 	function step_3() {
 		check_admin_referer('custom-header');
 		if ( $_POST['oitar'] &gt; 1 ) {
@@ -339,6 +435,11 @@ Event.observe( window, 'load', hide_text );
 		return $this-&gt;finished();
 	}
 
+	/**
+	 * Display last step of custom header image page.
+	 *
+	 * @since unknown
+	 */
 	function finished() {
 		?&gt;
 &lt;div class=&quot;wrap&quot;&gt;
@@ -350,6 +451,11 @@ Event.observe( window, 'load', hide_text );
 		&lt;?php
 	}
 
+	/**
+	 * Display the page based on the current step.
+	 *
+	 * @since unknown
+	 */
 	function admin_page() {
 		$step = $this-&gt;step();
 		if ( 1 == $step )</diff>
      <filename>wp-admin/custom-header.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,69 +1,127 @@
-&lt;?php if ( ! defined('ABSPATH') ) die(); ?&gt;
-&lt;table class=&quot;widefat&quot;&gt;
-	&lt;thead&gt;
-	&lt;tr&gt;
+&lt;?php
+/**
+ * Edit attachments table for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
-&lt;?php $posts_columns = wp_manage_media_columns(); ?&gt;
-&lt;?php foreach($posts_columns as $post_column_key =&gt; $column_display_name) {
-	if ( 'cb' === $post_column_key )
-		$class = ' class=&quot;check-column&quot;';
-	elseif ( 'comments' === $post_column_key )
-		$class = ' class=&quot;num&quot;';
-	else
-		$class = '';
-?&gt;
-	&lt;th scope=&quot;col&quot;&lt;?php echo $class; ?&gt;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/th&gt;
-&lt;?php } ?&gt;
+if ( ! defined('ABSPATH') ) die();
 
+if ( have_posts() ) { ?&gt;
+&lt;table class=&quot;widefat fixed&quot; cellspacing=&quot;0&quot;&gt;
+	&lt;thead&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('upload'); ?&gt;
 	&lt;/tr&gt;
 	&lt;/thead&gt;
+
+	&lt;tfoot&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('upload', false); ?&gt;
+	&lt;/tr&gt;
+	&lt;/tfoot&gt;
+
 	&lt;tbody id=&quot;the-list&quot; class=&quot;list:post&quot;&gt;
 &lt;?php
-if ( have_posts() ) {
-$bgcolor = '';
 add_filter('the_title','wp_specialchars');
+$alt = '';
+$posts_columns = get_column_headers('upload');
+$hidden = get_hidden_columns('upload');
 while (have_posts()) : the_post();
-$class = 'alternate' == $class ? '' : 'alternate';
+$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
 global $current_user;
 $post_owner = ( $current_user-&gt;ID == $post-&gt;post_author ? 'self' : 'other' );
-$att_title = get_the_title();
-if ( empty($att_title) )
-	$att_title = __('(no title)');
+$att_title = _draft_or_post_title();
 
 ?&gt;
-	&lt;tr id='post-&lt;?php echo $id; ?&gt;' class='&lt;?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post-&gt;post_status ); ?&gt;' valign=&quot;top&quot;&gt;
+	&lt;tr id='post-&lt;?php echo $id; ?&gt;' class='&lt;?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post-&gt;post_status ); ?&gt;' valign=&quot;top&quot;&gt;
 
 &lt;?php
+foreach ($posts_columns as $column_name =&gt; $column_display_name ) {
+	$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
 
-foreach($posts_columns as $column_name=&gt;$column_display_name) {
+	$style = '';
+	if ( in_array($column_name, $hidden) )
+		$style = ' style=&quot;display:none;&quot;';
+
+	$attributes = &quot;$class$style&quot;;
 
 	switch($column_name) {
 
 	case 'cb':
 		?&gt;
-		&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;delete[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;/th&gt;
+		&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;media[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;/th&gt;
 		&lt;?php
 		break;
 
 	case 'icon':
+		$attributes = 'class=&quot;column-icon media-icon&quot;' . $style;
 		?&gt;
-		&lt;td class=&quot;media-icon&quot;&gt;&lt;?php echo wp_get_attachment_link($post-&gt;ID, array(80, 60), false, true); ?&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
+			if ( $thumb = wp_get_attachment_image( $post-&gt;ID, array(80, 60), true ) ) {
+?&gt;
+
+				&lt;a href=&quot;media.php?action=edit&amp;amp;attachment_id=&lt;?php the_ID(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $att_title)); ?&gt;&quot;&gt;
+					&lt;?php echo $thumb; ?&gt;
+				&lt;/a&gt;
+
+&lt;?php			}
+		?&gt;&lt;/td&gt;
 		&lt;?php
 		// TODO
 		break;
 
 	case 'media':
 		?&gt;
-		&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;media.php?action=edit&amp;amp;attachment_id=&lt;?php the_ID(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $att_title)); ?&gt;&quot;&gt;&lt;?php echo $att_title; ?&gt;&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo get_edit_post_link( $post-&gt;ID ); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $att_title)); ?&gt;&quot;&gt;&lt;?php echo $att_title; ?&gt;&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
 		&lt;?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post-&gt;ID))); ?&gt;
-		&lt;?php do_action('manage_media_media_column', $post-&gt;ID); ?&gt;
-		&lt;/td&gt;
+		&lt;p&gt;
+		&lt;?php
+		$actions = array();
+		if ( current_user_can('edit_post', $post-&gt;ID) )
+			$actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+		if ( current_user_can('delete_post', $post-&gt;ID) )
+			$actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+		$actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . attribute_escape(sprintf(__('View &quot;%s&quot;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
+		$action_count = count($actions);
+		$i = 0;
+		echo '&lt;div class=&quot;row-actions&quot;&gt;';
+		foreach ( $actions as $action =&gt; $link ) {
+			++$i;
+			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+			echo &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+		}
+		echo '&lt;/div&gt;';
+		?&gt;&lt;/p&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+	case 'author':
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php the_author() ?&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+	case 'tags':
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
+		$tags = get_the_tags();
+		if ( !empty( $tags ) ) {
+			$out = array();
+			foreach ( $tags as $c )
+				$out[] = &quot;&lt;a href='edit.php?tag=$c-&gt;slug'&gt; &quot; . wp_specialchars(sanitize_term_field('name', $c-&gt;name, $c-&gt;term_id, 'post_tag', 'display')) . &quot;&lt;/a&gt;&quot;;
+			echo join( ', ', $out );
+		} else {
+			_e('No Tags');
+		}
+		?&gt;&lt;/td&gt;
 		&lt;?php
 		break;
 
 	case 'desc':
 		?&gt;
-		&lt;td&gt;&lt;?php echo has_excerpt() ? $post-&gt;post_excerpt : ''; ?&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php echo has_excerpt() ? $post-&gt;post_excerpt : ''; ?&gt;&lt;/td&gt;
 		&lt;?php
 		break;
 
@@ -73,7 +131,7 @@ foreach($posts_columns as $column_name=&gt;$column_display_name) {
 		} else {
 			$t_time = get_the_time(__('Y/m/d g:i:s A'));
 			$m_time = $post-&gt;post_date;
-			$time = get_post_time( 'G', true );
+			$time = get_post_time( 'G', true, $post );
 			if ( ( abs($t_diff = time() - $time) ) &lt; 86400 ) {
 				if ( $t_diff &lt; 0 )
 					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
@@ -84,38 +142,36 @@ foreach($posts_columns as $column_name=&gt;$column_display_name) {
 			}
 		}
 		?&gt;
-		&lt;td&gt;&lt;?php echo $h_time ?&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php echo $h_time ?&gt;&lt;/td&gt;
 		&lt;?php
 		break;
 
 	case 'parent':
-		$title = __('(no title)'); // override below
 		if ( $post-&gt;post_parent &gt; 0 ) {
 			if ( get_post($post-&gt;post_parent) ) {
-				$parent_title = get_the_title($post-&gt;post_parent);
-				if ( !empty($parent_title) )
-					$title = $parent_title;
+				$title =_draft_or_post_title($post-&gt;post_parent);
 			}
 			?&gt;
-			&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;post.php?action=edit&amp;amp;post=&lt;?php echo $post-&gt;post_parent; ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
+			&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo get_edit_post_link( $post-&gt;post_parent ); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;/strong&gt;, &lt;?php echo get_the_time(__('Y/m/d')); ?&gt;&lt;/td&gt;
 			&lt;?php
 		} else {
 			?&gt;
-			&lt;td&gt;&amp;nbsp;&lt;/td&gt;
+			&lt;td &lt;?php echo $attributes ?&gt;&gt;&amp;nbsp;&lt;/td&gt;
 			&lt;?php
 		}
 
 		break;
 
 	case 'comments':
+		$attributes = 'class=&quot;comments column-comments num&quot;' . $style;
 		?&gt;
-		&lt;td class=&quot;num&quot;&gt;&lt;div class=&quot;post-com-count-wrapper&quot;&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;div class=&quot;post-com-count-wrapper&quot;&gt;
 		&lt;?php
 		$left = get_pending_comments_num( $post-&gt;ID );
 		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
 		if ( $left )
 			echo '&lt;strong&gt;';
-		comments_number(&quot;&lt;a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
+		comments_number(&quot;&lt;a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
 		if ( $left )
 			echo '&lt;/strong&gt;';
 		?&gt;
@@ -123,30 +179,32 @@ foreach($posts_columns as $column_name=&gt;$column_display_name) {
 		&lt;?php
 		break;
 
-	case 'location':
+	case 'actions':
 		?&gt;
-		&lt;td&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php _e('Permalink'); ?&gt;&lt;/a&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;
+		&lt;a href=&quot;media.php?action=edit&amp;amp;attachment_id=&lt;?php the_ID(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $att_title)); ?&gt;&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/a&gt; |
+		&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php _e('Get permalink'); ?&gt;&lt;/a&gt;
+		&lt;/td&gt;
 		&lt;?php
 		break;
 
 	default:
 		?&gt;
-		&lt;td&gt;&lt;?php do_action('manage_media_custom_column', $column_name, $id); ?&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php do_action('manage_media_custom_column', $column_name, $id); ?&gt;&lt;/td&gt;
 		&lt;?php
 		break;
 	}
 }
 ?&gt;
 	&lt;/tr&gt;
-&lt;?php
-endwhile;
-} else {
-?&gt;
-  &lt;tr style='background-color: &lt;?php echo $bgcolor; ?&gt;'&gt;
-    &lt;td colspan=&quot;8&quot;&gt;&lt;?php _e('No posts found.') ?&gt;&lt;/td&gt;
-  &lt;/tr&gt;
+&lt;?php endwhile; ?&gt;
+	&lt;/tbody&gt;
+&lt;/table&gt;
+&lt;?php } else { ?&gt;
+
+&lt;p&gt;&lt;?php _e('No posts found.') ?&gt;&lt;/p&gt;
+
 &lt;?php
 } // end if ( have_posts() )
 ?&gt;
-	&lt;/tbody&gt;
-&lt;/table&gt;
+</diff>
      <filename>wp-admin/edit-attachment-rows.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,51 @@
 &lt;?php
-if ( ! empty($cat_ID) ) {
-	$heading = __('Edit Category');
-	$submit_text = __('Edit Category');
-	$form = '&lt;form name=&quot;editcat&quot; id=&quot;editcat&quot; method=&quot;post&quot; action=&quot;categories.php&quot; class=&quot;validate&quot;&gt;';
-	$action = 'editedcat';
-	$nonce_action = 'update-category_' . $cat_ID;
-	do_action('edit_category_form_pre', $category);
-} else {
-	$heading = __('Add Category');
-	$submit_text = __('Add Category');
-	$form = '&lt;form name=&quot;addcat&quot; id=&quot;addcat&quot; method=&quot;post&quot; action=&quot;categories.php&quot; class=&quot;add:the-list: validate&quot;&gt;';
-	$action = 'addcat';
-	$nonce_action = 'add-category';
-	do_action('add_category_form_pre', $category);
+/**
+ * Edit category form for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * @var object
+ */
+if ( ! isset( $category ) )
+	$category = (object) array();
+
+/**
+ * @ignore
+ * @since 2.7
+ * @internal Used to prevent errors in page when no category is being edited.
+ *
+ * @param object $category
+ */
+function _fill_empty_category(&amp;$category) {
+	if ( ! isset( $category-&gt;name ) )
+		$category-&gt;name = '';
+
+	if ( ! isset( $category-&gt;slug ) )
+		$category-&gt;slug = '';
+
+	if ( ! isset( $category-&gt;parent ) )
+		$category-&gt;parent = '';
+
+	if ( ! isset( $category-&gt;description ) )
+		$category-&gt;description = '';
 }
+
+do_action('edit_category_form_pre', $category);
+
+_fill_empty_category($category);
 ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php echo $heading ?&gt;&lt;/h2&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php _e('Edit Category'); ?&gt;&lt;/h2&gt;
 &lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
-&lt;?php echo $form ?&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;&lt;?php echo $action ?&gt;&quot; /&gt;
+&lt;form name=&quot;editcat&quot; id=&quot;editcat&quot; method=&quot;post&quot; action=&quot;categories.php&quot; class=&quot;validate&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;editedcat&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;cat_ID&quot; value=&quot;&lt;?php echo $category-&gt;term_id ?&gt;&quot; /&gt;
-&lt;?php wp_nonce_field($nonce_action); ?&gt;
+&lt;?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-category_' . $cat_ID); ?&gt;
 	&lt;table class=&quot;form-table&quot;&gt;
 		&lt;tr class=&quot;form-field form-required&quot;&gt;
 			&lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;label for=&quot;cat_name&quot;&gt;&lt;?php _e('Category Name') ?&gt;&lt;/label&gt;&lt;/th&gt;
@@ -47,7 +70,7 @@ if ( ! empty($cat_ID) ) {
             &lt;?php _e('The description is not prominent by default, however some themes may show it.'); ?&gt;&lt;/td&gt;
 		&lt;/tr&gt;
 	&lt;/table&gt;
-&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;&lt;?php echo $submit_text ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button-primary&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Update Category'); ?&gt;&quot; /&gt;&lt;/p&gt;
 &lt;?php do_action('edit_category_form', $category); ?&gt;
 &lt;/form&gt;
 &lt;/div&gt;</diff>
      <filename>wp-admin/edit-category-form.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,64 @@
 &lt;?php
+/**
+ * Edit Comments Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
 require_once('admin.php');
 
-$title = __('Edit Comments');
-$parent_file = 'edit-comments.php';
-wp_enqueue_script( 'admin-comments' );
-wp_enqueue_script('admin-forms');
+wp_enqueue_script('admin-comments');
+enqueue_comment_hotkeys_js();
 
-if ( !empty( $_REQUEST['delete_comments'] ) ) {
+$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
+
+if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spam2'] ) ) &amp;&amp; !empty( $_REQUEST['pagegen_timestamp'] ) ) {
+	check_admin_referer('bulk-spam-delete', '_spam_nonce');
+
+	$delete_time = $wpdb-&gt;escape( $_REQUEST['pagegen_timestamp'] );
+	$deleted_spam = $wpdb-&gt;query( &quot;DELETE FROM $wpdb-&gt;comments WHERE comment_approved = 'spam' AND '$delete_time' &gt; comment_date_gmt&quot; );
+
+	$redirect_to = 'edit-comments.php?comment_status=spam&amp;deleted=' . (int) $deleted_spam;
+	if ( $post_id )
+		$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
+	wp_redirect( $redirect_to );
+} elseif ( isset($_REQUEST['delete_comments']) &amp;&amp; isset($_REQUEST['action']) &amp;&amp; ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) {
 	check_admin_referer('bulk-comments');
+	$doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];
+
+	$deleted = $approved = $unapproved = $spammed = 0;
+	foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each
+		$comment_id = (int) $comment_id;
+		$_post_id = (int) $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT comment_post_ID FROM $wpdb-&gt;comments WHERE comment_ID = %d&quot;, $comment_id) );
 
-	$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
-	foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
-		$comment = (int) $comment;
-		$post_id = (int) $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT comment_post_ID FROM $wpdb-&gt;comments WHERE comment_ID = %d&quot;, $comment) );
-		if ( !current_user_can('edit_post', $post_id) )
+		if ( !current_user_can('edit_post', $_post_id) )
 			continue;
-		if ( !empty( $_REQUEST['spamit'] ) ) {
-			wp_set_comment_status($comment, 'spam');
-			$comments_spammed++;
-		} elseif ( !empty( $_REQUEST['deleteit'] ) ) {
-			wp_set_comment_status($comment, 'delete');
-			$comments_deleted++;
-		} elseif ( !empty( $_REQUEST['approveit'] ) ) {
-			wp_set_comment_status($comment, 'approve');
-			$comments_approved++;
-		} elseif ( !empty( $_REQUEST['unapproveit'] ) ) {
-			wp_set_comment_status($comment, 'hold');
-			$comments_unapproved++;
+
+		switch( $doaction ) {
+			case 'markspam' :
+				wp_set_comment_status($comment_id, 'spam');
+				$spammed++;
+				break;
+			case 'delete' :
+				wp_set_comment_status($comment_id, 'delete');
+				$deleted++;
+				break;
+			case 'approve' :
+				wp_set_comment_status($comment_id, 'approve');
+				$approved++;
+				break;
+			case 'unapprove' :
+				wp_set_comment_status($comment_id, 'hold');
+				$unapproved++;
+				break;
 		}
 	endforeach;
-	$redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&amp;approved=' . $comments_approved . '&amp;spam=' . $comments_spammed . '&amp;unapproved=' . $comments_unapproved;
+
+	$redirect_to = 'edit-comments.php?deleted=' . $deleted . '&amp;approved=' . $approved . '&amp;spam=' . $spammed . '&amp;unapproved=' . $unapproved;
+	if ( $post_id )
+		$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
 	if ( isset($_REQUEST['apage']) )
 		$redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to );
 	if ( !empty($_REQUEST['mode']) )
@@ -39,29 +68,34 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) {
 	if ( !empty($_REQUEST['s']) )
 		$redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to);
 	wp_redirect( $redirect_to );
-} elseif ( !empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+} elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
+	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
 	 exit;
 }
 
+if ( $post_id )
+	$title = sprintf(__('Edit Comments on &amp;#8220;%s&amp;#8221;'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
+else
+	$title = __('Edit Comments');
+
 require_once('admin-header.php');
 
-if ( empty($_GET['mode']) )
-	$mode = 'detail';
-else
-	$mode = attribute_escape($_GET['mode']);
+$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']);
 
-if ( isset($_GET['comment_status']) )
-	$comment_status = attribute_escape($_GET['comment_status']);
-else
-	$comment_status = '';
+$comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : '';
+
+$comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : '';
+
+$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
+$search = attribute_escape( $search_dirty ); ?&gt;
+
+&lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title );
+if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
+	printf( '&lt;span class=&quot;subtitle&quot;&gt;' . sprintf( __( 'Search results for &amp;#8220;%s&amp;#8221;' ), wp_html_excerpt( wp_specialchars( stripslashes( $_GET['s'] ) ), 50 ) ) . '&lt;/span&gt;' ); ?&gt;
+&lt;/h2&gt;
 
-if ( isset($_GET['s']) )
-	$search_dirty = $_GET['s'];
-else
-	$search_dirty = '';
-$search = attribute_escape( $search_dirty );
-?&gt;
 &lt;?php
 if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
 	$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
@@ -90,50 +124,61 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
 	}
 }
 ?&gt;
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
-&lt;h2&gt;&lt;?php _e('Manage Comments'); ?&gt;&lt;/h2&gt;
 
+&lt;form id=&quot;comments-form&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
 &lt;ul class=&quot;subsubsub&quot;&gt;
 &lt;?php
 $status_links = array();
-$num_comments = wp_count_comments();
-$stati = array('moderated' =&gt; sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments-&gt;moderated) ), &quot;&lt;span class='comment-count'&gt;&quot; . number_format_i18n($num_comments-&gt;moderated) . &quot;&lt;/span&gt;&quot;), 'approved' =&gt; _c('Approved|plural'));
+$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
+//, number_format_i18n($num_comments-&gt;moderated) ), &quot;&lt;span class='comment-count'&gt;&quot; . number_format_i18n($num_comments-&gt;moderated) . &quot;&lt;/span&gt;&quot;),
+//, number_format_i18n($num_comments-&gt;spam) ), &quot;&lt;span class='spam-comment-count'&gt;&quot; . number_format_i18n($num_comments-&gt;spam) . &quot;&lt;/span&gt;&quot;)
+$stati = array(
+		'all' =&gt; __ngettext_noop('All', 'All'), // singular not used
+		'moderated' =&gt; __ngettext_noop('Pending (&lt;span class=&quot;pending-count&quot;&gt;%s&lt;/span&gt;)', 'Pending (&lt;span class=&quot;pending-count&quot;&gt;%s&lt;/span&gt;)'),
+		'approved' =&gt; __ngettext_noop('Approved', 'Approved'), // singular not used
+		'spam' =&gt; __ngettext_noop('Spam (&lt;span class=&quot;spam-count&quot;&gt;%s&lt;/span&gt;)', 'Spam (&lt;span class=&quot;spam-count&quot;&gt;%s&lt;/span&gt;)')
+	);
 $class = ( '' === $comment_status ) ? ' class=&quot;current&quot;' : '';
-$status_links[] = &quot;&lt;li&gt;&lt;a href=\&quot;edit-comments.php\&quot;$class&gt;&quot;.__('Show All Comments').&quot;&lt;/a&gt;&quot;;
+// $status_links[] = &quot;&lt;li&gt;&lt;a href='edit-comments.php'$class&gt;&quot; . __( 'All' ) . '&lt;/a&gt;';
+$link = 'edit-comments.php';
+if ( !empty($comment_type) &amp;&amp; 'all' != $comment_type )
+	$link = add_query_arg( 'comment_type', $comment_type, $link );
 foreach ( $stati as $status =&gt; $label ) {
 	$class = '';
 
-	if ( $status == $comment_status )
+	if ( str_replace( 'all', '', $status ) == $comment_status )
 		$class = ' class=&quot;current&quot;';
-
-	$status_links[] = &quot;&lt;li&gt;&lt;a href=\&quot;edit-comments.php?comment_status=$status\&quot;$class&gt;&quot; . $label . '&lt;/a&gt;';
+	if ( !isset( $num_comments-&gt;$status ) )
+		$num_comments-&gt;$status = 10;
+	if ( 'all' != $status )
+		$link = add_query_arg( 'comment_status', $status, $link );
+	if ( $post_id )
+		$link = add_query_arg( 'p', absint( $post_id ), $link );
+	/*
+	// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
+	if ( !empty( $_GET['s'] ) )
+		$link = add_query_arg( 's', attribute_escape( stripslashes( $_GET['s'] ) ), $link );
+	*/
+	$status_links[] = &quot;&lt;li class='$status'&gt;&lt;a href='$link'$class&gt;&quot; . sprintf(
+		__ngettext( $label[0], $label[1], $num_comments-&gt;$status ),
+		number_format_i18n( $num_comments-&gt;$status )
+	) . '&lt;/a&gt;';
 }
 
 $status_links = apply_filters( 'comment_status_links', $status_links );
 
-echo implode(' | &lt;/li&gt;', $status_links) . '&lt;/li&gt;';
+echo implode( &quot; |&lt;/li&gt;\n&quot;, $status_links) . '&lt;/li&gt;';
 unset($status_links);
 ?&gt;
 &lt;/ul&gt;
 
-&lt;p id=&quot;post-search&quot;&gt;
-	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e( 'Search Comments' ); ?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php echo $search; ?&gt;&quot; /&gt;
+&lt;p class=&quot;search-box&quot;&gt;
+	&lt;label class=&quot;hidden&quot; for=&quot;comment-search-input&quot;&gt;&lt;?php _e( 'Search Comments' ); ?&gt;:&lt;/label&gt;
+	&lt;input type=&quot;text&quot; class=&quot;search-input&quot; id=&quot;comment-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php _admin_search_query(); ?&gt;&quot; /&gt;
 	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Comments' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
 &lt;/p&gt;
 
-&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo $mode; ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;comment_status&quot; value=&quot;&lt;?php echo $comment_status; ?&gt;&quot; /&gt;
-&lt;/form&gt;
-
-&lt;ul class=&quot;view-switch&quot;&gt;
-	&lt;li &lt;?php if ( 'detail' == $mode ) echo &quot;class='current'&quot; ?&gt;&gt;&lt;a href=&quot;&lt;?php echo clean_url(add_query_arg('mode', 'detail', $_SERVER['REQUEST_URI'])) ?&gt;&quot;&gt;&lt;?php _e('Detail View') ?&gt;&lt;/a&gt;&lt;/li&gt;
-	&lt;li &lt;?php if ( 'list' == $mode ) echo &quot;class='current'&quot; ?&gt;&gt;&lt;a href=&quot;&lt;?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?&gt;&quot;&gt;&lt;?php _e('List View') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;/ul&gt;
-
 &lt;?php
-
 $comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
 
 if ( isset( $_GET['apage'] ) )
@@ -143,7 +188,17 @@ else
 
 $start = $offset = ( $page - 1 ) * $comments_per_page;
 
-list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra
+list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra
+
+$_comment_post_ids = array();
+foreach ( $_comments as $_c ) {
+	$_comment_post_ids[] = $_c-&gt;comment_post_ID;
+}
+$_comment_pending_count_temp = (array) get_pending_comments_num($_comment_post_ids);
+foreach ( (array) $_comment_post_ids as $_cpid )
+	$_comment_pending_count[$_cpid] = isset( $_comment_pending_count_temp[$_cpid] ) ? $_comment_pending_count_temp[$_cpid] : 0;
+if ( empty($_comment_pending_count) )
+	$_comment_pending_count = array();
 
 $comments = array_slice($_comments, 0, $comments_per_page);
 $extra_comments = array_slice($_comments, $comments_per_page);
@@ -151,54 +206,98 @@ $extra_comments = array_slice($_comments, $comments_per_page);
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'apage', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; ceil($total / $comments_per_page),
 	'current' =&gt; $page
 ));
 
 ?&gt;
 
-&lt;form id=&quot;comments-form&quot; action=&quot;&quot; method=&quot;post&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo $mode; ?&gt;&quot; /&gt;
+&lt;?php if ( $post_id ) : ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;p&quot; value=&quot;&lt;?php echo intval( $post_id ); ?&gt;&quot; /&gt;
+&lt;?php endif; ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;comment_status&quot; value=&quot;&lt;?php echo $comment_status; ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;pagegen_timestamp&quot; value=&quot;&lt;?php echo current_time('mysql', 1); ?&gt;&quot; /&gt;
 
 &lt;div class=&quot;tablenav&quot;&gt;
 
-&lt;?php
-if ( $page_links )
-	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
-?&gt;
+&lt;?php if ( $page_links ) : ?&gt;
+&lt;div class=&quot;tablenav-pages&quot;&gt;&lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
+	number_format_i18n( $start + 1 ),
+	number_format_i18n( min( $page * $comments_per_page, $total ) ),
+	number_format_i18n( $total ),
+	$page_links
+); echo $page_links_text; ?&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
 
-&lt;div class=&quot;alignleft&quot;&gt;
-&lt;?php if ( 'approved' != $comment_status ): ?&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Approve'); ?&gt;&quot; name=&quot;approveit&quot; class=&quot;button-secondary&quot; /&gt;
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action&quot;&gt;
+&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions') ?&gt;&lt;/option&gt;
+&lt;?php if ( empty($comment_status) || 'approved' == $comment_status ): ?&gt;
+&lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Unapprove'); ?&gt;&lt;/option&gt;
 &lt;?php endif; ?&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Mark as Spam'); ?&gt;&quot; name=&quot;spamit&quot; class=&quot;button-secondary&quot; /&gt;
-&lt;?php if ( 'moderated' != $comment_status ): ?&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Unapprove'); ?&gt;&quot; name=&quot;unapproveit&quot; class=&quot;button-secondary&quot; /&gt;
+&lt;?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status ): ?&gt;
+&lt;option value=&quot;approve&quot;&gt;&lt;?php _e('Approve'); ?&gt;&lt;/option&gt;
 &lt;?php endif; ?&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Delete'); ?&gt;&quot; name=&quot;deleteit&quot; class=&quot;button-secondary delete&quot; /&gt;
-&lt;?php do_action('manage_comments_nav', $comment_status); ?&gt;
+&lt;?php if ( 'spam' != $comment_status ): ?&gt;
+&lt;option value=&quot;markspam&quot;&gt;&lt;?php _e('Mark as Spam'); ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
 &lt;?php wp_nonce_field('bulk-comments'); ?&gt;
+
+&lt;?php if ( $comment_status ) echo &quot;&lt;input type='hidden' name='comment_status' value='$comment_status' /&gt;\n&quot;; ?&gt;
+&lt;select name=&quot;comment_type&quot;&gt;
+	&lt;option value=&quot;all&quot;&gt;&lt;?php _e('Show all comment types'); ?&gt;&lt;/option&gt;
+&lt;?php
+	$comment_types = apply_filters( 'admin_comment_types_dropdown', array(
+		'comment' =&gt; __('Comments'),
+		'pings' =&gt; __('Pings'),
+	) );
+
+	foreach ( $comment_types as $type =&gt; $label ) {
+		echo &quot;	&lt;option value='$type'&quot;;
+		selected( $comment_type, $type );
+		echo &quot;&gt;$label&lt;/option&gt;\n&quot;;
+	}
+?&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php _e('Filter'); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
+
 &lt;?php if ( isset($_GET['apage']) ) { ?&gt;
 	&lt;input type=&quot;hidden&quot; name=&quot;apage&quot; value=&quot;&lt;?php echo absint( $_GET['apage'] ); ?&gt;&quot; /&gt;
+&lt;?php }
+
+if ( 'spam' == $comment_status ) {
+	wp_nonce_field('bulk-spam-delete', '_spam_nonce'); ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all_spam&quot; value=&quot;&lt;?php _e('Delete All Spam'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
 &lt;?php } ?&gt;
+&lt;?php do_action('manage_comments_nav', $comment_status); ?&gt;
 &lt;/div&gt;
 
 &lt;br class=&quot;clear&quot; /&gt;
 
 &lt;/div&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;?php
-if ($comments) {
-?&gt;
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+
+&lt;?php if ( $comments ) { ?&gt;
+&lt;table class=&quot;widefat comments fixed&quot; cellspacing=&quot;0&quot;&gt;
 &lt;thead&gt;
-  &lt;tr&gt;
-    &lt;th scope=&quot;col&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Comment') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Date') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot; class=&quot;action-links&quot;&gt;&lt;?php _e('Actions') ?&gt;&lt;/th&gt;
-  &lt;/tr&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('edit-comments'); ?&gt;
+	&lt;/tr&gt;
 &lt;/thead&gt;
+
+&lt;tfoot&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('edit-comments', false); ?&gt;
+	&lt;/tr&gt;
+&lt;/tfoot&gt;
+
 &lt;tbody id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;
 &lt;?php
 	foreach ($comments as $comment)
@@ -213,6 +312,37 @@ if ($comments) {
 &lt;/tbody&gt;
 &lt;/table&gt;
 
+&lt;div class=&quot;tablenav&quot;&gt;
+&lt;?php
+if ( $page_links )
+	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
+?&gt;
+
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action2&quot;&gt;
+&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions') ?&gt;&lt;/option&gt;
+&lt;?php if ( empty($comment_status) || 'approved' == $comment_status ): ?&gt;
+&lt;option value=&quot;unapprove&quot;&gt;&lt;?php _e('Unapprove'); ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
+&lt;?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?&gt;
+&lt;option value=&quot;approve&quot;&gt;&lt;?php _e('Approve'); ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
+&lt;?php if ( 'spam' != $comment_status ): ?&gt;
+&lt;option value=&quot;markspam&quot;&gt;&lt;?php _e('Mark as Spam'); ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+
+&lt;?php if ( 'spam' == $comment_status ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;delete_all_spam2&quot; value=&quot;&lt;?php _e('Delete All Spam'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php } ?&gt;
+&lt;?php do_action('manage_comments_nav', $comment_status); ?&gt;
+&lt;/div&gt;
+
+&lt;br class=&quot;clear&quot; /&gt;
+&lt;/div&gt;
+
 &lt;/form&gt;
 
 &lt;form id=&quot;get-extra-comments&quot; method=&quot;post&quot; action=&quot;&quot; class=&quot;add:the-extra-comment-list:&quot; style=&quot;display: none;&quot;&gt;
@@ -220,33 +350,39 @@ if ($comments) {
 	&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo $mode; ?&gt;&quot; /&gt;
 	&lt;input type=&quot;hidden&quot; name=&quot;comment_status&quot; value=&quot;&lt;?php echo $comment_status; ?&gt;&quot; /&gt;
 	&lt;input type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;&lt;?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?&gt;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;p&quot; value=&quot;&lt;?php echo attribute_escape( $post_id ); ?&gt;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;comment_type&quot; value=&quot;&lt;?php echo attribute_escape( $comment_type ); ?&gt;&quot; /&gt;
 	&lt;?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?&gt;
 &lt;/form&gt;
 
 &lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
-&lt;?php
-} elseif ( 'moderated' == $_GET['comment_status'] ) {
-?&gt;
-&lt;p&gt;
-&lt;?php _e('No comments awaiting moderation&amp;hellip; yet.') ?&gt;
-&lt;/p&gt;
-&lt;?php
-} else  {
-?&gt;
-&lt;p&gt;
-&lt;?php _e('No results found.') ?&gt;
-&lt;/p&gt;
-&lt;?php
-}
-?&gt;
-&lt;div class=&quot;tablenav&quot;&gt;
-&lt;?php
-if ( $page_links )
-	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
-?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;/div&gt;
 
+&lt;?php } elseif ( 'moderated' == $_GET['comment_status'] ) { ?&gt;
+&lt;p&gt;&lt;?php _e('No comments awaiting moderation&amp;hellip; yet.') ?&gt;&lt;/p&gt;
+&lt;/form&gt;
+
+&lt;?php } else { ?&gt;
+&lt;p&gt;&lt;?php _e('No results found.') ?&gt;&lt;/p&gt;
+&lt;/form&gt;
+
+&lt;?php } ?&gt;
 &lt;/div&gt;
 
-&lt;?php include('admin-footer.php'); ?&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+(function($){
+	$(document).ready(function(){
+		$('#doaction, #doaction2').click(function(){
+			if ( $('select[name^=&quot;action&quot;]').val() == 'delete' ) {
+				var m = '&lt;?php echo js_escape(__(&quot;You are about to delete the selected comments.\n  'Cancel' to stop, 'OK' to delete.&quot;)); ?&gt;';
+				return showNotice.warn(m);
+			}
+		});
+	});
+})(jQuery);
+/* ]]&gt; */
+&lt;/script&gt;
+
+&lt;?php
+wp_comment_reply('-1', true, 'detail');
+include('admin-footer.php'); ?&gt;</diff>
      <filename>wp-admin/edit-comments.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,31 @@
 &lt;?php
+/**
+ * Post advanced form for inclusion in the administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Post ID global
+ * @name $post_ID
+ * @var int
+ */
+if ( ! isset( $post_ID ) )
+	$post_ID = 0;
+else
+	$post_ID = (int) $post_ID;
 
 $action = isset($action) ? $action : '';
 if ( isset($_GET['message']) )
 	$_GET['message'] = absint( $_GET['message'] );
-$messages[1] = sprintf( __( 'Post updated. Continue editing below or &lt;a href=&quot;%s&quot;&gt;go back&lt;/a&gt;.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
+$messages[1] = sprintf( __( 'Post updated. Continue editing below or &lt;a href=&quot;%s&quot;&gt;go back&lt;/a&gt;.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
 $messages[2] = __('Custom field updated.');
 $messages[3] = __('Custom field deleted.');
 $messages[4] = __('Post updated.');
+$messages[6] = sprintf(__('Post published. &lt;a href=&quot;%s&quot;&gt;View post&lt;/a&gt;'), get_permalink($post_ID));
+$messages[7] = __('Post saved.');
+$messages[8] = sprintf(__('Post submitted. &lt;a href=&quot;%s&quot;&gt;Preview post&lt;/a&gt;'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
 
 if ( isset($_GET['revision']) )
 	$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
@@ -14,21 +33,20 @@ if ( isset($_GET['revision']) )
 $notice = false;
 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below.  &lt;a href=&quot;%s&quot;&gt;View the autosave&lt;/a&gt;.' );
 
-if ( !isset($post_ID) || 0 == $post_ID ) {
+if ( 0 == $post_ID ) {
 	$form_action = 'post';
 	$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
 	$form_extra = &quot;&lt;input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' /&gt;&quot;;
 	$autosave = false;
 } else {
-	$post_ID = (int) $post_ID;
 	$form_action = 'editpost';
 	$form_extra = &quot;&lt;input type='hidden' id='post_ID' name='post_ID' value='$post_ID' /&gt;&quot;;
-	$autosave = wp_get_post_autosave( $post_id );
+	$autosave = wp_get_post_autosave( $post_ID );
 
 	// Detect if there exists an autosave newer than the post and if that autosave is different than the post
 	if ( $autosave &amp;&amp; mysql2date( 'U', $autosave-&gt;post_modified_gmt ) &gt; mysql2date( 'U', $post-&gt;post_modified_gmt ) ) {
 		foreach ( _wp_post_revision_fields() as $autosave_field =&gt; $_autosave_field ) {
-			if ( wp_text_diff( $autosave-&gt;$autosave_field, $post-&gt;$autosave_field ) ) {
+			if ( normalize_whitespace( $autosave-&gt;$autosave_field ) != normalize_whitespace( $post-&gt;$autosave_field ) ) {
 				$notice = sprintf( $notices[1], get_edit_post_link( $autosave-&gt;ID ) );
 				break;
 			}
@@ -37,215 +55,235 @@ if ( !isset($post_ID) || 0 == $post_ID ) {
 	}
 }
 
+// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
+
+/**
+ * Display post submit form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function post_submit_meta_box($post) {
+	global $action;
+
+	$can_publish = current_user_can('publish_posts');
 ?&gt;
-&lt;?php if ( $notice ) : ?&gt;
-&lt;div id=&quot;notice&quot; class=&quot;error&quot;&gt;&lt;p&gt;&lt;?php echo $notice ?&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php endif; ?&gt;
-&lt;?php if (isset($_GET['message'])) : ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php endif; ?&gt;
+&lt;div class=&quot;submitbox&quot; id=&quot;submitpost&quot;&gt;
 
-&lt;form name=&quot;post&quot; action=&quot;post.php&quot; method=&quot;post&quot; id=&quot;post&quot;&gt;
-&lt;?php if ( (isset($mode) &amp;&amp; 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;bookmarklet&quot; /&gt;
-&lt;?php endif; ?&gt;
+&lt;div id=&quot;minor-publishing&quot;&gt;
 
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php _e('Write Post') ?&gt;&lt;/h2&gt;
-&lt;?php
+&lt;?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?&gt;
+&lt;div style=&quot;display:none;&quot;&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php echo attribute_escape( __('Save') ); ?&gt;&quot; /&gt;
+&lt;/div&gt;
 
-if ( !isset($post_ID) || 0 == $post_ID)
-	wp_nonce_field('add-post');
-else
-	wp_nonce_field('update-post_' .  $post_ID);
+&lt;div id=&quot;minor-publishing-actions&quot;&gt;
+&lt;div id=&quot;save-action&quot;&gt;
+&lt;?php if ( 'publish' != $post-&gt;post_status &amp;&amp; 'future' != $post-&gt;post_status &amp;&amp; 'pending' != $post-&gt;post_status )  { ?&gt;
+&lt;input &lt;?php if ( 'private' == $post-&gt;post_status ) { ?&gt;style=&quot;display:none&quot;&lt;?php } ?&gt; type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php echo attribute_escape( __('Save Draft') ); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;?php } elseif ( 'pending' == $post-&gt;post_status &amp;&amp; $can_publish ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php echo attribute_escape( __('Save as Pending') ); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
 
-$form_pingback = '&lt;input type=&quot;hidden&quot; name=&quot;post_pingback&quot; value=&quot;' . (int) get_option('default_pingback_flag') . '&quot; id=&quot;post_pingback&quot; /&gt;';
+&lt;div id=&quot;preview-action&quot;&gt;
+&lt;?php $preview_link = 'publish' == $post-&gt;post_status ? clean_url(get_permalink($post-&gt;ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post-&gt;ID)))); ?&gt;
 
-$form_prevstatus = '&lt;input type=&quot;hidden&quot; name=&quot;prev_status&quot; value=&quot;' . attribute_escape( $post-&gt;post_status ) . '&quot; /&gt;';
+&lt;a class=&quot;preview button&quot; href=&quot;&lt;?php echo $preview_link; ?&gt;&quot; target=&quot;wp-preview&quot; id=&quot;post-preview&quot; tabindex=&quot;4&quot;&gt;&lt;?php _e('Preview'); ?&gt;&lt;/a&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;wp-preview&quot; id=&quot;wp-preview&quot; value=&quot;&quot; /&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;&lt;?php // /minor-publishing-actions ?&gt;
 
-$saveasdraft = '&lt;input name=&quot;save&quot; type=&quot;submit&quot; id=&quot;save&quot; class=&quot;button&quot; tabindex=&quot;3&quot; value=&quot;' . attribute_escape( __('Save and Continue Editing') ) . '&quot; /&gt;';
+&lt;div id=&quot;misc-publishing-actions&quot;&gt;
 
+&lt;div class=&quot;misc-pub-section&lt;?php if ( !$can_publish ) { echo '  misc-pub-section-last'; } ?&gt;&quot;&gt;&lt;label for=&quot;post_status&quot;&gt;&lt;?php _e('Status:') ?&gt;&lt;/label&gt;
+&lt;b&gt;&lt;span id=&quot;post-status-display&quot;&gt;
+&lt;?php
+switch ( $post-&gt;post_status ) {
+	case 'private':
+		_e('Privately Published');
+		break;
+	case 'publish':
+		_e('Published');
+		break;
+	case 'future':
+		_e('Scheduled');
+		break;
+	case 'pending':
+		_e('Pending Review');
+		break;
+	case 'draft':
+		_e('Draft');
+		break;
+}
 ?&gt;
+&lt;/span&gt;&lt;/b&gt;
+&lt;?php if ( 'publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status || $can_publish ) { ?&gt;
+&lt;a href=&quot;#post_status&quot; &lt;?php if ( 'private' == $post-&gt;post_status ) { ?&gt;style=&quot;display:none;&quot; &lt;?php } ?&gt;class=&quot;edit-post-status hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
 
-&lt;input type=&quot;hidden&quot; id=&quot;user-id&quot; name=&quot;user_ID&quot; value=&quot;&lt;?php echo (int) $user_ID ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;hiddenaction&quot; name=&quot;action&quot; value=&quot;&lt;?php echo $form_action ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;originalaction&quot; name=&quot;originalaction&quot; value=&quot;&lt;?php echo $form_action ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;post_author&quot; name=&quot;post_author&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_author ); ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;post_type&quot; name=&quot;post_type&quot; value=&quot;&lt;?php echo $post-&gt;post_type ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;original_post_status&quot; name=&quot;original_post_status&quot; value=&quot;&lt;?php echo $post-&gt;post_status ?&gt;&quot; /&gt;
-&lt;input name=&quot;referredby&quot; type=&quot;hidden&quot; id=&quot;referredby&quot; value=&quot;&lt;?php echo clean_url(stripslashes(wp_get_referer())); ?&gt;&quot; /&gt;
-&lt;?php if ( 'draft' != $post-&gt;post_status ) wp_original_referer_field(true, 'previous'); ?&gt;
+&lt;div id=&quot;post-status-select&quot; class=&quot;hide-if-js&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_status&quot; id=&quot;hidden_post_status&quot; value=&quot;&lt;?php echo $post-&gt;post_status; ?&gt;&quot; /&gt;
+&lt;select name='post_status' id='post_status' tabindex='4'&gt;
+&lt;?php if ( 'publish' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'publish' ); ?&gt; value='publish'&gt;&lt;?php _e('Published') ?&gt;&lt;/option&gt;
+&lt;?php elseif ( 'private' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'private' ); ?&gt; value='publish'&gt;&lt;?php _e('Privately Published') ?&gt;&lt;/option&gt;
+&lt;?php elseif ( 'future' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'future' ); ?&gt; value='future'&gt;&lt;?php _e('Scheduled') ?&gt;&lt;/option&gt;
+&lt;?php endif; ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'pending' ); ?&gt; value='pending'&gt;&lt;?php _e('Pending Review') ?&gt;&lt;/option&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'draft' ); ?&gt; value='draft'&gt;&lt;?php _e('Draft') ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+ &lt;a href=&quot;#post_status&quot; class=&quot;save-post-status hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+ &lt;a href=&quot;#post_status&quot; class=&quot;cancel-post-status hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+&lt;/div&gt;
 
-&lt;?php echo $form_extra ?&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+
+&lt;div class=&quot;misc-pub-section &quot; id=&quot;visibility&quot;&gt;
+&lt;?php _e('Visibility:'); ?&gt; &lt;b&gt;&lt;span id=&quot;post-visibility-display&quot;&gt;&lt;?php
+
+if ( 'private' == $post-&gt;post_status ) {
+	$post-&gt;post_password = '';
+	$visibility = 'private';
+	$visibility_trans = __('Private');
+} elseif ( !empty( $post-&gt;post_password ) ) {
+	$visibility = 'password';
+	$visibility_trans = __('Password protected');
+} elseif ( is_sticky( $post-&gt;ID ) ) {
+	$visibility = 'public';
+	$visibility_trans = __('Public, Sticky');
+} else {
+	$visibility = 'public';
+	$visibility_trans = __('Public');
+}
 
-&lt;div id=&quot;poststuff&quot;&gt;
+?&gt;&lt;?php echo wp_specialchars( $visibility_trans ); ?&gt;&lt;/span&gt;&lt;/b&gt; &lt;?php if ( $can_publish ) { ?&gt; &lt;a href=&quot;#visibility&quot; class=&quot;edit-visibility hide-if-no-js&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/a&gt;
 
-&lt;div class=&quot;submitbox&quot; id=&quot;submitpost&quot;&gt;
+&lt;div id=&quot;post-visibility-select&quot; class=&quot;hide-if-js&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_password&quot; id=&quot;hidden-post-password&quot; value=&quot;&lt;?php echo attribute_escape($post-&gt;post_password); ?&gt;&quot; /&gt;
+&lt;input type=&quot;checkbox&quot; style=&quot;display:none&quot; name=&quot;hidden_post_sticky&quot; id=&quot;hidden-post-sticky&quot; value=&quot;sticky&quot; &lt;?php checked(is_sticky($post-&gt;ID), true); ?&gt; /&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_visibility&quot; id=&quot;hidden-post-visibility&quot; value=&quot;&lt;?php echo attribute_escape( $visibility ); ?&gt;&quot; /&gt;
 
-&lt;div id=&quot;previewview&quot;&gt;
-&lt;?php if ( 'publish' == $post-&gt;post_status ) { ?&gt;
-&lt;a href=&quot;&lt;?php echo clean_url(get_permalink($post-&gt;ID)); ?&gt;&quot; target=&quot;_blank&quot; tabindex=&quot;4&quot;&gt;&lt;?php _e('View this Post'); ?&gt;&lt;/a&gt;
-&lt;?php } elseif ( 'edit' == $action ) { ?&gt;
-&lt;a href=&quot;&lt;?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post-&gt;ID)))); ?&gt;&quot; target=&quot;_blank&quot;  tabindex=&quot;4&quot;&gt;&lt;?php _e('Preview this Post'); ?&gt;&lt;/a&gt;
-&lt;?php } ?&gt;
-&lt;/div&gt;
 
-&lt;div class=&quot;inside&quot;&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-public&quot; value=&quot;public&quot; &lt;?php checked( $visibility, 'public' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-public&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Public'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;span id=&quot;sticky-span&quot;&gt;&lt;input id=&quot;sticky&quot; name=&quot;sticky&quot; type=&quot;checkbox&quot; value=&quot;sticky&quot; &lt;?php checked(is_sticky($post-&gt;ID), true); ?&gt; tabindex=&quot;4&quot; /&gt; &lt;label for=&quot;sticky&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Stick this post to the front page') ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-password&quot; value=&quot;password&quot; &lt;?php checked( $visibility, 'password' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-password&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Password protected'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;span id=&quot;password-span&quot;&gt;&lt;label for=&quot;post_password&quot;&gt;&lt;?php _e('Password:'); ?&gt;&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;post_password&quot; id=&quot;post_password&quot; value=&quot;&lt;?php echo attribute_escape($post-&gt;post_password); ?&gt;&quot; /&gt;&lt;br /&gt;&lt;/span&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-private&quot; value=&quot;private&quot; &lt;?php checked( $visibility, 'private' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-private&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Private'); ?&gt;&lt;/label&gt;&lt;br /&gt;
 
-&lt;p&gt;&lt;strong&gt;&lt;label for='post_status'&gt;&lt;?php _e('Publish Status') ?&gt;&lt;/label&gt;&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;
-&lt;select name='post_status' id='post_status' tabindex='4'&gt;
-&lt;?php 
-// only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability) 
-if ( current_user_can('publish_posts') OR ( $post-&gt;post_status == 'publish' AND current_user_can('edit_post', $post-&gt;ID) ) ) :
-?&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'publish' ); selected( $post-&gt;post_status, 'private' );?&gt; value='publish'&gt;&lt;?php _e('Published') ?&gt;&lt;/option&gt;
-&lt;?php if ( 'future' == $post-&gt;post_status ) : ?&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'future' ); ?&gt; value='future'&gt;&lt;?php _e('Scheduled') ?&gt;&lt;/option&gt;
-&lt;?php endif; ?&gt;
-&lt;?php endif; ?&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'pending' ); ?&gt; value='pending'&gt;&lt;?php _e('Pending Review') ?&gt;&lt;/option&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'draft' ); ?&gt; value='draft'&gt;&lt;?php _e('Unpublished') ?&gt;&lt;/option&gt;
-&lt;/select&gt;
+ &lt;a href=&quot;#visibility&quot; class=&quot;save-post-visibility hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+ &lt;a href=&quot;#visibility&quot; class=&quot;cancel-post-visibility hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
 &lt;/p&gt;
+&lt;/div&gt;
+&lt;?php } ?&gt;
+
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+
 
-&lt;?php if ( current_user_can( 'publish_posts' ) ) : ?&gt;
-&lt;p id=&quot;private-checkbox&quot;&gt;&lt;label for=&quot;post_status_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;post_status_private&quot; name=&quot;post_status&quot; type=&quot;checkbox&quot; value=&quot;private&quot; &lt;?php checked($post-&gt;post_status, 'private'); ?&gt; tabindex=&quot;4&quot; /&gt; &lt;?php _e('Keep this post private') ?&gt;&lt;/label&gt;&lt;/p&gt;
-&lt;?php endif; ?&gt;
 &lt;?php
-if ($post_ID) {
+$datef = _c( 'M j, Y @ G:i|Publish box date format');
+if ( 0 != $post-&gt;ID ) {
 	if ( 'future' == $post-&gt;post_status ) { // scheduled for publishing at a future date
-		$stamp = __('Scheduled for:&lt;br /&gt;%1$s at %2$s');
-	} else if ( 'publish' == $post-&gt;post_status ) { // already published
-		$stamp = __('Published on:&lt;br /&gt;%1$s at %2$s');
-	} else if ( '0000-00-00 00:00:00' == $post-&gt;post_date ) { // draft, 1 or more saves, no date specified
-		$stamp = __('Publish immediately');
+		$stamp = __('Scheduled for: &lt;b&gt;%1$s&lt;/b&gt;');
+	} else if ( 'publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status ) { // already published
+		$stamp = __('Published on: &lt;b&gt;%1$s&lt;/b&gt;');
+	} else if ( '0000-00-00 00:00:00' == $post-&gt;post_date_gmt ) { // draft, 1 or more saves, no date specified
+		$stamp = __('Publish &lt;b&gt;immediately&lt;/b&gt;');
+	} else if ( time() &lt; strtotime( $post-&gt;post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
+		$stamp = __('Schedule for: &lt;b&gt;%1$s&lt;/b&gt;');
 	} else { // draft, 1 or more saves, date specified
-		$stamp = __('Publish on:&lt;br /&gt;%1$s at %2$s');
+		$stamp = __('Publish on: &lt;b&gt;%1$s&lt;/b&gt;');
 	}
-	$date = mysql2date(get_option('date_format'), $post-&gt;post_date);
-	$time = mysql2date(get_option('time_format'), $post-&gt;post_date);
+	$date = date_i18n( $datef, strtotime( $post-&gt;post_date ) );
 } else { // draft (no saves, and thus no date specified)
-	$stamp = __('Publish immediately');
-	$date = mysql2date(get_option('date_format'), current_time('mysql'));
-	$time = mysql2date(get_option('time_format'), current_time('mysql'));
+	$stamp = __('Publish &lt;b&gt;immediately&lt;/b&gt;');
+	$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
 }
 ?&gt;
-&lt;?php if ( current_user_can( 'publish_posts' ) ) : // Contributors don't get to choose the date of publish ?&gt;
-&lt;p class=&quot;curtime&quot;&gt;&lt;?php printf($stamp, $date, $time); ?&gt;
-&amp;nbsp;&lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;&lt;/p&gt;
-
-&lt;div id='timestampdiv' class='hide-if-js'&gt;&lt;?php touch_time(($action == 'edit'),1,4); ?&gt;&lt;/div&gt;
+&lt;?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?&gt;
+&lt;div class=&quot;misc-pub-section curtime misc-pub-section-last&quot;&gt;
+	&lt;span id=&quot;timestamp&quot;&gt;
+	&lt;?php printf($stamp, $date); ?&gt;&lt;/span&gt;
+	&lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
+	&lt;div id=&quot;timestampdiv&quot; class=&quot;hide-if-js&quot;&gt;&lt;?php touch_time(($action == 'edit'),1,4); ?&gt;&lt;/div&gt;
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
 &lt;?php endif; ?&gt;
 
 &lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
 
-&lt;p class=&quot;submit&quot;&gt;
-&lt;input type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php _e('Save'); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;div id=&quot;major-publishing-actions&quot;&gt;
+&lt;?php do_action('post_submitbox_start'); ?&gt;
+&lt;div id=&quot;delete-action&quot;&gt;
 &lt;?php
-if ( !in_array( $post-&gt;post_status, array('publish', 'future') ) || 0 == $post_ID ) {
-?&gt;
+if ( ( 'edit' == $action ) &amp;&amp; current_user_can('delete_post', $post-&gt;ID) ) { ?&gt;
+&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID); ?&gt;&quot; onclick=&quot;if ( confirm('&lt;?php echo js_escape(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )); ?&gt;') ) {return true;}return false;&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;publishing-action&quot;&gt;
+&lt;?php
+if ( !in_array( $post-&gt;post_status, array('publish', 'future', 'private') ) || 0 == $post-&gt;ID ) { ?&gt;
 &lt;?php if ( current_user_can('publish_posts') ) : ?&gt;
-	&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Publish') ?&gt;&quot; /&gt;
+	&lt;?php if ( !empty($post-&gt;post_date_gmt) &amp;&amp; time() &lt; strtotime( $post-&gt;post_date_gmt . ' +0000' ) ) : ?&gt;
+		&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Schedule') ?&gt;&quot; /&gt;
+		&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Schedule') ?&gt;&quot; /&gt;
+	&lt;?php else : ?&gt;
+		&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Publish') ?&gt;&quot; /&gt;
+		&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Publish') ?&gt;&quot; /&gt;
+	&lt;?php endif; ?&gt;
 &lt;?php else : ?&gt;
-	&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Submit for Review') ?&gt;&quot; /&gt;
+	&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Submit for Review') ?&gt;&quot; /&gt;
+	&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Submit for Review') ?&gt;&quot; /&gt;
 &lt;?php endif; ?&gt;
-&lt;?php
-}
-
-if ( ( 'edit' == $action) &amp;&amp; current_user_can('delete_post', $post_ID) )
-	echo &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post_ID&quot;, 'delete-post_' . $post_ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete&amp;nbsp;post') . &quot;&lt;/a&gt;&quot;;
-?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;?php if ($post_ID): ?&gt;
-&lt;?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
-	$last_user = get_userdata($last_id);
-	printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user-&gt;display_name ), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
-} else {
-	printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
-}
-?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;?php endif; ?&gt;
-&lt;span id=&quot;autosave&quot;&gt;&lt;/span&gt;
-&lt;span id=&quot;wp-word-count&quot;&gt;&lt;/span&gt;
-&lt;/p&gt;
-
-&lt;div class=&quot;side-info&quot;&gt;
-&lt;h5&gt;&lt;?php _e('Related') ?&gt;&lt;/h5&gt;
-
-&lt;ul&gt;
-&lt;?php if ($post_ID): ?&gt;
-&lt;li&gt;&lt;a href=&quot;edit.php?p=&lt;?php echo $post_ID ?&gt;&quot;&gt;&lt;?php _e('See Comments on this Post') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;?php endif; ?&gt;
-&lt;li&gt;&lt;a href=&quot;edit-comments.php&quot;&gt;&lt;?php _e('Manage All Comments') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;edit.php&quot;&gt;&lt;?php _e('Manage All Posts') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;categories.php&quot;&gt;&lt;?php _e('Manage All Categories') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;edit-tags.php&quot;&gt;&lt;?php _e('Manage All Tags') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;edit.php?post_status=draft&quot;&gt;&lt;?php _e('View Drafts'); ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;?php do_action('post_relatedlinks_list'); ?&gt;
-&lt;/ul&gt;
-
-&lt;h5&gt;&lt;?php _e('Shortcuts') ?&gt;&lt;/h5&gt;
-&lt;p&gt;&lt;?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?&gt;  &lt;a href=&quot;&lt;?php echo get_shortcut_link(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(__('Press This')) ?&gt;&quot;&gt;&lt;?php _e('Press This') ?&gt;&lt;/a&gt;&lt;/p&gt;
-&lt;/div&gt;
-
-&lt;?php do_action('submitpost_box'); ?&gt;
-&lt;/div&gt;
-
-&lt;div id=&quot;post-body&quot;&gt;
-&lt;div id=&quot;titlediv&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;title&quot;&gt;&lt;?php _e('Title') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div id=&quot;titlewrap&quot;&gt;
-	&lt;input type=&quot;text&quot; name=&quot;post_title&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo attribute_escape($post-&gt;post_title); ?&gt;&quot; id=&quot;title&quot; autocomplete=&quot;off&quot; /&gt;
-&lt;/div&gt;
-&lt;div class=&quot;inside&quot;&gt;
-&lt;?php $sample_permalink_html = get_sample_permalink_html($post-&gt;ID); ?&gt;
-	&lt;div id=&quot;edit-slug-box&quot;&gt;
-&lt;?php if ( ! empty($post-&gt;ID) &amp;&amp; ! empty($sample_permalink_html) ) :
-	echo $sample_permalink_html;
-endif; ?&gt;
-	&lt;/div&gt;
+&lt;?php } else { ?&gt;
+	&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Update Post') ?&gt;&quot; /&gt;
+	&lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Update Post') ?&gt;&quot; /&gt;
+&lt;?php } ?&gt;
 &lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
-
-&lt;div id=&quot;&lt;?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?&gt;&quot; class=&quot;postarea&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;content&quot;&gt;&lt;?php _e('Post') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;?php the_editor($post-&gt;post_content); ?&gt;
-&lt;?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?&gt;
-&lt;?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?&gt;
-&lt;?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?&gt;
-&lt;?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?&gt;
 &lt;/div&gt;
 
-&lt;?php echo $form_pingback ?&gt;
-&lt;?php echo $form_prevstatus ?&gt;
-
 &lt;?php
+}
+add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
+
+/**
+ * Display post tags form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_tags_meta_box($post) {
 ?&gt;
 &lt;p id=&quot;jaxtag&quot;&gt;&lt;label class=&quot;hidden&quot; for=&quot;newtag&quot;&gt;&lt;?php _e('Tags'); ?&gt;&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;tags_input&quot; class=&quot;tags-input&quot; id=&quot;tags-input&quot; size=&quot;40&quot; tabindex=&quot;3&quot; value=&quot;&lt;?php echo get_tags_to_edit( $post-&gt;ID ); ?&gt;&quot; /&gt;&lt;/p&gt;
 &lt;div id=&quot;tagchecklist&quot;&gt;&lt;/div&gt;
+&lt;p id=&quot;tagcloud-link&quot; class=&quot;hide-if-no-js&quot;&gt;&lt;a href='#'&gt;&lt;?php _e( 'Choose from the most popular tags' ); ?&gt;&lt;/a&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal', 'core');
-
+add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');
+
+/**
+ * Display post categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_categories_meta_box($post) {
 ?&gt;
-&lt;div id=&quot;category-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
-	&lt;h4&gt;&lt;a id=&quot;category-add-toggle&quot; href=&quot;#category-add&quot; class=&quot;hide-if-no-js&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( '+ Add New Category' ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
-	&lt;p id=&quot;category-add&quot; class=&quot;wp-hidden-child&quot;&gt;
-		&lt;label class=&quot;hidden&quot; for=&quot;newcat&quot;&gt;&lt;?php _e( 'Add New Category' ); ?&gt;&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;newcat&quot; id=&quot;newcat&quot; class=&quot;form-required form-input-tip&quot; value=&quot;&lt;?php _e( 'New category name' ); ?&gt;&quot; tabindex=&quot;3&quot; aria-required=&quot;true&quot;/&gt;
-		&lt;label class=&quot;hidden&quot; for=&quot;newcat_parent&quot;&gt;&lt;?php _e('Parent category'); ?&gt;:&lt;/label&gt;&lt;?php wp_dropdown_categories( array( 'hide_empty' =&gt; 0, 'name' =&gt; 'newcat_parent', 'orderby' =&gt; 'name', 'hierarchical' =&gt; 1, 'show_option_none' =&gt; __('Parent category'), 'tab_index' =&gt; 3 ) ); ?&gt;
-		&lt;input type=&quot;button&quot; id=&quot;category-add-sumbit&quot; class=&quot;add:categorychecklist:category-add button&quot; value=&quot;&lt;?php _e( 'Add' ); ?&gt;&quot; tabindex=&quot;3&quot; /&gt;
-		&lt;?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?&gt;
-		&lt;span id=&quot;category-ajax-response&quot;&gt;&lt;/span&gt;
-	&lt;/p&gt;
-&lt;/div&gt;
-
 &lt;ul id=&quot;category-tabs&quot;&gt;
 	&lt;li class=&quot;ui-tabs-selected&quot;&gt;&lt;a href=&quot;#categories-all&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( 'All Categories' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
-	&lt;li class=&quot;wp-no-js-hidden&quot;&gt;&lt;a href=&quot;#categories-pop&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( 'Most Used' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+	&lt;li class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#categories-pop&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( 'Most Used' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 
 &lt;div id=&quot;categories-pop&quot; class=&quot;ui-tabs-panel&quot; style=&quot;display: none;&quot;&gt;
@@ -259,28 +297,67 @@ function post_categories_meta_box($post) {
 		&lt;?php wp_category_checklist($post-&gt;ID, false, false, $popular_ids) ?&gt;
 	&lt;/ul&gt;
 &lt;/div&gt;
+
+&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
+&lt;div id=&quot;category-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
+	&lt;h4&gt;&lt;a id=&quot;category-add-toggle&quot; href=&quot;#category-add&quot; class=&quot;hide-if-no-js&quot; tabindex=&quot;3&quot;&gt;&lt;?php _e( '+ Add New Category' ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
+	&lt;p id=&quot;category-add&quot; class=&quot;wp-hidden-child&quot;&gt;
+		&lt;label class=&quot;hidden&quot; for=&quot;newcat&quot;&gt;&lt;?php _e( 'Add New Category' ); ?&gt;&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;newcat&quot; id=&quot;newcat&quot; class=&quot;form-required form-input-tip&quot; value=&quot;&lt;?php _e( 'New category name' ); ?&gt;&quot; tabindex=&quot;3&quot; aria-required=&quot;true&quot;/&gt;
+		&lt;label class=&quot;hidden&quot; for=&quot;newcat_parent&quot;&gt;&lt;?php _e('Parent category'); ?&gt;:&lt;/label&gt;&lt;?php wp_dropdown_categories( array( 'hide_empty' =&gt; 0, 'name' =&gt; 'newcat_parent', 'orderby' =&gt; 'name', 'hierarchical' =&gt; 1, 'show_option_none' =&gt; __('Parent category'), 'tab_index' =&gt; 3 ) ); ?&gt;
+		&lt;input type=&quot;button&quot; id=&quot;category-add-sumbit&quot; class=&quot;add:categorychecklist:category-add button&quot; value=&quot;&lt;?php _e( 'Add' ); ?&gt;&quot; tabindex=&quot;3&quot; /&gt;
+		&lt;?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?&gt;
+		&lt;span id=&quot;category-ajax-response&quot;&gt;&lt;/span&gt;
+	&lt;/p&gt;
+&lt;/div&gt;
 &lt;?php
+endif;
+
 }
-add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal', 'core');
+add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
+
+/**
+ * Display post password form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_password_meta_box($post) {
 ?&gt;
-
-&lt;?php do_meta_boxes('post', 'normal', $post); ?&gt;
-
-&lt;?php do_action('edit_form_advanced'); ?&gt;
-
-&lt;h2&gt;&lt;?php _e('Advanced Options'); ?&gt;&lt;/h2&gt;
-
+&lt;p&gt;
+	&lt;label for=&quot;post_status_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;post_status_private&quot; name=&quot;post_status&quot; type=&quot;checkbox&quot; value=&quot;private&quot; &lt;?php checked($post-&gt;post_status, 'private'); ?&gt; tabindex=&quot;4&quot; /&gt; &lt;?php _e('Keep this post private') ?&gt;&lt;/label&gt;
+&lt;/p&gt;
+&lt;h4&gt;&lt;?php _e( 'Post Password' ); ?&gt;&lt;/h4&gt;
+&lt;p&gt;&lt;label class=&quot;hidden&quot; for=&quot;post_password&quot;&gt;&lt;?php _e('Password Protect This Post') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_password&quot; type=&quot;text&quot; size=&quot;25&quot; id=&quot;post_password&quot; value=&quot;&lt;?php the_post_password(); ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p&gt;&lt;?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?&gt;&lt;/p&gt;
 &lt;?php
+}
+// add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
+
+/**
+ * Display post excerpt form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_excerpt_meta_box($post) {
 ?&gt;
 &lt;label class=&quot;hidden&quot; for=&quot;excerpt&quot;&gt;&lt;?php _e('Excerpt') ?&gt;&lt;/label&gt;&lt;textarea rows=&quot;1&quot; cols=&quot;40&quot; name=&quot;excerpt&quot; tabindex=&quot;6&quot; id=&quot;excerpt&quot;&gt;&lt;?php echo $post-&gt;post_excerpt ?&gt;&lt;/textarea&gt;
 &lt;p&gt;&lt;?php _e('Excerpts are optional hand-crafted summaries of your content. You can &lt;a href=&quot;http://codex.wordpress.org/Template_Tags/the_excerpt&quot; target=&quot;_blank&quot;&gt;use them in your template&lt;/a&gt;'); ?&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'advanced', 'core');
-
+add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
+
+/**
+ * Display trackback links form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_trackback_meta_box($post) {
-	$form_trackback = '&lt;input type=&quot;text&quot; name=&quot;trackback_url&quot; style=&quot;width: 415px&quot; id=&quot;trackback&quot; tabindex=&quot;7&quot; value=&quot;'. attribute_escape( str_replace(&quot;\n&quot;, ' ', $post-&gt;to_ping) ) .'&quot; /&gt;';
+	$form_trackback = '&lt;input type=&quot;text&quot; name=&quot;trackback_url&quot; id=&quot;trackback_url&quot; tabindex=&quot;7&quot; value=&quot;'. attribute_escape( str_replace(&quot;\n&quot;, ' ', $post-&gt;to_ping) ) .'&quot; /&gt;';
 	if ('' != $post-&gt;pinged) {
 		$pings = '&lt;p&gt;'. __('Already pinged:') . '&lt;/p&gt;&lt;ul&gt;';
 		$already_pinged = explode(&quot;\n&quot;, trim($post-&gt;pinged));
@@ -291,67 +368,108 @@ function post_trackback_meta_box($post) {
 	}
 
 ?&gt;
-&lt;p&gt;&lt;label for=&quot;trackback&quot;&gt;&lt;?php _e('Send trackbacks to:'); ?&gt;&lt;/label&gt; &lt;?php echo $form_trackback; ?&gt;&lt;br /&gt; (&lt;?php _e('Separate multiple URLs with spaces'); ?&gt;)&lt;/p&gt;
+&lt;p&gt;&lt;label for=&quot;trackback_url&quot;&gt;&lt;?php _e('Send trackbacks to:'); ?&gt;&lt;/label&gt; &lt;?php echo $form_trackback; ?&gt;&lt;br /&gt; (&lt;?php _e('Separate multiple URLs with spaces'); ?&gt;)&lt;/p&gt;
 &lt;p&gt;&lt;?php _e('Trackbacks are a way to notify legacy blog systems that you&amp;#8217;ve linked to them. If you link other WordPress blogs they&amp;#8217;ll be notified automatically using &lt;a href=&quot;http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments&quot; target=&quot;_blank&quot;&gt;pingbacks&lt;/a&gt;, no other action necessary.'); ?&gt;&lt;/p&gt;
 &lt;?php
 if ( ! empty($pings) )
 	echo $pings;
 }
-add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core');
-
+add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
+
+/**
+ * Display custom fields for the post form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_custom_meta_box($post) {
 ?&gt;
 &lt;div id=&quot;postcustomstuff&quot;&gt;
-&lt;table cellpadding=&quot;3&quot;&gt;
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
 &lt;?php
 $metadata = has_meta($post-&gt;ID);
 list_meta($metadata);
+meta_form();
 ?&gt;
-
-&lt;/table&gt;
-&lt;?php
-	meta_form();
-?&gt;
-&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;p&gt;&lt;?php _e('Custom fields can be used to add extra metadata to a post that you can &lt;a href=&quot;http://codex.wordpress.org/Using_Custom_Fields&quot; target=&quot;_blank&quot;&gt;use in your theme&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'advanced', 'core');
+add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core');
 
 do_action('dbx_post_advanced');
 
+/**
+ * Display comment status for post form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_comment_status_meta_box($post) {
+	global $wpdb, $post_ID;
 ?&gt;
 &lt;input name=&quot;advanced_view&quot; type=&quot;hidden&quot; value=&quot;1&quot; /&gt;
-&lt;p&gt;&lt;label for=&quot;comment_status&quot; class=&quot;selectit&quot;&gt;
-&lt;input name=&quot;comment_status&quot; type=&quot;checkbox&quot; id=&quot;comment_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;comment_status, 'open'); ?&gt; /&gt;
-&lt;?php _e('Allow Comments') ?&gt;&lt;/label&gt;&lt;/p&gt;
-&lt;p&gt;&lt;label for=&quot;ping_status&quot; class=&quot;selectit&quot;&gt;&lt;input name=&quot;ping_status&quot; type=&quot;checkbox&quot; id=&quot;ping_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;ping_status, 'open'); ?&gt; /&gt; &lt;?php _e('Allow Pings') ?&gt;&lt;/label&gt;&lt;/p&gt;
-&lt;p&gt;&lt;?php _e('These settings apply to this post only. &amp;#8220;Pings&amp;#8221; are &lt;a href=&quot;http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments&quot; target=&quot;_blank&quot;&gt;trackbacks and pingbacks&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
+&lt;p class=&quot;meta-options&quot;&gt;
+	&lt;label for=&quot;comment_status&quot; class=&quot;selectit&quot;&gt; &lt;input name=&quot;comment_status&quot; type=&quot;checkbox&quot; id=&quot;comment_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;comment_status, 'open'); ?&gt; /&gt; &lt;?php _e('Allow comments on this post') ?&gt;&lt;/label&gt;&lt;br /&gt;
+	&lt;label for=&quot;ping_status&quot; class=&quot;selectit&quot;&gt;&lt;input name=&quot;ping_status&quot; type=&quot;checkbox&quot; id=&quot;ping_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;ping_status, 'open'); ?&gt; /&gt; &lt;?php _e('Allow &lt;a href=&quot;http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments&quot; target=&quot;_blank&quot;&gt;trackbacks and pingbacks&lt;/a&gt; on this post') ?&gt;&lt;/label&gt;
+&lt;/p&gt;
 &lt;?php
-}
-add_meta_box('commentstatusdiv', __('Comments &amp;amp; Pings'), 'post_comment_status_meta_box', 'post', 'advanced', 'core');
+	$total = $wpdb-&gt;get_var($wpdb-&gt;prepare(&quot;SELECT count(1) FROM $wpdb-&gt;comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')&quot;, $post_ID));
 
-function post_password_meta_box($post) {
+	if ( !$post_ID || $post_ID &lt; 0 || 1 &gt; $total )
+		return;
+
+wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
 ?&gt;
-&lt;p&gt;&lt;label class=&quot;hidden&quot; for=&quot;post_password&quot;&gt;&lt;?php _e('Password Protect This Post') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_password&quot; type=&quot;text&quot; size=&quot;25&quot; id=&quot;post_password&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_password ); ?&gt;&quot; /&gt;&lt;/p&gt;
-&lt;p&gt;&lt;?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?&gt;&lt;/p&gt;
+
+&lt;table class=&quot;widefat comments-box fixed&quot; cellspacing=&quot;0&quot; style=&quot;display:none;&quot;&gt;
+&lt;thead&gt;
+	&lt;tr&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-author&quot;&gt;&lt;?php _e('Author') ?&gt;&lt;/th&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-comment&quot;&gt;&lt;?php echo _c('Comment|noun') ?&gt;&lt;/th&gt;
+  &lt;/tr&gt;
+&lt;/thead&gt;
+&lt;tbody id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;
+&lt;/tbody&gt;
+&lt;/table&gt;
+&lt;p class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#commentstatusdiv&quot; id=&quot;show-comments&quot; onclick=&quot;commentsBox.get(&lt;?php echo $total; ?&gt;);return false;&quot;&gt;&lt;?php _e('Show comments'); ?&gt;&lt;/a&gt; &lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;images/loading.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
 &lt;?php
+	$hidden = get_hidden_meta_boxes('post');
+	if ( ! in_array('commentstatusdiv', $hidden) ) { ?&gt;
+		&lt;script type=&quot;text/javascript&quot;&gt;commentsBox.get(&lt;?php echo $total; ?&gt;, 10);&lt;/script&gt;
+&lt;?php
+	}
 }
-add_meta_box('passworddiv', __('Password Protect This Post'), 'post_password_meta_box', 'post', 'advanced', 'core');
-
+add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
+
+/**
+ * Display post slug form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_slug_meta_box($post) {
 ?&gt;
 &lt;label class=&quot;hidden&quot; for=&quot;post_name&quot;&gt;&lt;?php _e('Post Slug') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_name&quot; type=&quot;text&quot; size=&quot;13&quot; id=&quot;post_name&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_name ); ?&gt;&quot; /&gt;
 &lt;?php
 }
-add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'advanced', 'core');
+if ( !( 'pending' == $post-&gt;post_status &amp;&amp; !current_user_can( 'publish_posts' ) ) )
+	add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core');
 
 $authors = get_editable_user_ids( $current_user-&gt;id ); // TODO: ROLE SYSTEM
 if ( $post-&gt;post_author &amp;&amp; !in_array($post-&gt;post_author, $authors) )
 	$authors[] = $post-&gt;post_author;
 if ( $authors &amp;&amp; count( $authors ) &gt; 1 ) :
+/**
+ * Display form field with list of authors.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_author_meta_box($post) {
 	global $current_user, $user_ID;
 	$authors = get_editable_user_ids( $current_user-&gt;id ); // TODO: ROLE SYSTEM
@@ -361,26 +479,144 @@ function post_author_meta_box($post) {
 &lt;label class=&quot;hidden&quot; for=&quot;post_author_override&quot;&gt;&lt;?php _e('Post Author'); ?&gt;&lt;/label&gt;&lt;?php wp_dropdown_users( array('include' =&gt; $authors, 'name' =&gt; 'post_author_override', 'selected' =&gt; empty($post-&gt;ID) ? $user_ID : $post-&gt;post_author) ); ?&gt;
 &lt;?php
 }
-add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core');
+add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
 endif;
 
-if ( isset($post_ID) &amp;&amp; 0 &lt; $post_ID &amp;&amp; wp_get_post_revisions( $post_ID ) ) :
+if ( 0 &lt; $post_ID &amp;&amp; wp_get_post_revisions( $post_ID ) ) :
+/**
+ * Display list of post revisions.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function post_revisions_meta_box($post) {
 	wp_list_post_revisions();
 }
-add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core');
+add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
 endif;
 
-do_meta_boxes('post', 'advanced', $post);
+do_action('do_meta_boxes', 'post', 'normal', $post);
+do_action('do_meta_boxes', 'post', 'advanced', $post);
+do_action('do_meta_boxes', 'post', 'side', $post);
+
+require_once('admin-header.php');
 
-do_action('dbx_post_sidebar');
 ?&gt;
+
+&lt;?php if ( (isset($mode) &amp;&amp; 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;bookmarklet&quot; /&gt;
+&lt;?php endif; ?&gt;
+
+&lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
+&lt;?php if ( $notice ) : ?&gt;
+&lt;div id=&quot;notice&quot; class=&quot;error&quot;&gt;&lt;p&gt;&lt;?php echo $notice ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+&lt;?php if (isset($_GET['message'])) : ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+&lt;form name=&quot;post&quot; action=&quot;post.php&quot; method=&quot;post&quot; id=&quot;post&quot;&gt;
+&lt;?php
+
+if ( 0 == $post_ID)
+	wp_nonce_field('add-post');
+else
+	wp_nonce_field('update-post_' .  $post_ID);
+
+?&gt;
+
+&lt;input type=&quot;hidden&quot; id=&quot;user-id&quot; name=&quot;user_ID&quot; value=&quot;&lt;?php echo (int) $user_ID ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;hiddenaction&quot; name=&quot;action&quot; value=&quot;&lt;?php echo $form_action ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;originalaction&quot; name=&quot;originalaction&quot; value=&quot;&lt;?php echo $form_action ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;post_author&quot; name=&quot;post_author&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_author ); ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;post_type&quot; name=&quot;post_type&quot; value=&quot;&lt;?php echo $post-&gt;post_type ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;original_post_status&quot; name=&quot;original_post_status&quot; value=&quot;&lt;?php echo $post-&gt;post_status ?&gt;&quot; /&gt;
+&lt;input name=&quot;referredby&quot; type=&quot;hidden&quot; id=&quot;referredby&quot; value=&quot;&lt;?php echo clean_url(stripslashes(wp_get_referer())); ?&gt;&quot; /&gt;
+&lt;?php if ( 'draft' != $post-&gt;post_status ) wp_original_referer_field(true, 'previous'); ?&gt;
+
+&lt;?php echo $form_extra ?&gt;
+
+&lt;div id=&quot;poststuff&quot; class=&quot;metabox-holder&quot;&gt;
+
+&lt;div id=&quot;side-info-column&quot; class=&quot;inner-sidebar&quot;&gt;
+
+&lt;?php do_action('submitpost_box'); ?&gt;
+
+&lt;?php $side_meta_boxes = do_meta_boxes('post', 'side', $post); ?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;post-body&quot; class=&quot;&lt;?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?&gt;&quot;&gt;
+&lt;div id=&quot;post-body-content&quot; class=&quot;has-sidebar-content&quot;&gt;
+&lt;div id=&quot;titlediv&quot;&gt;
+&lt;div id=&quot;titlewrap&quot;&gt;
+	&lt;input type=&quot;text&quot; name=&quot;post_title&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo attribute_escape($post-&gt;post_title); ?&gt;&quot; id=&quot;title&quot; autocomplete=&quot;off&quot; /&gt;
+&lt;/div&gt;
+&lt;div class=&quot;inside&quot;&gt;
+&lt;?php $sample_permalink_html = get_sample_permalink_html($post-&gt;ID); ?&gt;
+&lt;?php if ( !( 'pending' == $post-&gt;post_status &amp;&amp; !current_user_can( 'publish_posts' ) ) ) { ?&gt;
+	&lt;div id=&quot;edit-slug-box&quot;&gt;
+&lt;?php if ( ! empty($post-&gt;ID) &amp;&amp; ! empty($sample_permalink_html) ) :
+	echo $sample_permalink_html;
+endif; ?&gt;
+	&lt;/div&gt;
+&lt;?php } ?&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 
+&lt;div id=&quot;&lt;?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?&gt;&quot; class=&quot;postarea&quot;&gt;
+
+&lt;?php the_editor($post-&gt;post_content); ?&gt;
+
+&lt;div id=&quot;post-status-info&quot;&gt;
+	&lt;span id=&quot;wp-word-count&quot; class=&quot;alignleft&quot;&gt;&lt;/span&gt;
+	&lt;span class=&quot;alignright&quot;&gt;
+	&lt;span id=&quot;autosave&quot;&gt;&amp;nbsp;&lt;/span&gt;
+&lt;?php
+	if ( $post_ID ) {
+		echo '&lt;span id=&quot;last-edit&quot;&gt;';
+		if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
+			$last_user = get_userdata($last_id);
+			printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user-&gt;display_name ), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
+		} else {
+			printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
+		}
+		echo '&lt;/span&gt;';
+	}
+?&gt;
+	&lt;/span&gt;
+	&lt;br class=&quot;clear&quot; /&gt;
+&lt;/div&gt;
+
+
+&lt;?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?&gt;
 &lt;/div&gt;
 
+&lt;?php
+
+do_meta_boxes('post', 'normal', $post);
+
+do_action('edit_form_advanced');
+
+do_meta_boxes('post', 'advanced', $post);
+
+do_action('dbx_post_sidebar');
+
+?&gt;
+
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;br class=&quot;clear&quot; /&gt;
+&lt;/div&gt;&lt;!-- /poststuff --&gt;
 &lt;/form&gt;
+&lt;/div&gt;
+
+&lt;?php wp_comment_reply(); ?&gt;
 
 &lt;?php if ((isset($post-&gt;post_title) &amp;&amp; '' == $post-&gt;post_title) || (isset($_GET['message']) &amp;&amp; 2 &gt; $_GET['message'])) : ?&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;</diff>
      <filename>wp-admin/edit-form-advanced.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,14 @@
 &lt;?php
+/**
+ * Edit comment form for inclusion in another file.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * @var string
+ */
 $submitbutton_text = __('Edit Comment');
 $toprow_title = sprintf(__('Editing Comment # %s'), $comment-&gt;comment_ID);
 $form_action = 'editedcomment';
@@ -8,84 +18,110 @@ $form_extra = &quot;' /&gt;\n&lt;input type='hidden' name='comment_ID' value='&quot; . $comment-
 &lt;form name=&quot;post&quot; action=&quot;comment.php&quot; method=&quot;post&quot; id=&quot;post&quot;&gt;
 &lt;?php wp_nonce_field('update-comment_' . $comment-&gt;comment_ID) ?&gt;
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php echo $toprow_title; ?&gt;&lt;/h2&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php _e('Edit Comment'); ?&gt;&lt;/h2&gt;
+
+&lt;div id=&quot;poststuff&quot; class=&quot;metabox-holder&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;user_ID&quot; value=&quot;&lt;?php echo (int) $user_ID ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value='&lt;?php echo $form_action . $form_extra ?&gt;' /&gt;
+&lt;?php
 
-&lt;div id=&quot;poststuff&quot;&gt;
+$email = attribute_escape( $comment-&gt;comment_author_email );
+$url = attribute_escape( $comment-&gt;comment_author_url );
+// add_meta_box('submitdiv', __('Save'), 'comment_submit_meta_box', 'comment', 'side', 'core');
+?&gt;
 
+&lt;div id=&quot;side-info-column&quot; class=&quot;inner-sidebar&quot;&gt;
+&lt;div id=&quot;submitdiv&quot; class=&quot;stuffbox&quot; &gt;
+&lt;h3&gt;&lt;span class='hndle'&gt;&lt;?php _e('Status') ?&gt;&lt;/span&gt;&lt;/h3&gt;
+&lt;div class=&quot;inside&quot;&gt;
 &lt;div class=&quot;submitbox&quot; id=&quot;submitcomment&quot;&gt;
+&lt;div id=&quot;minor-publishing&quot;&gt;
 
-&lt;div id=&quot;previewview&quot;&gt;
-&lt;a href=&quot;&lt;?php echo get_comment_link(); ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;?php _e('View this Comment'); ?&gt;&lt;/a&gt;
+&lt;div id=&quot;minor-publishing-actions&quot;&gt;
+&lt;div id=&quot;preview-action&quot;&gt;
+&lt;a class=&quot;preview button&quot; href=&quot;&lt;?php echo get_comment_link(); ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;?php _e('View Comment'); ?&gt;&lt;/a&gt;
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 
-&lt;div class=&quot;inside&quot;&gt;
+&lt;div id=&quot;misc-publishing-actions&quot;&gt;
 
-&lt;p&gt;&lt;strong&gt;&lt;label for='comment_status'&gt;&lt;?php _e('Approval Status') ?&gt;&lt;/label&gt;&lt;/strong&gt;&lt;/p&gt;
-&lt;p&gt;
-&lt;select name='comment_status' id='comment_status'&gt;
-&lt;option&lt;?php selected( $comment-&gt;comment_approved, '1' ); ?&gt; value='1'&gt;&lt;?php _e('Approved') ?&gt;&lt;/option&gt;
-&lt;option&lt;?php selected( $comment-&gt;comment_approved, '0' ); ?&gt; value='0'&gt;&lt;?php _e('Moderated') ?&gt;&lt;/option&gt;
-&lt;option&lt;?php selected( $comment-&gt;comment_approved, 'spam' ); ?&gt; value='spam'&gt;&lt;?php _e('Spam') ?&gt;&lt;/option&gt;
-&lt;/select&gt;
-&lt;/p&gt;
+&lt;div class=&quot;misc-pub-section&quot; id=&quot;comment-status-radio&quot;&gt;
+&lt;label class=&quot;approved&quot;&gt;&lt;input type=&quot;radio&quot;&lt;?php checked( $comment-&gt;comment_approved, '1' ); ?&gt; name=&quot;comment_status&quot; value=&quot;1&quot; /&gt;&lt;?php echo _c('Approved|adjective') ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;label class=&quot;waiting&quot;&gt;&lt;input type=&quot;radio&quot;&lt;?php checked( $comment-&gt;comment_approved, '0' ); ?&gt; name=&quot;comment_status&quot; value=&quot;0&quot; /&gt;&lt;?php echo _c('Pending|adjective') ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;label class=&quot;spam&quot;&gt;&lt;input type=&quot;radio&quot;&lt;?php checked( $comment-&gt;comment_approved, 'spam' ); ?&gt; name=&quot;comment_status&quot; value=&quot;spam&quot; /&gt;&lt;?php echo _c('Spam|adjective'); ?&gt;&lt;/label&gt;
+&lt;/div&gt;
 
+&lt;div class=&quot;misc-pub-section curtime misc-pub-section-last&quot;&gt;
 &lt;?php
-$stamp = __('%1$s at %2$s');
-$date = mysql2date(get_option('date_format'), $comment-&gt;comment_date);
-$time = mysql2date(get_option('time_format'), $comment-&gt;comment_date);
+$datef = _c( 'M j, Y @ G:i|Publish box date format');
+$stamp = __('Submitted on: &lt;b&gt;%1$s&lt;/b&gt;');
+$date = date_i18n( $datef, strtotime( $comment-&gt;comment_date ) );
 ?&gt;
-&lt;p class=&quot;curtime&quot;&gt;&lt;?php printf($stamp, $date, $time); ?&gt;
-&amp;nbsp;&lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot;&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;&lt;/p&gt;
-
+&lt;span id=&quot;timestamp&quot;&gt;&lt;?php printf($stamp, $date); ?&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
 &lt;div id='timestampdiv' class='hide-if-js'&gt;&lt;?php touch_time(('editcomment' == $action), 0, 5); ?&gt;&lt;/div&gt;
-
+&lt;/div&gt;
+&lt;/div&gt; &lt;!-- misc actions --&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 
-&lt;p class=&quot;submit&quot;&gt;
-&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php _e('Save'); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
-&lt;?php
-echo &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;comment.php?action=deletecomment&amp;amp;c=$comment-&gt;comment_ID&amp;amp;_wp_original_http_referer=&quot; . wp_get_referer(), 'delete-comment_' . $comment-&gt;comment_ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(__(&quot;You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.&quot;)) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete comment') . &quot;&lt;/a&gt;&quot;;
-?&gt;
-&lt;/p&gt;
-
-&lt;div class=&quot;side-info&quot;&gt;
-&lt;h5&gt;&lt;?php _e('Related') ?&gt;&lt;/h5&gt;
-
-&lt;ul&gt;
-&lt;li&gt;&lt;a href=&quot;edit-comments.php&quot;&gt;&lt;?php _e('Manage All Comments') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;edit-comments.php?comment_status=moderated&quot;&gt;&lt;?php _e('Moderate Comments') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;?php do_action('comment_relatedlinks_list'); ?&gt;
-&lt;/ul&gt;
+&lt;div id=&quot;major-publishing-actions&quot;&gt;
+&lt;div id=&quot;delete-action&quot;&gt;
+&lt;a class='submitdelete deletion' href='&lt;?php echo wp_nonce_url(&quot;comment.php?action=deletecomment&amp;amp;c=$comment-&gt;comment_ID&amp;amp;_wp_original_http_referer=&quot; . wp_get_referer(), 'delete-comment_' . $comment-&gt;comment_ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(__(&quot;You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.&quot;)) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete'); ?&gt;&lt;/a&gt;
 &lt;/div&gt;
-&lt;?php do_action('submitcomment_box'); ?&gt;
+&lt;div id=&quot;publishing-action&quot;&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php _e('Update Comment'); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button-primary&quot; /&gt;
 &lt;/div&gt;
-
-&lt;div id=&quot;post-body&quot;&gt;
-&lt;div id=&quot;namediv&quot; class=&quot;stuffbox&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;name&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div class=&quot;inside&quot;&gt;
-&lt;input type=&quot;text&quot; name=&quot;newcomment_author&quot; size=&quot;30&quot; value=&quot;&lt;?php echo attribute_escape( $comment-&gt;comment_author ); ?&gt;&quot; tabindex=&quot;1&quot; id=&quot;name&quot; /&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
-
-&lt;div id=&quot;emaildiv&quot; class=&quot;stuffbox&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;email&quot;&gt;&lt;?php _e('E-mail') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div class=&quot;inside&quot;&gt;
-&lt;input type=&quot;text&quot; name=&quot;newcomment_author_email&quot; size=&quot;30&quot; value=&quot;&lt;?php echo attribute_escape( $comment-&gt;comment_author_email ); ?&gt;&quot; tabindex=&quot;2&quot; id=&quot;email&quot; /&gt;
 &lt;/div&gt;
 &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;post-body&quot; class=&quot;has-sidebar&quot;&gt;
+&lt;div id=&quot;post-body-content&quot; class=&quot;has-sidebar-content&quot;&gt;
 
-&lt;div id=&quot;uridiv&quot; class=&quot;stuffbox&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;newcomment_author_url&quot;&gt;&lt;?php _e('URL') ?&gt;&lt;/label&gt;&lt;/h3&gt;
+&lt;div id=&quot;namediv&quot; class=&quot;stuffbox&quot;&gt;
+&lt;h3&gt;&lt;label for=&quot;name&quot;&gt;&lt;?php _e( 'Author' ) ?&gt;&lt;/label&gt;&lt;/h3&gt;
 &lt;div class=&quot;inside&quot;&gt;
-&lt;input type=&quot;text&quot; id=&quot;newcomment_author_url&quot; name=&quot;newcomment_author_url&quot; size=&quot;30&quot; value=&quot;&lt;?php echo attribute_escape( $comment-&gt;comment_author_url ); ?&gt;&quot; tabindex=&quot;3&quot; /&gt;
+&lt;table class=&quot;form-table&quot;&gt;
+&lt;tbody&gt;
+&lt;tr valign=&quot;top&quot;&gt;
+	&lt;td class=&quot;first&quot;&gt;&lt;?php _e( 'Name:' ); ?&gt;&lt;/td&gt;
+	&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;newcomment_author&quot; size=&quot;30&quot; value=&quot;&lt;?php echo attribute_escape( $comment-&gt;comment_author ); ?&gt;&quot; tabindex=&quot;1&quot; id=&quot;name&quot; /&gt;&lt;/td&gt;
+&lt;/tr&gt;
+&lt;tr valign=&quot;top&quot;&gt;
+	&lt;td class=&quot;first&quot;&gt;
+	&lt;?php
+		if ( $email ) {
+			printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
+		} else {
+			_e( 'E-mail:' );
+		}
+?&gt;&lt;/td&gt;
+	&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;newcomment_author_email&quot; size=&quot;30&quot; value=&quot;&lt;?php echo $email; ?&gt;&quot; tabindex=&quot;2&quot; id=&quot;email&quot; /&gt;&lt;/td&gt;
+&lt;/tr&gt;
+&lt;tr valign=&quot;top&quot;&gt;
+	&lt;td class=&quot;first&quot;&gt;
+	&lt;?php
+		$url = get_comment_author_url();
+		if ( ! empty( $url ) &amp;&amp; 'http://' != $url ) {
+			$link = &quot;&lt;a href='$url' rel='external nofollow' target='_blank'&gt;&quot; . __('visit site') . &quot;&lt;/a&gt;&quot;;
+			printf( __( 'URL (%s):' ), apply_filters('get_comment_author_link', $link ) );
+		} else {
+			_e( 'URL:' );
+		} ?&gt;&lt;/td&gt;
+	&lt;td&gt;&lt;input type=&quot;text&quot; id=&quot;newcomment_author_url&quot; name=&quot;newcomment_author_url&quot; size=&quot;30&quot; value=&quot;&lt;?php echo $url; ?&gt;&quot; tabindex=&quot;3&quot; /&gt;&lt;/td&gt;
+&lt;/tr&gt;
+&lt;/tbody&gt;
+&lt;/table&gt;
+&lt;br /&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 
 &lt;div id=&quot;postdiv&quot; class=&quot;postarea&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;content&quot;&gt;&lt;?php _e('Comment') ?&gt;&lt;/label&gt;&lt;/h3&gt;
 &lt;?php the_editor($comment-&gt;comment_content, 'content', 'newcomment_author_url', false, 4); ?&gt;
 &lt;?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?&gt;
 &lt;/div&gt;
@@ -94,13 +130,14 @@ echo &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;comment.php?action=deletec
 
 &lt;input type=&quot;hidden&quot; name=&quot;c&quot; value=&quot;&lt;?php echo $comment-&gt;comment_ID ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;p&quot; value=&quot;&lt;?php echo $comment-&gt;comment_post_ID ?&gt;&quot; /&gt;
-&lt;input name=&quot;referredby&quot; type=&quot;hidden&quot; id=&quot;referredby&quot; value=&quot;&lt;?php echo wp_get_referer(); ?&gt;&quot; /&gt;
+&lt;input name=&quot;referredby&quot; type=&quot;hidden&quot; id=&quot;referredby&quot; value=&quot;&lt;?php echo clean_url(stripslashes(wp_get_referer())); ?&gt;&quot; /&gt;
 &lt;?php wp_original_referer_field(true, 'previous'); ?&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;noredir&quot; value=&quot;1&quot; /&gt;
+
+&lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
-
 &lt;/form&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;</diff>
      <filename>wp-admin/edit-form-comment.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,43 +1,54 @@
 &lt;?php
+/**
+ * Edit Link Categories Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
 require_once('admin.php');
 
-// Handle bulk deletes
-if ( isset($_GET['deleteit']) &amp;&amp; isset($_GET['delete']) ) {
+// Handle bulk actions
+if ( isset($_GET['action']) &amp;&amp; isset($_GET['delete']) ) {
 	check_admin_referer('bulk-link-categories');
+	$doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
 
 	if ( !current_user_can('manage_categories') )
 		wp_die(__('Cheatin&amp;#8217; uh?'));
 
-	foreach( (array) $_GET['delete'] as $cat_ID ) {
-		$cat_name = get_term_field('name', $cat_ID, 'link_category');
-		$default_cat_id = get_option('default_link_category');
-		
-		// Don't delete the default cats.
-		if ( $cat_ID == $default_cat_id )
-			wp_die(sprintf(__(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), $cat_name));
+	if ( 'delete' == $doaction ) {
+		foreach( (array) $_GET['delete'] as $cat_ID ) {
+			$cat_name = get_term_field('name', $cat_ID, 'link_category');
+			$default_cat_id = get_option('default_link_category');
 
-		wp_delete_term($cat_ID, 'link_category', array('default' =&gt; $default_cat_id));
-	}
+			// Don't delete the default cats.
+			if ( $cat_ID == $default_cat_id )
+				wp_die(sprintf(__(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), $cat_name));
 
-	$location = 'edit-link-categories.php';
-	if ( $referer = wp_get_referer() ) {
-		if ( false !== strpos($referer, 'edit-link-categories.php') )
-			$location = $referer;
-	}
+			wp_delete_term($cat_ID, 'link_category', array('default' =&gt; $default_cat_id));
+		}
+
+		$location = 'edit-link-categories.php';
+		if ( $referer = wp_get_referer() ) {
+			if ( false !== strpos($referer, 'edit-link-categories.php') )
+				$location = $referer;
+		}
 
-	$location = add_query_arg('message', 6, $location);
-	wp_redirect($location);
-	exit();
-} elseif ( !empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+		$location = add_query_arg('message', 6, $location);
+		wp_redirect($location);
+		exit();
+	}
+} elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
+	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
 	 exit;
 }
 
 $title = __('Link Categories');
-$parent_file = 'edit.php';
 
-wp_enqueue_script( 'admin-categories' );
-wp_enqueue_script('admin-forms');
+wp_enqueue_script('admin-categories');
+if ( current_user_can('manage_categories') )
+	wp_enqueue_script('inline-edit-tax');
 
 require_once ('admin-header.php');
 
@@ -46,42 +57,48 @@ $messages[2] = __('Category deleted.');
 $messages[3] = __('Category updated.');
 $messages[4] = __('Category not added.');
 $messages[5] = __('Category not updated.');
-$messages[6] = __('Categories deleted.');
+$messages[6] = __('Categories deleted.'); ?&gt;
+
+&lt;div class=&quot;wrap nosubsub&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title );
+if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
+	printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', wp_specialchars( stripslashes($_GET['s']) ) ); ?&gt;
+&lt;/h2&gt;
 
-if (isset($_GET['message'])) : ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php if ( isset($_GET['message']) &amp;&amp; ( $msg = (int) $_GET['message'] ) ) : ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$msg]; ?&gt;&lt;/p&gt;&lt;/div&gt;
 &lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
 endif; ?&gt;
 
-&lt;div class=&quot;wrap&quot;&gt;
-
-&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
-&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
-	&lt;h2&gt;&lt;?php printf(__('Manage Link Categories (&lt;a href=&quot;%s&quot;&gt;add new&lt;/a&gt;)'), '#addcat') ?&gt; &lt;/h2&gt;
-&lt;?php else : ?&gt;
-	&lt;h2&gt;&lt;?php _e('Manage Link Categories') ?&gt; &lt;/h2&gt;
-&lt;?php endif; ?&gt;
-
-&lt;p id=&quot;post-search&quot;&gt;
-	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e( 'Search Categories' ); ?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php echo attribute_escape(stripslashes($_GET['s'])); ?&gt;&quot; /&gt;
+&lt;form class=&quot;search-form&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
+&lt;p class=&quot;search-box&quot;&gt;
+	&lt;label class=&quot;hidden&quot; for=&quot;link-category-search-input&quot;&gt;&lt;?php _e( 'Search Categories' ); ?&gt;:&lt;/label&gt;
+	&lt;input type=&quot;text&quot; class=&quot;search-input&quot; id=&quot;link-category-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php _admin_search_query(); ?&gt;&quot; /&gt;
 	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Categories' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
 &lt;/p&gt;
-
+&lt;/form&gt;
 &lt;br class=&quot;clear&quot; /&gt;
 
+&lt;div id=&quot;col-container&quot;&gt;
+
+&lt;div id=&quot;col-right&quot;&gt;
+&lt;div class=&quot;col-wrap&quot;&gt;
+&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
 &lt;div class=&quot;tablenav&quot;&gt;
 
 &lt;?php
-$pagenum = absint( $_GET['pagenum'] );
+$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
 if ( empty($pagenum) )
 	$pagenum = 1;
-if( !$catsperpage || $catsperpage &lt; 0 )
+if( ! isset( $catsperpage ) || $catsperpage &lt; 0 )
 	$catsperpage = 20;
 
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; ceil(wp_count_terms('link_category') / $catsperpage),
 	'current' =&gt; $pagenum
 ));
@@ -90,25 +107,33 @@ if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
 
-&lt;div class=&quot;alignleft&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Delete'); ?&gt;&quot; name=&quot;deleteit&quot; class=&quot;button-secondary delete&quot; /&gt;
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action&quot;&gt;
+&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
 &lt;?php wp_nonce_field('bulk-link-categories'); ?&gt;
 &lt;/div&gt;
 
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;table class=&quot;widefat fixed&quot; cellspacing=&quot;0&quot;&gt;
 	&lt;thead&gt;
 	&lt;tr&gt;
-        &lt;th scope=&quot;col&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Description') ?&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot; class=&quot;num&quot; style=&quot;width: 90px;&quot;&gt;&lt;?php _e('Links') ?&gt;&lt;/th&gt;
+&lt;?php print_column_headers('edit-link-categories'); ?&gt;
 	&lt;/tr&gt;
 	&lt;/thead&gt;
+
+	&lt;tfoot&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('edit-link-categories', false); ?&gt;
+	&lt;/tr&gt;
+	&lt;/tfoot&gt;
+
 	&lt;tbody id=&quot;the-list&quot; class=&quot;list:link-cat&quot;&gt;
 &lt;?php
 $start = ($pagenum - 1) * $catsperpage;
@@ -120,10 +145,8 @@ $categories = get_terms( 'link_category', $args );
 if ( $categories ) {
 	$output = '';
 	foreach ( $categories as $category ) {
-		$category = sanitize_term($category, 'link_category', 'display');
 		$output .= link_cat_row($category);
 	}
-	$output = apply_filters('cat_rows', $output);
 	echo $output;
 	unset($category);
 }
@@ -131,27 +154,90 @@ if ( $categories ) {
 ?&gt;
 	&lt;/tbody&gt;
 &lt;/table&gt;
-&lt;/form&gt;
 
 &lt;div class=&quot;tablenav&quot;&gt;
-
 &lt;?php
 if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
+
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action2&quot;&gt;
+&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
+&lt;/div&gt;
+
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
 &lt;br class=&quot;clear&quot; /&gt;
+&lt;/form&gt;
 
+&lt;div class=&quot;form-wrap&quot;&gt;
+&lt;p&gt;&lt;?php printf(__('&lt;strong&gt;Note:&lt;/strong&gt;&lt;br /&gt;Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category &lt;strong&gt;%s&lt;/strong&gt;.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?&gt;&lt;/p&gt;
 &lt;/div&gt;
 
-&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;p&gt;&lt;?php printf(__('&lt;strong&gt;Note:&lt;/strong&gt;&lt;br /&gt;Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category &lt;strong&gt;%s&lt;/strong&gt;.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?&gt;&lt;/p&gt;
+
+&lt;/div&gt;
+&lt;/div&gt;&lt;!-- /col-right --&gt;
+
+&lt;div id=&quot;col-left&quot;&gt;
+&lt;div class=&quot;col-wrap&quot;&gt;
+
+&lt;?php if ( current_user_can('manage_categories') ) {
+	$category = (object) array(); $category-&gt;parent = 0; do_action('add_link_category_form_pre', $category); ?&gt;
+
+&lt;div class=&quot;form-wrap&quot;&gt;
+&lt;h3&gt;&lt;?php _e('Add Category'); ?&gt;&lt;/h3&gt;
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
+&lt;form name=&quot;addcat&quot; id=&quot;addcat&quot; class=&quot;add:the-list: validate&quot; method=&quot;post&quot; action=&quot;link-category.php&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;addcat&quot; /&gt;
+&lt;?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-link-category'); ?&gt;
+
+&lt;div class=&quot;form-field form-required&quot;&gt;
+	&lt;label for=&quot;name&quot;&gt;&lt;?php _e('Category name') ?&gt;&lt;/label&gt;
+	&lt;input name=&quot;name&quot; id=&quot;name&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;40&quot; aria-required=&quot;true&quot; /&gt;
 &lt;/div&gt;
 
-&lt;?php include('edit-link-category-form.php'); ?&gt;
+&lt;div class=&quot;form-field&quot;&gt;
+	&lt;label for=&quot;slug&quot;&gt;&lt;?php _e('Category slug') ?&gt;&lt;/label&gt;
+	&lt;input name=&quot;slug&quot; id=&quot;slug&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;40&quot; /&gt;
+	&lt;p&gt;&lt;?php _e('The &amp;#8220;slug&amp;#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
 
-&lt;?php endif; ?&gt;
+&lt;div class=&quot;form-field&quot;&gt;
+	&lt;label for=&quot;description&quot;&gt;&lt;?php _e('Description (optional)') ?&gt;&lt;/label&gt;
+	&lt;textarea name=&quot;description&quot; id=&quot;description&quot; rows=&quot;5&quot; cols=&quot;40&quot;&gt;&lt;/textarea&gt;
+&lt;/div&gt;
 
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Add Category'); ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;?php do_action('edit_link_category_form', $category); ?&gt;
+&lt;/form&gt;
+&lt;/div&gt;
+
+&lt;?php } ?&gt;
+
+&lt;/div&gt;
+&lt;/div&gt;&lt;!-- /col-left --&gt;
+
+&lt;/div&gt;&lt;!-- /col-container --&gt;
+&lt;/div&gt;&lt;!-- /wrap --&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+(function($){
+	$(document).ready(function(){
+		$('#doaction, #doaction2').click(function(){
+			if ( $('select[name^=&quot;action&quot;]').val() == 'delete' ) {
+				var m = '&lt;?php echo js_escape(__(&quot;You are about to delete the selected link categories.\n  'Cancel' to stop, 'OK' to delete.&quot;)); ?&gt;';
+				return showNotice.warn(m);
+			}
+		});
+	});
+})(jQuery);
+/* ]]&gt; */
+&lt;/script&gt;
+
+&lt;?php inline_edit_term_row('edit-link-categories'); ?&gt;
 &lt;?php include('admin-footer.php'); ?&gt;</diff>
      <filename>wp-admin/edit-link-categories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,60 @@
 &lt;?php
+/**
+ * Edit link category form for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * @var object
+ */
+if ( ! isset( $category ) )
+	$category = (object) array();
+
 if ( ! empty($cat_ID) ) {
-	$heading = __('Edit Category');
-	$submit_text = __('Edit Category');
+	/**
+	 * @var string
+	 */
+	$heading = '&lt;h2&gt;' . __('Edit Link Category') . '&lt;/h2&gt;';
+	$submit_text = __('Update Category');
 	$form = '&lt;form name=&quot;editcat&quot; id=&quot;editcat&quot; method=&quot;post&quot; action=&quot;link-category.php&quot; class=&quot;validate&quot;&gt;';
 	$action = 'editedcat';
 	$nonce_action = 'update-link-category_' . $cat_ID;
 	do_action('edit_link_category_form_pre', $category);
 } else {
-	$heading = __('Add Category');
+	$heading = '&lt;h2&gt;' . __('Add Link Category') . '&lt;/h2&gt;';
 	$submit_text = __('Add Category');
 	$form = '&lt;form name=&quot;addcat&quot; id=&quot;addcat&quot; class=&quot;add:the-list: validate&quot; method=&quot;post&quot; action=&quot;link-category.php&quot;&gt;';
 	$action = 'addcat';
 	$nonce_action = 'add-link-category';
 	do_action('add_link_category_form_pre', $category);
 }
+
+/**
+ * @ignore
+ * @since 2.7
+ * @internal Used to prevent errors in page when no category is being edited.
+ *
+ * @param object $category
+ */
+function _fill_empty_link_category(&amp;$category) {
+	if ( ! isset( $category-&gt;name ) )
+		$category-&gt;name = '';
+
+	if ( ! isset( $category-&gt;slug ) )
+		$category-&gt;slug = '';
+
+	if ( ! isset( $category-&gt;description ) )
+		$category-&gt;description = '';
+}
+
+_fill_empty_link_category($category);
 ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php echo $heading ?&gt;&lt;/h2&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;?php echo $heading ?&gt;
 &lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
 &lt;?php echo $form ?&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;&lt;?php echo $action ?&gt;&quot; /&gt;
@@ -30,7 +67,7 @@ if ( ! empty($cat_ID) ) {
 		&lt;/tr&gt;
 		&lt;tr class=&quot;form-field&quot;&gt;
 			&lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;label for=&quot;slug&quot;&gt;&lt;?php _e('Category slug') ?&gt;&lt;/label&gt;&lt;/th&gt;
-			&lt;td&gt;&lt;input name=&quot;slug&quot; id=&quot;slug&quot; type=&quot;text&quot; value=&quot;&lt;?php echo attribute_escape(apply_filters('editable_slug', $category-&gt;slug)); ?&gt;&quot; size=&quot;40&quot; /&gt;
+			&lt;td&gt;&lt;input name=&quot;slug&quot; id=&quot;slug&quot; type=&quot;text&quot; value=&quot;&lt;?php echo attribute_escape(apply_filters('editable_slug', $category-&gt;slug)); ?&gt;&quot; size=&quot;40&quot; /&gt;&lt;br /&gt;
             &lt;?php _e('The &amp;#8220;slug&amp;#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?&gt;&lt;/td&gt;
 		&lt;/tr&gt;
 		&lt;tr class=&quot;form-field&quot;&gt;
@@ -38,7 +75,7 @@ if ( ! empty($cat_ID) ) {
 			&lt;td&gt;&lt;textarea name=&quot;description&quot; id=&quot;description&quot; rows=&quot;5&quot; cols=&quot;50&quot; style=&quot;width: 97%;&quot;&gt;&lt;?php echo $category-&gt;description; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
 		&lt;/tr&gt;
 	&lt;/table&gt;
-&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;&lt;?php echo $submit_text ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button-primary&quot; name=&quot;submit&quot; value=&quot;&lt;?php echo $submit_text ?&gt;&quot; /&gt;&lt;/p&gt;
 &lt;?php do_action('edit_link_category_form', $category); ?&gt;
 &lt;/form&gt;
 &lt;/div&gt;</diff>
      <filename>wp-admin/edit-link-category-form.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,36 @@
 &lt;?php
+/**
+ * Edit links form for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
 if ( ! empty($link_id) ) {
-	$heading = __('Edit Link');
-	$submit_text = __('Save Changes');
+	$heading = sprintf( __( '&lt;a href=&quot;%s&quot;&gt;Links&lt;/a&gt; / Edit Link' ), 'link-manager.php' );
+	$submit_text = __('Update Link');
 	$form = '&lt;form name=&quot;editlink&quot; id=&quot;editlink&quot; method=&quot;post&quot; action=&quot;link.php&quot;&gt;';
 	$nonce_action = 'update-bookmark_' . $link_id;
 } else {
-	$heading = __('Add Link');
+	$heading = sprintf( __( '&lt;a href=&quot;%s&quot;&gt;Links&lt;/a&gt; / Add New Link' ), 'link-manager.php' );
 	$submit_text = __('Add Link');
 	$form = '&lt;form name=&quot;addlink&quot; id=&quot;addlink&quot; method=&quot;post&quot; action=&quot;link.php&quot;&gt;';
 	$nonce_action = 'add-bookmark';
 }
 
+/**
+ * Display checked checkboxes attribute for xfn microformat options.
+ *
+ * @since 1.0.1
+ *
+ * @param string $class
+ * @param string $value
+ * @param mixed $deprecated Not used.
+ */
 function xfn_check($class, $value = '', $deprecated = '') {
 	global $link;
 
-	$link_rel = $link-&gt;link_rel;
+	$link_rel = isset( $link-&gt;link_rel ) ? $link-&gt;link_rel : ''; // In PHP 5.3: $link_rel = $link-&gt;link_rel ?: '';
 	$rels = preg_split('/\s+/', $link_rel);
 
 	if ('' != $value &amp;&amp; in_array($value, $rels) ) {
@@ -28,76 +44,75 @@ function xfn_check($class, $value = '', $deprecated = '') {
 		if ('identity' == $class &amp;&amp; in_array('me', $rels) ) echo ' checked=&quot;checked&quot;';
 	}
 }
-?&gt;
-
-&lt;?php echo $form ?&gt;
-&lt;?php wp_nonce_field($nonce_action); ?&gt;
-&lt;?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?&gt;
-
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php echo $heading; ?&gt;&lt;/h2&gt;
-
-&lt;div id=&quot;poststuff&quot;&gt;
 
+/**
+ * Display link create form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $link
+ */
+function link_submit_meta_box($link) {
+?&gt;
 &lt;div class=&quot;submitbox&quot; id=&quot;submitlink&quot;&gt;
 
-&lt;div id=&quot;previewview&quot;&gt;
-&lt;?php if ( !empty($link_id) ) { ?&gt;
-&lt;a href=&quot;&lt;?php echo $link-&gt;link_url; ?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;?php _e('Visit Link'); ?&gt;&lt;/a&gt;
-&lt;?php } ?&gt;
-&lt;/div&gt;
+&lt;div id=&quot;minor-publishing&quot;&gt;
 
-&lt;div class=&quot;inside&quot;&gt;
-&lt;p&gt;&lt;label for=&quot;link_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;link_private&quot; name=&quot;link_visible&quot; type=&quot;checkbox&quot; value=&quot;N&quot; &lt;?php checked($link-&gt;link_visible, 'N'); ?&gt; /&gt; &lt;?php _e('Keep this link private') ?&gt;&lt;/label&gt;&lt;/p&gt;
+&lt;?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?&gt;
+&lt;div style=&quot;display:none;&quot;&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php echo attribute_escape( __('Save') ); ?&gt;&quot; /&gt;
 &lt;/div&gt;
 
-&lt;p class=&quot;submit&quot;&gt;
-&lt;input type=&quot;submit&quot; class=&quot;button button-highlighted&quot; name=&quot;save&quot; value=&quot;&lt;?php _e('Save'); ?&gt;&quot; tabindex=&quot;4&quot; /&gt;
-&lt;?php
-if ( ( 'edit' == $action) &amp;&amp; current_user_can('manage_links') )
-	echo &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;link.php?action=delete&amp;amp;link_id=$link_id&quot;, 'delete-bookmark_' . $link_id) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape( sprintf( __(&quot;You are about to delete this link '%s'\n'Cancel' to stop, 'OK' to delete.&quot;), $link-&gt;link_name )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete&amp;nbsp;link') . &quot;&lt;/a&gt;&quot;;
-?&gt;
-&lt;/p&gt;
-
-&lt;div class=&quot;side-info&quot;&gt;
-&lt;h5&gt;&lt;?php _e('Related') ?&gt;&lt;/h5&gt;
-
-&lt;ul&gt;
-&lt;li&gt;&lt;a href=&quot;link-manager.php&quot;&gt;&lt;?php _e('Manage All Links') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;edit-link-categories.php&quot;&gt;&lt;?php _e('Manage All Link Categories') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;link-import.php&quot;&gt;&lt;?php _e('Import Links') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;?php do_action('link_relatedlinks_list'); ?&gt;
-&lt;/ul&gt;
+&lt;div id=&quot;minor-publishing-actions&quot;&gt;
+&lt;div id=&quot;preview-action&quot;&gt;
+&lt;?php if ( !empty($link-&gt;link_id) ) { ?&gt;
+	&lt;a class=&quot;preview button&quot; href=&quot;&lt;?php echo $link-&gt;link_url; ?&gt;&quot; target=&quot;_blank&quot; tabindex=&quot;4&quot;&gt;&lt;?php _e('Visit Link'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
 &lt;/div&gt;
-&lt;?php do_action('submitlink_box'); ?&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 
-&lt;div id=&quot;post-body&quot;&gt;
-&lt;div id=&quot;namediv&quot; class=&quot;stuffbox&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;link_name&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div class=&quot;inside&quot;&gt;
-	&lt;input type=&quot;text&quot; name=&quot;link_name&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo $link-&gt;link_name; ?&gt;&quot; id=&quot;link_name&quot; /&gt;&lt;br /&gt;
-    &lt;?php _e('Example: Nifty blogging software'); ?&gt;
+&lt;div id=&quot;misc-publishing-actions&quot;&gt;
+&lt;div class=&quot;misc-pub-section misc-pub-section-last&quot;&gt;
+	&lt;label for=&quot;link_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;link_private&quot; name=&quot;link_visible&quot; type=&quot;checkbox&quot; value=&quot;N&quot; &lt;?php checked($link-&gt;link_visible, 'N'); ?&gt; /&gt; &lt;?php _e('Keep this link private') ?&gt;&lt;/label&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 
-&lt;div id=&quot;addressdiv&quot; class=&quot;stuffbox&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;link_url&quot;&gt;&lt;?php _e('Web Address') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div class=&quot;inside&quot;&gt;
-	&lt;input type=&quot;text&quot; name=&quot;link_url&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo $link-&gt;link_url; ?&gt;&quot; id=&quot;link_url&quot; /&gt;&lt;br /&gt;
-    &lt;?php _e('Example: &lt;code&gt;http://wordpress.org/&lt;/code&gt; &amp;#8212; don&amp;#8217;t forget the &lt;code&gt;http://&lt;/code&gt;'); ?&gt;
 &lt;/div&gt;
+
+&lt;div id=&quot;major-publishing-actions&quot;&gt;
+&lt;?php do_action('post_submitbox_start'); ?&gt;
+&lt;div id=&quot;delete-action&quot;&gt;
+&lt;?php
+if ( !empty($_GET['action']) &amp;&amp; 'edit' == $_GET['action'] &amp;&amp; current_user_can('manage_links') ) { ?&gt;
+	&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;link.php?action=delete&amp;amp;link_id=$link-&gt;link_id&quot;, 'delete-bookmark_' . $link-&gt;link_id); ?&gt;&quot; onclick=&quot;if ( confirm('&lt;?php echo js_escape(sprintf(__(&quot;You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $link-&gt;link_name )); ?&gt;') ) {return true;}return false;&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
 &lt;/div&gt;
 
-&lt;div id=&quot;descriptiondiv&quot; class=&quot;stuffbox&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;link_description&quot;&gt;&lt;?php _e('Description') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div class=&quot;inside&quot;&gt;
-	&lt;input type=&quot;text&quot; name=&quot;link_description&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo $link-&gt;link_description; ?&gt;&quot; id=&quot;link_description&quot; /&gt;&lt;br /&gt;
-    &lt;?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?&gt;
+&lt;div id=&quot;publishing-action&quot;&gt;
+&lt;?php if ( !empty($link-&gt;link_id) ) { ?&gt;
+	&lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;4&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Update Link') ?&gt;&quot; /&gt;
+&lt;?php } else { ?&gt;
+	&lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;4&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Add Link') ?&gt;&quot; /&gt;
+&lt;?php } ?&gt;
 &lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
+&lt;?php do_action('submitlink_box'); ?&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;?php
+}
+add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
 
-&lt;?php function link_categories_meta_box($link) { ?&gt;
+/**
+ * Display link categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_categories_meta_box($link) { ?&gt;
 &lt;div id=&quot;category-adder&quot; class=&quot;wp-hidden-children&quot;&gt;
 	&lt;h4&gt;&lt;a id=&quot;category-add-toggle&quot; href=&quot;#category-add&quot;&gt;&lt;?php _e( '+ Add New Category' ); ?&gt;&lt;/a&gt;&lt;/h4&gt;
 	&lt;p id=&quot;link-category-add&quot; class=&quot;wp-hidden-child&quot;&gt;
@@ -111,12 +126,17 @@ if ( ( 'edit' == $action) &amp;&amp; current_user_can('manage_links') )
 
 &lt;ul id=&quot;category-tabs&quot;&gt;
 	&lt;li class=&quot;ui-tabs-selected&quot;&gt;&lt;a href=&quot;#categories-all&quot;&gt;&lt;?php _e( 'All Categories' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
-	&lt;li class=&quot;wp-no-js-hidden&quot;&gt;&lt;a href=&quot;#categories-pop&quot;&gt;&lt;?php _e( 'Most Used' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+	&lt;li class=&quot;hide-if-no-js&quot;&gt;&lt;a href=&quot;#categories-pop&quot;&gt;&lt;?php _e( 'Most Used' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 
 &lt;div id=&quot;categories-all&quot; class=&quot;ui-tabs-panel&quot;&gt;
 	&lt;ul id=&quot;categorychecklist&quot; class=&quot;list:category categorychecklist form-no-clear&quot;&gt;
-		&lt;?php wp_link_category_checklist($link-&gt;link_id); ?&gt;
+		&lt;?php
+		if ( isset($link-&gt;link_id) )
+			wp_link_category_checklist($link-&gt;link_id);
+		else
+			wp_link_category_checklist();
+		?&gt;
 	&lt;/ul&gt;
 &lt;/div&gt;
 
@@ -128,35 +148,44 @@ if ( ( 'edit' == $action) &amp;&amp; current_user_can('manage_links') )
 &lt;?php
 }
 add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
-?&gt;
-
-&lt;?php do_meta_boxes('link', 'normal', $link); ?&gt;
-
-&lt;h2&gt;&lt;?php _e('Advanced Options'); ?&gt;&lt;/h2&gt;
 
-&lt;?php function link_target_meta_box($link) { ?&gt;
+/**
+ * Display form fields for changing link target.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_target_meta_box($link) { ?&gt;
 &lt;fieldset&gt;&lt;legend class=&quot;hidden&quot;&gt;&lt;?php _e('Target') ?&gt;&lt;/legend&gt;
 &lt;label for=&quot;link_target_blank&quot; class=&quot;selectit&quot;&gt;
-&lt;input id=&quot;link_target_blank&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;_blank&quot; &lt;?php echo(($link-&gt;link_target == '_blank') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
+&lt;input id=&quot;link_target_blank&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;_blank&quot; &lt;?php echo ( isset( $link-&gt;link_target ) &amp;&amp; ($link-&gt;link_target == '_blank') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
 &lt;code&gt;_blank&lt;/code&gt;&lt;/label&gt;&lt;br /&gt;
 &lt;label for=&quot;link_target_top&quot; class=&quot;selectit&quot;&gt;
-&lt;input id=&quot;link_target_top&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;_top&quot; &lt;?php echo(($link-&gt;link_target == '_top') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
+&lt;input id=&quot;link_target_top&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;_top&quot; &lt;?php echo ( isset( $link-&gt;link_target ) &amp;&amp; ($link-&gt;link_target == '_top') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
 &lt;code&gt;_top&lt;/code&gt;&lt;/label&gt;&lt;br /&gt;
 &lt;label for=&quot;link_target_none&quot; class=&quot;selectit&quot;&gt;
-&lt;input id=&quot;link_target_none&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;&quot; &lt;?php echo(($link-&gt;link_target == '') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
+&lt;input id=&quot;link_target_none&quot; type=&quot;radio&quot; name=&quot;link_target&quot; value=&quot;&quot; &lt;?php echo ( isset( $link-&gt;link_target ) &amp;&amp; ($link-&gt;link_target == '') ? 'checked=&quot;checked&quot;' : ''); ?&gt; /&gt;
 &lt;?php _e('none') ?&gt;&lt;/label&gt;
 &lt;/fieldset&gt;
 &lt;p&gt;&lt;?php _e('Choose the frame your link targets. Essentially this means if you choose &lt;code&gt;_blank&lt;/code&gt; your link will open in a new window.'); ?&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'advanced', 'core');
+add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
 
+/**
+ * Display xfn form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
 function link_xfn_meta_box($link) {
 ?&gt;
 &lt;table class=&quot;editform&quot; style=&quot;width: 100%;&quot; cellspacing=&quot;2&quot; cellpadding=&quot;5&quot;&gt;
 	&lt;tr&gt;
 		&lt;th style=&quot;width: 20%;&quot; scope=&quot;row&quot;&gt;&lt;label for=&quot;link_rel&quot;&gt;&lt;?php _e('rel:') ?&gt;&lt;/label&gt;&lt;/th&gt;
-		&lt;td style=&quot;width: 80%;&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;link_rel&quot; id=&quot;link_rel&quot; size=&quot;50&quot; value=&quot;&lt;?php echo $link-&gt;link_rel; ?&gt;&quot; /&gt;&lt;/td&gt;
+		&lt;td style=&quot;width: 80%;&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;link_rel&quot; id=&quot;link_rel&quot; size=&quot;50&quot; value=&quot;&lt;?php echo ( isset( $link-&gt;link_rel ) ? $link-&gt;link_rel : ''); ?&gt;&quot; /&gt;&lt;/td&gt;
 	&lt;/tr&gt;
 	&lt;tr&gt;
 		&lt;td colspan=&quot;2&quot;&gt;
@@ -262,22 +291,29 @@ function link_xfn_meta_box($link) {
 &lt;p&gt;&lt;?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out &lt;a href=&quot;http://gmpg.org/xfn/&quot;&gt;XFN&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'advanced', 'core');
+add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
 
+/**
+ * Display advanced link options form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
 function link_advanced_meta_box($link) {
 ?&gt;
 &lt;table class=&quot;form-table&quot; style=&quot;width: 100%;&quot; cellspacing=&quot;2&quot; cellpadding=&quot;5&quot;&gt;
 	&lt;tr class=&quot;form-field&quot;&gt;
 		&lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;link_image&quot;&gt;&lt;?php _e('Image Address') ?&gt;&lt;/label&gt;&lt;/th&gt;
-		&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;link_image&quot; id=&quot;link_image&quot; size=&quot;50&quot; value=&quot;&lt;?php echo $link-&gt;link_image; ?&gt;&quot; style=&quot;width: 95%&quot; /&gt;&lt;/td&gt;
+		&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;link_image&quot; id=&quot;link_image&quot; size=&quot;50&quot; value=&quot;&lt;?php echo ( isset( $link-&gt;link_image ) ? $link-&gt;link_image : ''); ?&gt;&quot; style=&quot;width: 95%&quot; /&gt;&lt;/td&gt;
 	&lt;/tr&gt;
 	&lt;tr class=&quot;form-field&quot;&gt;
 		&lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;rss_uri&quot;&gt;&lt;?php _e('RSS Address') ?&gt;&lt;/label&gt;&lt;/th&gt;
-		&lt;td&gt;&lt;input name=&quot;link_rss&quot; type=&quot;text&quot; id=&quot;rss_uri&quot; value=&quot;&lt;?php echo $link-&gt;link_rss; ?&gt;&quot; size=&quot;50&quot; style=&quot;width: 95%&quot; /&gt;&lt;/td&gt;
+		&lt;td&gt;&lt;input name=&quot;link_rss&quot; type=&quot;text&quot; id=&quot;rss_uri&quot; value=&quot;&lt;?php echo  ( isset( $link-&gt;link_rss ) ? $link-&gt;link_rss : ''); ?&gt;&quot; size=&quot;50&quot; style=&quot;width: 95%&quot; /&gt;&lt;/td&gt;
 	&lt;/tr&gt;
 	&lt;tr class=&quot;form-field&quot;&gt;
 		&lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;link_notes&quot;&gt;&lt;?php _e('Notes') ?&gt;&lt;/label&gt;&lt;/th&gt;
-		&lt;td&gt;&lt;textarea name=&quot;link_notes&quot; id=&quot;link_notes&quot; cols=&quot;50&quot; rows=&quot;10&quot; style=&quot;width: 95%&quot;&gt;&lt;?php echo $link-&gt;link_notes; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
+		&lt;td&gt;&lt;textarea name=&quot;link_notes&quot; id=&quot;link_notes&quot; cols=&quot;50&quot; rows=&quot;10&quot; style=&quot;width: 95%&quot;&gt;&lt;?php echo  ( isset( $link-&gt;link_notes ) ? $link-&gt;link_notes : ''); ?&gt;&lt;/textarea&gt;&lt;/td&gt;
 	&lt;/tr&gt;
 	&lt;tr class=&quot;form-field&quot;&gt;
 		&lt;th valign=&quot;top&quot;  scope=&quot;row&quot;&gt;&lt;label for=&quot;link_rating&quot;&gt;&lt;?php _e('Rating') ?&gt;&lt;/label&gt;&lt;/th&gt;
@@ -285,7 +321,7 @@ function link_advanced_meta_box($link) {
 		&lt;?php
 			for ($r = 0; $r &lt; 10; $r++) {
 				echo('            &lt;option value=&quot;'.$r.'&quot; ');
-				if ($link-&gt;link_rating == $r)
+				if ( isset($link-&gt;link_rating) &amp;&amp; $link-&gt;link_rating == $r)
 					echo 'selected=&quot;selected&quot;';
 				echo('&gt;'.$r.'&lt;/option&gt;');
 			}
@@ -295,7 +331,75 @@ function link_advanced_meta_box($link) {
 &lt;/table&gt;
 &lt;?php
 }
-add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'advanced', 'core');
+add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
+
+do_action('do_meta_boxes', 'link', 'normal', $link);
+do_action('do_meta_boxes', 'link', 'advanced', $link);
+do_action('do_meta_boxes', 'link', 'side', $link);
+
+require_once ('admin-header.php');
+
+?&gt;
+
+
+&lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
+
+&lt;?php if ( isset( $_GET['added'] ) ) : ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php _e('Link added.'); ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+
+&lt;?php
+if ( !empty($form) )
+	echo $form;
+if ( !empty($link_added) )
+	echo $link_added;
+
+wp_nonce_field( $nonce_action );
+wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?&gt;
+
+&lt;div id=&quot;poststuff&quot; class=&quot;metabox-holder&quot;&gt;
+
+&lt;div id=&quot;side-info-column&quot; class=&quot;inner-sidebar&quot;&gt;
+&lt;?php
+
+do_action('submitlink_box');
+$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
+
+?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;post-body&quot; class=&quot;&lt;?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?&gt;&quot;&gt;
+&lt;div id=&quot;post-body-content&quot; class=&quot;has-sidebar-content&quot;&gt;
+&lt;div id=&quot;namediv&quot; class=&quot;stuffbox&quot;&gt;
+&lt;h3&gt;&lt;label for=&quot;link_name&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/label&gt;&lt;/h3&gt;
+&lt;div class=&quot;inside&quot;&gt;
+	&lt;input type=&quot;text&quot; name=&quot;link_name&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo $link-&gt;link_name; ?&gt;&quot; id=&quot;link_name&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('Example: Nifty blogging software'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;addressdiv&quot; class=&quot;stuffbox&quot;&gt;
+&lt;h3&gt;&lt;label for=&quot;link_url&quot;&gt;&lt;?php _e('Web Address') ?&gt;&lt;/label&gt;&lt;/h3&gt;
+&lt;div class=&quot;inside&quot;&gt;
+	&lt;input type=&quot;text&quot; name=&quot;link_url&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo $link-&gt;link_url; ?&gt;&quot; id=&quot;link_url&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('Example: &lt;code&gt;http://wordpress.org/&lt;/code&gt; &amp;#8212; don&amp;#8217;t forget the &lt;code&gt;http://&lt;/code&gt;'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;descriptiondiv&quot; class=&quot;stuffbox&quot;&gt;
+&lt;h3&gt;&lt;label for=&quot;link_description&quot;&gt;&lt;?php _e('Description') ?&gt;&lt;/label&gt;&lt;/h3&gt;
+&lt;div class=&quot;inside&quot;&gt;
+	&lt;input type=&quot;text&quot; name=&quot;link_description&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo isset($link-&gt;link_description) ? $link-&gt;link_description : ''; ?&gt;&quot; id=&quot;link_description&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;?php
+
+do_meta_boxes('link', 'normal', $link);
 
 do_meta_boxes('link', 'advanced', $link);
 
@@ -310,7 +414,7 @@ if ( $link_id ) : ?&gt;
 
 &lt;/div&gt;
 &lt;/div&gt;
-
 &lt;/div&gt;
 
 &lt;/form&gt;
+&lt;/div&gt;</diff>
      <filename>wp-admin/edit-link-form.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,29 @@
 &lt;?php
+/**
+ * Edit page form for inclusion in the administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Post ID global.
+ * @name $post_ID
+ * @var int
+ */
+if ( ! isset( $post_ID ) )
+	$post_ID = 0;
+if ( ! isset( $temp_ID ) )
+	$temp_ID = 0;
+
 if ( isset($_GET['message']) )
 	$_GET['message'] = absint( $_GET['message'] );
-$messages[1] = sprintf( __( 'Page updated. Continue editing below or &lt;a href=&quot;%s&quot;&gt;go back&lt;/a&gt;.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
+$messages[1] = sprintf( __( 'Page updated. Continue editing below or &lt;a href=&quot;%s&quot;&gt;go back&lt;/a&gt;.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
 $messages[2] = __('Custom field updated.');
 $messages[3] = __('Custom field deleted.');
 $messages[4] = __('Page updated.');
+$messages[5] = sprintf(__('Page published. &lt;a href=&quot;%s&quot;&gt;View page&lt;/a&gt;'), get_permalink($post_ID));
+$messages[6] = sprintf(__('Page submitted. &lt;a href=&quot;%s&quot;&gt;Preview page&lt;/a&gt;'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
 
 if ( isset($_GET['revision']) )
 	$messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
@@ -12,7 +31,7 @@ if ( isset($_GET['revision']) )
 $notice = false;
 $notices[1] = __( 'There is an autosave of this page that is more recent than the version below.  &lt;a href=&quot;%s&quot;&gt;View the autosave&lt;/a&gt;.' );
 
-if (!isset($post_ID) || 0 == $post_ID) {
+if ( 0 == $post_ID) {
 	$form_action = 'post';
 	$nonce_action = 'add-page';
 	$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
@@ -22,7 +41,7 @@ if (!isset($post_ID) || 0 == $post_ID) {
 	$form_action = 'editpost';
 	$nonce_action = 'update-page_' . $post_ID;
 	$form_extra = &quot;&lt;input type='hidden' id='post_ID' name='post_ID' value='$post_ID' /&gt;&quot;;
-	$autosave = wp_get_post_autosave( $post_id );
+	$autosave = wp_get_post_autosave( $post_ID );
 	if ( $autosave &amp;&amp; mysql2date( 'U', $autosave-&gt;post_modified_gmt ) &gt; mysql2date( 'U', $post-&gt;post_modified_gmt ) )
 		$notice = sprintf( $notices[1], get_edit_post_link( $autosave-&gt;ID ) );
 }
@@ -30,193 +49,277 @@ if (!isset($post_ID) || 0 == $post_ID) {
 $temp_ID = (int) $temp_ID;
 $user_ID = (int) $user_ID;
 
+/**
+ * Display submit form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function page_submit_meta_box($post) {
+	global $action;
+
+	$can_publish = current_user_can('publish_pages');
 ?&gt;
+&lt;div class=&quot;submitbox&quot; id=&quot;submitpage&quot;&gt;
 
-&lt;?php if ( $notice ) : ?&gt;
-&lt;div id=&quot;notice&quot; class=&quot;error&quot;&gt;&lt;p&gt;&lt;?php echo $notice ?&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php endif; ?&gt;
-&lt;?php if (isset($_GET['message'])) : ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php endif; ?&gt;
+&lt;div id=&quot;minor-publishing&quot;&gt;
 
-&lt;form name=&quot;post&quot; action=&quot;page.php&quot; method=&quot;post&quot; id=&quot;post&quot;&gt;
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php _e('Write Page') ?&gt;&lt;/h2&gt;
+&lt;?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?&gt;
+&lt;div style=&quot;display:none;&quot;&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; value=&quot;&lt;?php echo attribute_escape( __('Save') ); ?&gt;&quot; /&gt;
+&lt;/div&gt;
 
-&lt;?php
-wp_nonce_field($nonce_action);
+&lt;div id=&quot;minor-publishing-actions&quot;&gt;
+&lt;div id=&quot;save-action&quot;&gt;
+&lt;?php if ( 'publish' != $post-&gt;post_status &amp;&amp; 'future' != $post-&gt;post_status &amp;&amp; 'pending' != $post-&gt;post_status )  { ?&gt;
+&lt;input &lt;?php if ( 'private' == $post-&gt;post_status ) { ?&gt;style=&quot;display:none&quot;&lt;?php } ?&gt; type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php echo attribute_escape( __('Save Draft') ); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;?php } elseif ( 'pending' == $post-&gt;post_status &amp;&amp; $can_publish ) { ?&gt;
+&lt;input type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; value=&quot;&lt;?php echo attribute_escape( __('Save as Pending') ); ?&gt;&quot; tabindex=&quot;4&quot; class=&quot;button button-highlighted&quot; /&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
 
-if (isset($mode) &amp;&amp; 'bookmarklet' == $mode)
-	echo '&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;bookmarklet&quot; /&gt;';
-?&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;user-id&quot; name=&quot;user_ID&quot; value=&quot;&lt;?php echo $user_ID ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;hiddenaction&quot; name=&quot;action&quot; value='&lt;?php echo $form_action ?&gt;' /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;originalaction&quot; name=&quot;originalaction&quot; value=&quot;&lt;?php echo $form_action ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;post_author&quot; name=&quot;post_author&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_author ); ?&gt;&quot; /&gt;
-&lt;?php echo $form_extra ?&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;post_type&quot; name=&quot;post_type&quot; value=&quot;&lt;?php echo $post-&gt;post_type ?&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; id=&quot;original_post_status&quot; name=&quot;original_post_status&quot; value=&quot;&lt;?php echo $post-&gt;post_status ?&gt;&quot; /&gt;
-&lt;input name=&quot;referredby&quot; type=&quot;hidden&quot; id=&quot;referredby&quot; value=&quot;&lt;?php echo clean_url(stripslashes(wp_get_referer())); ?&gt;&quot; /&gt;
-&lt;?php if ( 'draft' != $post-&gt;post_status ) wp_original_referer_field(true, 'previous'); ?&gt;
+&lt;div id=&quot;preview-action&quot;&gt;
+&lt;?php $preview_link = 'publish' == $post-&gt;post_status ? clean_url(get_permalink($post-&gt;ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post-&gt;ID)))); ?&gt;
 
-&lt;div id=&quot;poststuff&quot;&gt;
+&lt;a class=&quot;preview button&quot; href=&quot;&lt;?php echo $preview_link; ?&gt;&quot; target=&quot;wp-preview&quot; id=&quot;post-preview&quot; tabindex=&quot;4&quot;&gt;&lt;?php _e('Preview'); ?&gt;&lt;/a&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;wp-preview&quot; id=&quot;wp-preview&quot; value=&quot;&quot; /&gt;
+&lt;/div&gt;
 
-&lt;div class=&quot;submitbox&quot; id=&quot;submitpage&quot;&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;&lt;?php // /minor-publishing-actions ?&gt;
 
-&lt;div id=&quot;previewview&quot;&gt;
-&lt;?php if ( 'publish' == $post-&gt;post_status ) { ?&gt;
-&lt;a href=&quot;&lt;?php echo clean_url(get_permalink($post-&gt;ID)); ?&gt;&quot; target=&quot;_blank&quot;  tabindex=&quot;4&quot;&gt;&lt;?php _e('View this Page'); ?&gt;&lt;/a&gt;
-&lt;?php } elseif ( 'edit' == $action ) { ?&gt;
-&lt;a href=&quot;&lt;?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post-&gt;ID)))); ?&gt;&quot; target=&quot;_blank&quot; tabindex=&quot;4&quot;&gt;&lt;?php _e('Preview this Page'); ?&gt;&lt;/a&gt;
-&lt;?php } ?&gt;
-&lt;/div&gt;
+&lt;div id=&quot;misc-publishing-actions&quot;&gt;
 
-&lt;div class=&quot;inside&quot;&gt;
-&lt;p&gt;&lt;strong&gt;&lt;label for='post_status'&gt;&lt;?php _e('Publish Status') ?&gt;&lt;/label&gt;&lt;/strong&gt;&lt;/p&gt;
-&lt;p&gt;
-&lt;select name='post_status' tabindex='4' id='post_status'&gt;
-&lt;?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages')
-// 'publish' option will be selected for published AND private posts (checkbox overrides dropdown)
-if ( current_user_can('publish_pages') OR ( $post-&gt;post_status == 'publish' AND current_user_can('edit_page', $post-&gt;ID) ) ) : 
+&lt;div class=&quot;misc-pub-section&lt;?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?&gt;&quot;&gt;&lt;label for=&quot;post_status&quot;&gt;&lt;?php _e('Status:') ?&gt;&lt;/label&gt;
+&lt;b&gt;&lt;span id=&quot;post-status-display&quot;&gt;
+&lt;?php
+switch ( $post-&gt;post_status ) {
+	case 'private':
+		_e('Privately Published');
+		break;
+	case 'publish':
+		_e('Published');
+		break;
+	case 'future':
+		_e('Scheduled');
+		break;
+	case 'pending':
+		_e('Pending Review');
+		break;
+	case 'draft':
+		_e('Draft');
+		break;
+}
 ?&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'publish' ); selected( $post-&gt;post_status, 'private' );?&gt; value='publish'&gt;&lt;?php _e('Published') ?&gt;&lt;/option&gt;
-&lt;?php endif; ?&gt;
-&lt;?php if ( 'future' == $post-&gt;post_status ) : ?&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'future' ); ?&gt; value='future'&gt;&lt;?php _e('Pending') ?&gt;&lt;/option&gt;
+&lt;/span&gt;&lt;/b&gt;
+&lt;?php if ( 'publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status || $can_publish ) { ?&gt;
+&lt;a href=&quot;#post_status&quot; &lt;?php if ( 'private' == $post-&gt;post_status ) { ?&gt;style=&quot;display:none;&quot; &lt;?php } ?&gt;class=&quot;edit-post-status hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
+
+&lt;div id=&quot;post-status-select&quot; class=&quot;hide-if-js&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_status&quot; id=&quot;hidden_post_status&quot; value=&quot;&lt;?php echo $post-&gt;post_status; ?&gt;&quot; /&gt;
+&lt;select name='post_status' id='post_status' tabindex='4'&gt;
+&lt;?php if ( 'publish' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'publish' ); ?&gt; value='publish'&gt;&lt;?php _e('Published') ?&gt;&lt;/option&gt;
+&lt;?php elseif ( 'private' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'private' ); ?&gt; value='publish'&gt;&lt;?php _e('Privately Published') ?&gt;&lt;/option&gt;
+&lt;?php elseif ( 'future' == $post-&gt;post_status ) : ?&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'future' ); ?&gt; value='future'&gt;&lt;?php _e('Scheduled') ?&gt;&lt;/option&gt;
 &lt;?php endif; ?&gt;
 &lt;option&lt;?php selected( $post-&gt;post_status, 'pending' ); ?&gt; value='pending'&gt;&lt;?php _e('Pending Review') ?&gt;&lt;/option&gt;
-&lt;option&lt;?php selected( $post-&gt;post_status, 'draft' ); ?&gt; value='draft'&gt;&lt;?php _e('Unpublished') ?&gt;&lt;/option&gt;
+&lt;option&lt;?php selected( $post-&gt;post_status, 'draft' ); ?&gt; value='draft'&gt;&lt;?php _e('Draft') ?&gt;&lt;/option&gt;
 &lt;/select&gt;
+
+ &lt;a href=&quot;#post_status&quot; class=&quot;save-post-status hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+ &lt;a href=&quot;#post_status&quot; class=&quot;cancel-post-status hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+&lt;/div&gt;
+
+&lt;?php } ?&gt;
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+
+&lt;div class=&quot;misc-pub-section &quot; id=&quot;visibility&quot;&gt;
+&lt;?php _e('Visibility:'); ?&gt; &lt;b&gt;&lt;span id=&quot;post-visibility-display&quot;&gt;&lt;?php
+
+if ( 'private' == $post-&gt;post_status ) {
+	$post-&gt;post_password = '';
+	$visibility = 'private';
+	$visibility_trans = __('Private');
+} elseif ( !empty( $post-&gt;post_password ) ) {
+	$visibility = 'password';
+	$visibility_trans = __('Password protected');
+} else {
+	$visibility = 'public';
+	$visibility_trans = __('Public');
+}
+
+?&gt;&lt;?php echo wp_specialchars( $visibility_trans ); ?&gt;&lt;/span&gt;&lt;/b&gt; &lt;?php if ( $can_publish ) { ?&gt; &lt;a href=&quot;#visibility&quot; class=&quot;edit-visibility hide-if-no-js&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/a&gt;
+
+&lt;div id=&quot;post-visibility-select&quot; class=&quot;hide-if-js&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_password&quot; id=&quot;hidden-post-password&quot; value=&quot;&lt;?php echo attribute_escape($post-&gt;post_password); ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;hidden_post_visibility&quot; id=&quot;hidden-post-visibility&quot; value=&quot;&lt;?php echo attribute_escape( $visibility ); ?&gt;&quot; /&gt;
+
+
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-public&quot; value=&quot;public&quot; &lt;?php checked( $visibility, 'public' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-public&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Public'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-password&quot; value=&quot;password&quot; &lt;?php checked( $visibility, 'password' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-password&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Password protected'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;span id=&quot;password-span&quot;&gt;&lt;label for=&quot;post_password&quot;&gt;&lt;?php _e('Password:'); ?&gt;&lt;/label&gt; &lt;input type=&quot;text&quot; name=&quot;post_password&quot; id=&quot;post_password&quot; value=&quot;&lt;?php echo attribute_escape($post-&gt;post_password); ?&gt;&quot; /&gt;&lt;br /&gt;&lt;/span&gt;
+&lt;input type=&quot;radio&quot; name=&quot;visibility&quot; id=&quot;visibility-radio-private&quot; value=&quot;private&quot; &lt;?php checked( $visibility, 'private' ); ?&gt; /&gt; &lt;label for=&quot;visibility-radio-private&quot; class=&quot;selectit&quot;&gt;&lt;?php _e('Private'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+
+&lt;p&gt;
+ &lt;a href=&quot;#visibility&quot; class=&quot;save-post-visibility hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+ &lt;a href=&quot;#visibility&quot; class=&quot;cancel-post-visibility hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
 &lt;/p&gt;
-&lt;?php if ( current_user_can( 'publish_posts' ) ) : ?&gt; 
-&lt;p id=&quot;private-checkbox&quot;&gt;&lt;label for=&quot;post_status_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;post_status_private&quot; name=&quot;post_status&quot; type=&quot;checkbox&quot; value=&quot;private&quot; &lt;?php checked($post-&gt;post_status, 'private'); ?&gt; tabindex='4' /&gt; &lt;?php _e('Keep this page private') ?&gt;&lt;/label&gt;&lt;/p&gt;
-&lt;?php endif; ?&gt;
+&lt;/div&gt;
+&lt;?php } ?&gt;
+
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
 
 &lt;?php
-if ($post_ID) {
+$datef = _c( 'M j, Y @ G:i|Publish box date format');
+if ( 0 != $post-&gt;ID ) {
 	if ( 'future' == $post-&gt;post_status ) { // scheduled for publishing at a future date
-		$stamp = __('Scheduled for:&lt;br /&gt;%1$s at %2$s');
-	} else if ( 'publish' == $post-&gt;post_status ) { // already published
-		$stamp = __('Published on:&lt;br /&gt;%1$s at %2$s');
-	} else if ( '0000-00-00 00:00:00' == $post-&gt;post_date ) { // draft, 1 or more saves, no date specified
-		$stamp = __('Publish immediately');
+		$stamp = __('Scheduled for: &lt;b&gt;%1$s&lt;/b&gt;');
+	} else if ( 'publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status ) { // already published
+		$stamp = __('Published on: &lt;b&gt;%1$s&lt;/b&gt;');
+	} else if ( '0000-00-00 00:00:00' == $post-&gt;post_date_gmt ) { // draft, 1 or more saves, no date specified
+		$stamp = __('Publish &lt;b&gt;immediately&lt;/b&gt;');
+	} else if ( time() &lt; strtotime( $post-&gt;post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
+		$stamp = __('Schedule for: &lt;b&gt;%1$s&lt;/b&gt;');
 	} else { // draft, 1 or more saves, date specified
-		$stamp = __('Publish on:&lt;br /&gt;%1$s at %2$s');
+		$stamp = __('Publish on: &lt;b&gt;%1$s&lt;/b&gt;');
 	}
-	$date = mysql2date(get_option('date_format'), $post-&gt;post_date);
-	$time = mysql2date(get_option('time_format'), $post-&gt;post_date);
+	$date = date_i18n( $datef, strtotime( $post-&gt;post_date ) );
 } else { // draft (no saves, and thus no date specified)
-	$stamp = __('Publish immediately');
-	$date = mysql2date(get_option('date_format'), current_time('mysql'));
-	$time = mysql2date(get_option('time_format'), current_time('mysql'));
+	$stamp = __('Publish &lt;b&gt;immediately&lt;/b&gt;');
+	$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
 }
 ?&gt;
-&lt;p class=&quot;curtime&quot;&gt;&lt;?php printf($stamp, $date, $time); ?&gt;
-&amp;nbsp;&lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?&gt;
+&lt;div class=&quot;misc-pub-section curtime misc-pub-section-last&quot;&gt;
+	&lt;span id=&quot;timestamp&quot;&gt;
+	&lt;?php printf($stamp, $date); ?&gt;&lt;/span&gt;
+	&lt;a href=&quot;#edit_timestamp&quot; class=&quot;edit-timestamp hide-if-no-js&quot; tabindex='4'&gt;&lt;?php _e('Edit') ?&gt;&lt;/a&gt;
+	&lt;div id=&quot;timestampdiv&quot; class=&quot;hide-if-js&quot;&gt;&lt;?php touch_time(($action == 'edit'),1,4); ?&gt;&lt;/div&gt;
+&lt;/div&gt;&lt;?php // /misc-pub-section ?&gt;
+&lt;?php endif; ?&gt;
 
-&lt;div id='timestampdiv' class='hide-if-js'&gt;&lt;?php touch_time(($action == 'edit'),1,4); ?&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
 
+&lt;div id=&quot;major-publishing-actions&quot;&gt;
+&lt;?php do_action('post_submitbox_start'); ?&gt;
+&lt;div id=&quot;delete-action&quot;&gt;
+&lt;?php
+if ( ( 'edit' == $action ) &amp;&amp; current_user_can('delete_page', $post-&gt;ID) ) { ?&gt;
+&lt;a class=&quot;submitdelete deletion&quot; href=&quot;&lt;?php echo wp_nonce_url(&quot;page.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-page_' . $post-&gt;ID); ?&gt;&quot; onclick=&quot;if ( confirm('&lt;?php echo js_escape(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )); ?&gt;') ) {return true;}return false;&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/a&gt;
+&lt;?php } ?&gt;
 &lt;/div&gt;
 
-&lt;p class=&quot;submit&quot;&gt;
-&lt;input type=&quot;submit&quot; name=&quot;save&quot; class=&quot;button button-highlighted&quot; value=&quot;&lt;?php _e('Save'); ?&gt;&quot; tabindex=&quot;4&quot; /&gt;
+&lt;div id=&quot;publishing-action&quot;&gt;
 &lt;?php
-if ( !in_array( $post-&gt;post_status, array('publish', 'future') ) || 0 == $post_ID ) {
-?&gt;
-&lt;?php if ( current_user_can('publish_pages') ) : ?&gt;
-	&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Publish') ?&gt;&quot; /&gt;
+if ( !in_array( $post-&gt;post_status, array('publish', 'future', 'private') ) || 0 == $post-&gt;ID ) { ?&gt;
+&lt;?php if ( $can_publish ) : ?&gt;
+	&lt;?php if ( !empty($post-&gt;post_date_gmt) &amp;&amp; time() &lt; strtotime( $post-&gt;post_date_gmt . ' +0000' ) ) : ?&gt;
+		&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Schedule') ?&gt;&quot; /&gt;
+		&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Schedule') ?&gt;&quot; /&gt;
+	&lt;?php else : ?&gt;
+		&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Publish') ?&gt;&quot; /&gt;
+		&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Publish') ?&gt;&quot; /&gt;
+	&lt;?php endif; ?&gt;
 &lt;?php else : ?&gt;
-	&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Submit for Review') ?&gt;&quot; /&gt;
+	&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Submit for Review') ?&gt;&quot; /&gt;
+	&lt;input name=&quot;publish&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Submit for Review') ?&gt;&quot; /&gt;
 &lt;?php endif; ?&gt;
+&lt;?php } else { ?&gt;
+	&lt;input name=&quot;original_publish&quot; type=&quot;hidden&quot; id=&quot;original_publish&quot; value=&quot;&lt;?php _e('Update Page') ?&gt;&quot; /&gt;
+	&lt;input name=&quot;save&quot; type=&quot;submit&quot; class=&quot;button-primary&quot; id=&quot;publish&quot; tabindex=&quot;5&quot; accesskey=&quot;p&quot; value=&quot;&lt;?php _e('Update Page') ?&gt;&quot; /&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
 &lt;?php
 }
-
-if ( ('edit' == $action) &amp;&amp; current_user_can('delete_page', $post_ID) )
-	echo &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;page.php?action=delete&amp;amp;post=$post_ID&quot;, 'delete-page_' . $post_ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete&amp;nbsp;page') . &quot;&lt;/a&gt;&quot;;
+add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core');
+
+/**
+ * Display page password form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function page_password_meta_box($post){
 ?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;?php if ($post_ID): ?&gt;
-&lt;?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
-	$last_user = get_userdata($last_id);
-	printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user-&gt;display_name ), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
-} else {
-	printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
+&lt;p&gt;&lt;label for=&quot;post_status_private&quot; class=&quot;selectit&quot;&gt;&lt;input id=&quot;post_status_private&quot; name=&quot;post_status&quot; type=&quot;checkbox&quot; value=&quot;private&quot; &lt;?php checked($post-&gt;post_status, 'private'); ?&gt; tabindex='4' /&gt; &lt;?php _e('Keep this page private') ?&gt;&lt;/label&gt;&lt;/p&gt;
+&lt;h4&gt;&lt;?php _e( 'Page Password' ); ?&gt;&lt;/h4&gt;
+&lt;p&gt;&lt;label class=&quot;hidden&quot; for=&quot;post_password&quot;&gt;&lt;?php _e('Password Protect This Page') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_password&quot; type=&quot;text&quot; size=&quot;25&quot; id=&quot;post_password&quot; value=&quot;&lt;?php the_post_password(); ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p&gt;&lt;?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?&gt;&lt;/p&gt;
+&lt;?php
 }
+// add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
+
+/**
+ * Display page attributes form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function page_attributes_meta_box($post){
 ?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;?php endif; ?&gt;
-&lt;span id=&quot;autosave&quot;&gt;&lt;/span&gt;
-&lt;span id=&quot;wp-word-count&quot;&gt;&lt;/span&gt;
-&lt;/p&gt;
-
-&lt;div class=&quot;side-info&quot;&gt;
-&lt;h5&gt;&lt;?php _e('Related') ?&gt;&lt;/h5&gt;
-
-&lt;ul&gt;
-&lt;?php if ($post_ID): ?&gt;
-&lt;li&gt;&lt;a href=&quot;edit-pages.php?page_id=&lt;?php echo $post_ID ?&gt;&quot;&gt;&lt;?php _e('See Comments on this Page') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;?php endif; ?&gt;
-&lt;li&gt;&lt;a href=&quot;edit-comments.php&quot;&gt;&lt;?php _e('Manage All Comments') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;li&gt;&lt;a href=&quot;edit-pages.php&quot;&gt;&lt;?php _e('Manage All Pages') ?&gt;&lt;/a&gt;&lt;/li&gt;
-&lt;?php do_action('page_relatedlinks_list'); ?&gt;
-&lt;/ul&gt;
-&lt;/div&gt;
-&lt;?php do_action('submitpage_box'); ?&gt;
-&lt;/div&gt;
-
-&lt;div id=&quot;post-body&quot;&gt;
-&lt;div id=&quot;titlediv&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;title&quot;&gt;&lt;?php _e('Title') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;div id=&quot;titlewrap&quot;&gt;
-  &lt;input type=&quot;text&quot; name=&quot;post_title&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_title ); ?&gt;&quot; id=&quot;title&quot; autocomplete=&quot;off&quot; /&gt;
-&lt;/div&gt;
-&lt;div class=&quot;inside&quot;&gt;
-&lt;?php $sample_permalink_html = get_sample_permalink_html($post-&gt;ID); ?&gt;
-	&lt;div id=&quot;edit-slug-box&quot;&gt;
-&lt;?php if ( ! empty($post-&gt;ID) &amp;&amp; ! empty($sample_permalink_html) ) :
-	echo $sample_permalink_html;
-endif; ?&gt;
-	&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-
-&lt;div id=&quot;&lt;?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?&gt;&quot; class=&quot;postarea&quot;&gt;
-&lt;h3&gt;&lt;label for=&quot;content&quot;&gt;&lt;?php _e('Page') ?&gt;&lt;/label&gt;&lt;/h3&gt;
-&lt;?php the_editor($post-&gt;post_content); ?&gt;
-&lt;?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?&gt;
-&lt;?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?&gt;
-&lt;?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?&gt;
-&lt;?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?&gt;
-&lt;/div&gt;
-
-&lt;?php do_meta_boxes('page', 'normal', $post); ?&gt;
-
-&lt;?php do_action('edit_page_form'); ?&gt;
-
-&lt;h2&gt;&lt;?php _e('Advanced Options'); ?&gt;&lt;/h2&gt;
-
-
-&lt;?php 
+&lt;h5&gt;&lt;?php _e('Parent') ?&gt;&lt;/h5&gt;
+&lt;label class=&quot;hidden&quot; for=&quot;parent_id&quot;&gt;&lt;?php _e('Page Parent') ?&gt;&lt;/label&gt;
+&lt;?php wp_dropdown_pages(array('exclude_tree' =&gt; $post-&gt;ID, 'selected' =&gt; $post-&gt;post_parent, 'name' =&gt; 'parent_id', 'show_option_none' =&gt; __('Main Page (no parent)'), 'sort_column'=&gt; 'menu_order, post_title')); ?&gt;
+&lt;p&gt;&lt;?php _e('You can arrange your pages in hierarchies, for example you could have an &amp;#8220;About&amp;#8221; page that has &amp;#8220;Life Story&amp;#8221; and &amp;#8220;My Dog&amp;#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?&gt;&lt;/p&gt;
+&lt;?php
+	if ( 0 != count( get_page_templates() ) ) {
+?&gt;
+&lt;h5&gt;&lt;?php _e('Template') ?&gt;&lt;/h5&gt;
+&lt;label class=&quot;hidden&quot; for=&quot;page_template&quot;&gt;&lt;?php _e('Page Template') ?&gt;&lt;/label&gt;&lt;select name=&quot;page_template&quot; id=&quot;page_template&quot;&gt;
+&lt;option value='default'&gt;&lt;?php _e('Default Template'); ?&gt;&lt;/option&gt;
+&lt;?php page_template_dropdown($post-&gt;page_template); ?&gt;
+&lt;/select&gt;
+&lt;p&gt;&lt;?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&amp;#8217;ll see them above.'); ?&gt;&lt;/p&gt;
+&lt;?php
+	}
+?&gt;
+&lt;h5&gt;&lt;?php _e('Order') ?&gt;&lt;/h5&gt;
+&lt;p&gt;&lt;label class=&quot;hidden&quot; for=&quot;menu_order&quot;&gt;&lt;?php _e('Page Order') ?&gt;&lt;/label&gt;&lt;input name=&quot;menu_order&quot; type=&quot;text&quot; size=&quot;4&quot; id=&quot;menu_order&quot; value=&quot;&lt;?php echo $post-&gt;menu_order ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p&gt;&lt;?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&amp;#8217;ll be better in future releases.)'); ?&gt;&lt;/p&gt;
+&lt;?php
+}
+add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
+
+/**
+ * Display custom field for page form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function page_custom_meta_box($post){
 ?&gt;
 &lt;div id=&quot;postcustomstuff&quot;&gt;
-&lt;table cellpadding=&quot;3&quot;&gt;
 &lt;?php
 $metadata = has_meta($post-&gt;ID);
 list_meta($metadata);
-?&gt;
-
-&lt;/table&gt;
-&lt;?php
-	meta_form();
+meta_form();
 ?&gt;
 &lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;p&gt;&lt;?php _e('Custom fields can be used to add extra metadata to a post that you can &lt;a href=&quot;http://codex.wordpress.org/Using_Custom_Fields&quot; target=&quot;_blank&quot;&gt;use in your theme&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'advanced', 'core');
-
+add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core');
+
+/**
+ * Display comments status form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function page_comments_status_meta_box($post){
 ?&gt;
 &lt;input name=&quot;advanced_view&quot; type=&quot;hidden&quot; value=&quot;1&quot; /&gt;
@@ -225,92 +328,168 @@ function page_comments_status_meta_box($post){
 &lt;?php _e('Allow Comments') ?&gt;&lt;/label&gt;&lt;/p&gt;
 &lt;p&gt;&lt;label for=&quot;ping_status&quot; class=&quot;selectit&quot;&gt;&lt;input name=&quot;ping_status&quot; type=&quot;checkbox&quot; id=&quot;ping_status&quot; value=&quot;open&quot; &lt;?php checked($post-&gt;ping_status, 'open'); ?&gt; /&gt; &lt;?php _e('Allow Pings') ?&gt;&lt;/label&gt;&lt;/p&gt;
 &lt;p&gt;&lt;?php _e('These settings apply to this page only. &amp;#8220;Pings&amp;#8221; are &lt;a href=&quot;http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments&quot; target=&quot;_blank&quot;&gt;trackbacks and pingbacks&lt;/a&gt;.'); ?&gt;&lt;/p&gt;
-&lt;?php 
-}
-add_meta_box('pagecommentstatusdiv', __('Comments &amp;amp; Pings'), 'page_comments_status_meta_box', 'page', 'advanced', 'core');
-
-function page_password_meta_box($post){
-?&gt;
-&lt;p&gt;&lt;label class=&quot;hidden&quot; for=&quot;post_password&quot;&gt;&lt;?php _e('Password Protect This Page') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_password&quot; type=&quot;text&quot; size=&quot;25&quot; id=&quot;post_password&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_password ); ?&gt;&quot; /&gt;&lt;/p&gt;
-&lt;p&gt;&lt;?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?&gt;&lt;/p&gt;
 &lt;?php
 }
-add_meta_box('pagepassworddiv', __('Password Protect This Page'), 'page_password_meta_box', 'page', 'advanced', 'core');
-
+add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
+
+/**
+ * Display page slug form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function page_slug_meta_box($post){
 ?&gt;
 &lt;label class=&quot;hidden&quot; for=&quot;post_name&quot;&gt;&lt;?php _e('Page Slug') ?&gt;&lt;/label&gt;&lt;input name=&quot;post_name&quot; type=&quot;text&quot; size=&quot;13&quot; id=&quot;post_name&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_name ); ?&gt;&quot; /&gt;
 &lt;?php
 }
-add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'advanced', 'core');
-
-function page_parent_meta_box($post){
-?&gt;
-&lt;label class=&quot;hidden&quot; for=&quot;parent_id&quot;&gt;&lt;?php _e('Page Parent') ?&gt;&lt;/label&gt;
-&lt;select name=&quot;parent_id&quot; id=&quot;parent_id&quot;&gt;
-&lt;option value='0'&gt;&lt;?php _e('Main Page (no parent)'); ?&gt;&lt;/option&gt;
-&lt;?php parent_dropdown($post-&gt;post_parent); ?&gt;
-&lt;/select&gt;
-&lt;p&gt;&lt;?php _e('You can arrange your pages in hierarchies, for example you could have an &amp;#8220;About&amp;#8221; page that has &amp;#8220;Life Story&amp;#8221; and &amp;#8220;My Dog&amp;#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?&gt;&lt;/p&gt;
-&lt;?php
-}
-add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'advanced', 'core');
-
-if ( 0 != count( get_page_templates() ) ) {
-	function page_template_meta_box($post){
-?&gt;
-&lt;label class=&quot;hidden&quot; for=&quot;page_template&quot;&gt;&lt;?php _e('Page Template') ?&gt;&lt;/label&gt;&lt;select name=&quot;page_template&quot; id=&quot;page_template&quot;&gt;
-&lt;option value='default'&gt;&lt;?php _e('Default Template'); ?&gt;&lt;/option&gt;
-&lt;?php page_template_dropdown($post-&gt;page_template); ?&gt;
-&lt;/select&gt;
-&lt;p&gt;&lt;?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&amp;#8217;ll see them above.'); ?&gt;&lt;/p&gt;
-&lt;?php
-	}
-	add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'advanced', 'core');
-}
-
-function page_order_meta_box($post){
-?&gt;
-&lt;p&gt;&lt;label class=&quot;hidden&quot; for=&quot;menu_order&quot;&gt;&lt;?php _e('Page Order') ?&gt;&lt;/label&gt;&lt;input name=&quot;menu_order&quot; type=&quot;text&quot; size=&quot;4&quot; id=&quot;menu_order&quot; value=&quot;&lt;?php echo $post-&gt;menu_order ?&gt;&quot; /&gt;&lt;/p&gt;
-&lt;p&gt;&lt;?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&amp;#8217;ll be better in future releases.)'); ?&gt;&lt;/p&gt;
-&lt;?php
-}
-add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'advanced', 'core');
-
+add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
 
-$authors = get_editable_user_ids( $current_user-&gt;id ); // TODO: ROLE SYSTEM
+$authors = get_editable_user_ids( $current_user-&gt;id, true, 'page' ); // TODO: ROLE SYSTEM
 if ( $post-&gt;post_author &amp;&amp; !in_array($post-&gt;post_author, $authors) )
 	$authors[] = $post-&gt;post_author;
 if ( $authors &amp;&amp; count( $authors ) &gt; 1 ) {
+	/**
+	 * Display page author form fields, when more than one author exists.
+	 *
+	 * @since 2.6.0
+	 *
+	 * @param object $post
+	 */
 	function page_author_meta_box($post){
 		global $current_user, $user_ID;
-		$authors = get_editable_user_ids( $current_user-&gt;id ); // TODO: ROLE SYSTEM
+		$authors = get_editable_user_ids( $current_user-&gt;id, true, 'page' ); // TODO: ROLE SYSTEM
 		if ( $post-&gt;post_author &amp;&amp; !in_array($post-&gt;post_author, $authors) )
 			$authors[] = $post-&gt;post_author;
 ?&gt;
 &lt;label class=&quot;hidden&quot; for=&quot;post_author_override&quot;&gt;&lt;?php _e('Page Author'); ?&gt;&lt;/label&gt;&lt;?php wp_dropdown_users( array('include' =&gt; $authors, 'name' =&gt; 'post_author_override', 'selected' =&gt; empty($post-&gt;ID) ? $user_ID : $post-&gt;post_author) ); ?&gt;
 &lt;?php
 	}
-	add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'advanced', 'core');
+	add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
 }
 
-
-if ( isset($post_ID) &amp;&amp; 0 &lt; $post_ID &amp;&amp; wp_get_post_revisions( $post_ID ) ) :
+if ( 0 &lt; $post_ID &amp;&amp; wp_get_post_revisions( $post_ID ) ) :
+/**
+ * Display list of page revisions.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
 function page_revisions_meta_box($post) {
 	wp_list_post_revisions();
 }
-add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'advanced', 'core');
+add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
 endif;
 
-do_meta_boxes('page', 'advanced', $post);
+do_action('do_meta_boxes', 'page', 'normal', $post);
+do_action('do_meta_boxes', 'page', 'advanced', $post);
+do_action('do_meta_boxes', 'page', 'side', $post);
+
+require_once('admin-header.php');
+?&gt;
+
+&lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
+
+&lt;form name=&quot;post&quot; action=&quot;page.php&quot; method=&quot;post&quot; id=&quot;post&quot;&gt;
+&lt;?php if ( $notice ) : ?&gt;
+&lt;div id=&quot;notice&quot; class=&quot;error&quot;&gt;&lt;p&gt;&lt;?php echo $notice ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+&lt;?php if (isset($_GET['message'])) : ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+
+&lt;?php
+wp_nonce_field($nonce_action);
+
+if (isset($mode) &amp;&amp; 'bookmarklet' == $mode)
+	echo '&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;bookmarklet&quot; /&gt;';
+?&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;user-id&quot; name=&quot;user_ID&quot; value=&quot;&lt;?php echo $user_ID ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;hiddenaction&quot; name=&quot;action&quot; value='&lt;?php echo $form_action ?&gt;' /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;originalaction&quot; name=&quot;originalaction&quot; value=&quot;&lt;?php echo $form_action ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;post_author&quot; name=&quot;post_author&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_author ); ?&gt;&quot; /&gt;
+&lt;?php echo $form_extra ?&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;post_type&quot; name=&quot;post_type&quot; value=&quot;&lt;?php echo $post-&gt;post_type ?&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; id=&quot;original_post_status&quot; name=&quot;original_post_status&quot; value=&quot;&lt;?php echo $post-&gt;post_status ?&gt;&quot; /&gt;
+&lt;input name=&quot;referredby&quot; type=&quot;hidden&quot; id=&quot;referredby&quot; value=&quot;&lt;?php echo clean_url(stripslashes(wp_get_referer())); ?&gt;&quot; /&gt;
+&lt;?php if ( 'draft' != $post-&gt;post_status ) wp_original_referer_field(true, 'previous'); ?&gt;
+
+&lt;div id=&quot;poststuff&quot; class=&quot;metabox-holder&quot;&gt;
+
+&lt;div id=&quot;side-info-column&quot; class=&quot;inner-sidebar&quot;&gt;
+
+&lt;?php
+
+do_action('submitpage_box');
+$side_meta_boxes = do_meta_boxes('page', 'side', $post);
+
 ?&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;post-body&quot; class=&quot;&lt;?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?&gt;&quot;&gt;
+&lt;div id=&quot;post-body-content&quot; class=&quot;has-sidebar-content&quot;&gt;
+
+&lt;div id=&quot;titlediv&quot;&gt;
+&lt;div id=&quot;titlewrap&quot;&gt;
+  &lt;input type=&quot;text&quot; name=&quot;post_title&quot; size=&quot;30&quot; tabindex=&quot;1&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_title ); ?&gt;&quot; id=&quot;title&quot; autocomplete=&quot;off&quot; /&gt;
+&lt;/div&gt;
+&lt;div class=&quot;inside&quot;&gt;
+&lt;?php $sample_permalink_html = get_sample_permalink_html($post-&gt;ID); ?&gt;
+	&lt;div id=&quot;edit-slug-box&quot;&gt;
+&lt;?php if ( ! empty($post-&gt;ID) &amp;&amp; ! empty($sample_permalink_html) ) :
+	echo $sample_permalink_html;
+endif; ?&gt;
+	&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
 
+&lt;div id=&quot;&lt;?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?&gt;&quot; class=&quot;postarea&quot;&gt;
+
+&lt;?php the_editor($post-&gt;post_content); ?&gt;
+&lt;div id=&quot;post-status-info&quot;&gt;
+	&lt;span id=&quot;wp-word-count&quot; class=&quot;alignleft&quot;&gt;&lt;/span&gt;
+	&lt;span class=&quot;alignright&quot;&gt;
+	&lt;span id=&quot;autosave&quot;&gt;&amp;nbsp;&lt;/span&gt;
+
+&lt;?php
+	if ($post_ID) {
+		if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
+			$last_user = get_userdata($last_id);
+			printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user-&gt;display_name ), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
+		} else {
+			printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post-&gt;post_modified), mysql2date(get_option('time_format'), $post-&gt;post_modified));
+		}
+	}
+?&gt;
+	&lt;/span&gt;
+	&lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
+
+&lt;?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?&gt;
+&lt;?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?&gt;
 &lt;/div&gt;
 
+&lt;?php
+
+do_meta_boxes('page', 'normal', $post);
+do_action('edit_page_form');
+do_meta_boxes('page', 'advanced', $post);
+
+?&gt;
+
+&lt;/div&gt;
+&lt;/div&gt;
 &lt;/div&gt;
 
 &lt;/form&gt;
+&lt;/div&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;
 try{document.post.title.focus();}catch(e){}</diff>
      <filename>wp-admin/edit-page-form.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,199 +1,277 @@
 &lt;?php
+/**
+ * Edit Pages Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
 require_once('admin.php');
 
-// Handle bulk deletes
-if ( isset($_GET['deleteit']) &amp;&amp; isset($_GET['delete']) ) {
-	check_admin_referer('bulk-pages');
-	foreach( (array) $_GET['delete'] as $post_id_del ) {
-		$post_del = &amp; get_post($post_id_del);
-
-		if ( !current_user_can('delete_page', $post_id_del) )
-			wp_die( __('You are not allowed to delete this page.') );
-
-		if ( $post_del-&gt;post_type == 'attachment' ) {
-			if ( ! wp_delete_attachment($post_id_del) )
-				wp_die( __('Error in deleting...') );
-		} else {
-			if ( !wp_delete_post($post_id_del) )
-				wp_die( __('Error in deleting...') );
-		}
+// Handle bulk actions
+if ( isset($_GET['action']) &amp;&amp; ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
+	$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
+
+	switch ( $doaction ) {
+		case 'delete':
+			if ( isset($_GET['post']) &amp;&amp; ! isset($_GET['bulk_edit']) &amp;&amp; (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
+				check_admin_referer('bulk-pages');
+				$deleted = 0;
+				foreach( (array) $_GET['post'] as $post_id_del ) {
+					$post_del = &amp; get_post($post_id_del);
+
+					if ( !current_user_can('delete_page', $post_id_del) )
+						wp_die( __('You are not allowed to delete this page.') );
+
+					if ( $post_del-&gt;post_type == 'attachment' ) {
+						if ( ! wp_delete_attachment($post_id_del) )
+							wp_die( __('Error in deleting...') );
+					} else {
+						if ( !wp_delete_post($post_id_del) )
+							wp_die( __('Error in deleting...') );
+					}
+					$deleted++;
+				}
+			}
+			break;
+		case 'edit':
+			if ( isset($_GET['post']) &amp;&amp; isset($_GET['bulk_edit']) ) {
+				check_admin_referer('bulk-pages');
+
+				if ( -1 == $_GET['_status'] ) {
+					$_GET['post_status'] = null;
+					unset($_GET['_status'], $_GET['post_status']);
+				} else {
+					$_GET['post_status'] = $_GET['_status'];
+				}
+
+				$done = bulk_edit_posts($_GET);
+			}
+			break;
 	}
 
 	$sendback = wp_get_referer();
 	if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
 	elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
-	$sendback = preg_replace('|[^a-z0-9-~+_.?#=&amp;;,/:]|i', '', $sendback);
-
+	if ( isset($done) ) {
+		$done['updated'] = count( $done['updated'] );
+		$done['skipped'] = count( $done['skipped'] );
+		$done['locked'] = count( $done['locked'] );
+		$sendback = add_query_arg( $done, $sendback );
+	}
+	if ( isset($deleted) )
+		$sendback = add_query_arg('deleted', $deleted, $sendback);
 	wp_redirect($sendback);
 	exit();
-} elseif ( !empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+} elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
+	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
 	 exit;
 }
 
-$title = __('Pages');
-$parent_file = 'edit.php';
-wp_enqueue_script('admin-forms');
+if ( empty($title) )
+	$title = __('Edit Pages');
+$parent_file = 'edit-pages.php';
+wp_enqueue_script('inline-edit-post');
 
 $post_stati  = array(	//	array( adj, noun )
-		'publish' =&gt; array(__('Published'), __('Published pages'), __ngettext_noop('Published (%s)', 'Published (%s)')),
-		'future' =&gt; array(__('Scheduled'), __('Scheduled pages'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')),
-		'pending' =&gt; array(__('Pending Review'), __('Pending pages'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')),
-		'draft' =&gt; array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')),
-		'private' =&gt; array(__('Private'), __('Private pages'), __ngettext_noop('Private (%s)', 'Private (%s)'))
+		'publish' =&gt; array(__('Published|page'), __('Published pages'), _n_noop('Published &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;|page', 'Published &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+		'future' =&gt; array(__('Scheduled|page'), __('Scheduled pages'), _n_noop('Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;|page', 'Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+		'pending' =&gt; array(__('Pending Review|page'), __('Pending pages'), _n_noop('Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;|page', 'Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+		'draft' =&gt; array(__('Draft|page'), _c('Drafts|manage posts header'), _n_noop('Draft &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;|page', 'Drafts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+		'private' =&gt; array(__('Private|page'), __('Private pages'), _n_noop('Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;|page', 'Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;'))
 	);
 
-$post_status_label = __('Manage Pages');
-$post_status_q = '';
+$query = array('post_type' =&gt; 'page', 'orderby' =&gt; 'menu_order title', 'what_to_show' =&gt; 'posts',
+	'posts_per_page' =&gt; -1, 'posts_per_archive_page' =&gt; -1, 'order' =&gt; 'asc');
+
+$post_status_label = __('Pages');
 if ( isset($_GET['post_status']) &amp;&amp; in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
 	$post_status_label = $post_stati[$_GET['post_status']][1];
-	$post_status_q = '&amp;post_status=' . $_GET['post_status'];
-	$post_status_q .= '&amp;perm=readable';
+	$query['post_status'] = $_GET['post_status'];
+	$query['perm'] = 'readable';
 }
 
-$query_str = &quot;post_type=page&amp;orderby=menu_order title&amp;what_to_show=posts$post_status_q&amp;posts_per_page=-1&amp;posts_per_archive_page=-1&amp;order=asc&quot;;
+$query = apply_filters('manage_pages_query', $query);
+wp($query);
 
-$query_str = apply_filters('manage_pages_query', $query_str);
-wp($query_str);
-
-if ( is_singular() )
+if ( is_singular() ) {
 	wp_enqueue_script( 'admin-comments' );
-require_once('admin-header.php');
+	enqueue_comment_hotkeys_js();
+}
+
+require_once('admin-header.php'); ?&gt;
 
-?&gt;
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
-&lt;h2&gt;&lt;?php
-// Use $_GET instead of is_ since they can override each other
-$h2_search = isset($_GET['s']) &amp;&amp; $_GET['s'] ? ' ' . sprintf(__('matching &amp;#8220;%s&amp;#8221;'), wp_specialchars( stripslashes( $_GET['s'] ) ) ) : '';
-$h2_author = '';
-if ( isset($_GET['author']) &amp;&amp; $_GET['author'] ) {
-	$author_user = get_userdata( (int) $_GET['author'] );
-	$h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user-&gt;display_name ));
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title );
+if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
+	printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', wp_specialchars( get_search_query() ) ); ?&gt;
+&lt;/h2&gt;
+
+&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;
+&lt;?php if ( isset($_GET['updated']) &amp;&amp; (int) $_GET['updated'] ) {
+	printf( __ngettext( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
+	unset($_GET['updated']);
+}
+
+if ( isset($_GET['skipped']) &amp;&amp; (int) $_GET['skipped'] ) {
+	printf( __ngettext( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
+	unset($_GET['skipped']);
+}
+
+if ( isset($_GET['locked']) &amp;&amp; (int) $_GET['locked'] ) {
+	printf( __ngettext( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
+	unset($_GET['locked']);
+}
+
+if ( isset($_GET['deleted']) &amp;&amp; (int) $_GET['deleted'] ) {
+	printf( __ngettext( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
+	unset($_GET['deleted']);
 }
-printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search );
-?&gt;&lt;/h2&gt;
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
+?&gt;
+&lt;/p&gt;&lt;/div&gt;
+&lt;?php } ?&gt;
+
+&lt;?php if ( isset($_GET['posted']) &amp;&amp; $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('Your page has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View page'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;&lt;?php echo get_edit_post_link( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('Edit page'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
+endif; ?&gt;
 
+&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
 &lt;ul class=&quot;subsubsub&quot;&gt;
 &lt;?php
 
 $avail_post_stati = get_available_post_statuses('page');
-
+if ( empty($locked_post_status) ) :
 $status_links = array();
 $num_posts = wp_count_posts('page', 'readable');
+$total_posts = array_sum( (array) $num_posts );
 $class = empty($_GET['post_status']) ? ' class=&quot;current&quot;' : '';
-$status_links[] = &quot;&lt;li&gt;&lt;a href=\&quot;edit-pages.php\&quot;$class&gt;&quot;.__('All Pages').&quot;&lt;/a&gt;&quot;;
+$status_links[] = &quot;&lt;li&gt;&lt;a href='edit-pages.php'$class&gt;&quot; . sprintf( __ngettext( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_posts ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
 foreach ( $post_stati as $status =&gt; $label ) {
 	$class = '';
 
 	if ( !in_array($status, $avail_post_stati) )
 		continue;
 
-	if ( $status == $_GET['post_status'] )
+	if ( isset( $_GET['post_status'] ) &amp;&amp; $status == $_GET['post_status'] )
 		$class = ' class=&quot;current&quot;';
 
-	$status_links[] = &quot;&lt;li&gt;&lt;a href=\&quot;edit-pages.php?post_status=$status\&quot;$class&gt;&quot; .
-	sprintf(__ngettext($label[2][0], $label[2][1], $num_posts-&gt;$status), number_format_i18n( $num_posts-&gt;$status ) ) . '&lt;/a&gt;';
+	$status_links[] = &quot;&lt;li&gt;&lt;a href='edit-pages.php?post_status=$status'$class&gt;&quot; . sprintf( _nc( $label[2][0], $label[2][1], $num_posts-&gt;$status ), number_format_i18n( $num_posts-&gt;$status ) ) . '&lt;/a&gt;';
 }
-echo implode(' |&lt;/li&gt;', $status_links) . '&lt;/li&gt;';
+echo implode( &quot; |&lt;/li&gt;\n&quot;, $status_links ) . '&lt;/li&gt;';
 unset($status_links);
+endif;
 ?&gt;
 &lt;/ul&gt;
 
+&lt;p class=&quot;search-box&quot;&gt;
+	&lt;label class=&quot;hidden&quot; for=&quot;page-search-input&quot;&gt;&lt;?php _e( 'Search Pages' ); ?&gt;:&lt;/label&gt;
+	&lt;input type=&quot;text&quot; class=&quot;search-input&quot; id=&quot;page-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php _admin_search_query(); ?&gt;&quot; /&gt;
+	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Pages' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
+&lt;/p&gt;
+
 &lt;?php if ( isset($_GET['post_status'] ) ) : ?&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;post_status&quot; value=&quot;&lt;?php echo attribute_escape($_GET['post_status']) ?&gt;&quot; /&gt;
-&lt;?php
-endif;
-if ( isset($_GET['posted']) &amp;&amp; $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('Your page has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View page'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;page.php?action=edit&amp;amp;post=&lt;?php echo $_GET['posted']; ?&gt;&quot;&gt;&lt;?php _e('Edit page'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
-endif;
-?&gt;
+&lt;?php endif; ?&gt;
 
-&lt;p id=&quot;post-search&quot;&gt;
-	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e( 'Search Pages' ); ?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php echo attribute_escape(stripslashes($_GET['s'])); ?&gt;&quot; /&gt;
-	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Pages' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
-&lt;/p&gt;
+&lt;?php if ($posts) { ?&gt;
 
 &lt;div class=&quot;tablenav&quot;&gt;
 
 &lt;?php
-$pagenum = absint( $_GET['pagenum'] );
+$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
 if ( empty($pagenum) )
 	$pagenum = 1;
-if( !$per_page || $per_page &lt; 0 )
+if( ! isset( $per_page ) || $per_page &lt; 0 )
 	$per_page = 20;
 
-$num_pages = ceil(count($posts) / $per_page);
+$num_pages = ceil($wp_query-&gt;post_count / $per_page);
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; $num_pages,
 	'current' =&gt; $pagenum
 ));
 
-if ( $page_links )
-	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
-?&gt;
-
-&lt;div class=&quot;alignleft&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Delete'); ?&gt;&quot; name=&quot;deleteit&quot; class=&quot;button-secondary delete&quot; /&gt;
+if ( $page_links ) : ?&gt;
+&lt;div class=&quot;tablenav-pages&quot;&gt;&lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
+	number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
+	number_format_i18n( min( $pagenum * $per_page, $wp_query-&gt;post_count ) ),
+	number_format_i18n( $wp_query-&gt;post_count ),
+	$page_links
+); echo $page_links_text; ?&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action&quot;&gt;
+&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
 &lt;?php wp_nonce_field('bulk-pages'); ?&gt;
 &lt;/div&gt;
 
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 
-&lt;?php
-
-$all = !( $h2_search || $post_status_q );
-
-if ($posts) {
-?&gt;
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;table class=&quot;widefat page fixed&quot; cellspacing=&quot;0&quot;&gt;
   &lt;thead&gt;
   &lt;tr&gt;
-&lt;?php $posts_columns = wp_manage_pages_columns(); ?&gt;
-&lt;?php foreach($posts_columns as $post_column_key =&gt; $column_display_name) {
-	if ( 'cb' === $post_column_key )
-		$class = ' class=&quot;check-column&quot;';
-	elseif ( 'comments' === $post_column_key )
-		$class = ' class=&quot;num&quot;';
-	else
-		$class = '';
-?&gt;
-	&lt;th scope=&quot;col&quot;&lt;?php echo $class; ?&gt;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/th&gt;
-&lt;?php } ?&gt;
+&lt;?php print_column_headers('edit-pages'); ?&gt;
   &lt;/tr&gt;
   &lt;/thead&gt;
+
+  &lt;tfoot&gt;
+  &lt;tr&gt;
+&lt;?php print_column_headers('edit-pages', false); ?&gt;
+  &lt;/tr&gt;
+  &lt;/tfoot&gt;
+
   &lt;tbody&gt;
   &lt;?php page_rows($posts, $pagenum, $per_page); ?&gt;
   &lt;/tbody&gt;
 &lt;/table&gt;
 
-&lt;/form&gt;
-
-&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
-
+&lt;div class=&quot;tablenav&quot;&gt;
 &lt;?php
-} else {
+if ( $page_links )
+	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
 ?&gt;
-&lt;/form&gt;
+
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action2&quot;&gt;
+&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
+&lt;/div&gt;
+
+&lt;br class=&quot;clear&quot; /&gt;
+&lt;/div&gt;
+
+&lt;?php } else { ?&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;p&gt;&lt;?php _e('No pages found.') ?&gt;&lt;/p&gt;
 &lt;?php
 } // end if ($posts)
 ?&gt;
 
-&lt;div class=&quot;tablenav&quot;&gt;
-&lt;?php
-if ( $page_links )
-	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
-?&gt;
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;/div&gt;
+&lt;/form&gt;
+
+&lt;?php inline_edit_row( 'page' ) ?&gt;
+
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
+
 
 &lt;?php
 
@@ -209,24 +287,24 @@ if ( 1 == count($posts) &amp;&amp; is_singular() ) :
 
 &lt;br class=&quot;clear&quot; /&gt;
 
-&lt;table class=&quot;widefat&quot; style=&quot;margin-top: .5em&quot;&gt;
+&lt;table class=&quot;widefat&quot; cellspacing=&quot;0&quot;&gt;
 &lt;thead&gt;
   &lt;tr&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Comment') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Date') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Actions') ?&gt;&lt;/th&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-comment&quot;&gt;&lt;?php echo _c('Comment|noun') ?&gt;&lt;/th&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-author&quot;&gt;&lt;?php _e('Author') ?&gt;&lt;/th&gt;
+    &lt;th scope=&quot;col&quot; class=&quot;column-date&quot;&gt;&lt;?php _e('Submitted') ?&gt;&lt;/th&gt;
   &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;
 &lt;?php
 	foreach ($comments as $comment)
-		_wp_comment_row( $comment-&gt;comment_ID, 'detail', false, false );
+		_wp_comment_row( $comment-&gt;comment_ID, 'single', false, false );
 ?&gt;
 &lt;/tbody&gt;
 &lt;/table&gt;
 
 &lt;?php
-
+wp_comment_reply();
 endif; // comments
 endif; // posts;
 
@@ -234,4 +312,20 @@ endif; // posts;
 
 &lt;/div&gt;
 
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+(function($){
+	$(document).ready(function(){
+		$('#doaction, #doaction2').click(function(){
+			if ( $('select[name^=&quot;action&quot;]').val() == 'delete' ) {
+				var m = '&lt;?php echo js_escape(__(&quot;You are about to delete the selected pages.\n  'Cancel' to stop, 'OK' to delete.&quot;)); ?&gt;';
+				return showNotice.warn(m);
+			}
+		});
+	});
+})(jQuery);
+columns.init('edit-pages');
+/* ]]&gt; */
+&lt;/script&gt;
+
 &lt;?php include('admin-footer.php'); ?&gt;</diff>
      <filename>wp-admin/edit-pages.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,206 +1,27 @@
-&lt;?php if ( ! defined('ABSPATH') ) die(); ?&gt;
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;?php
+/**
+ * Edit posts rows table for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( ! defined('ABSPATH') ) die();
+?&gt;
+&lt;table class=&quot;widefat post fixed&quot; cellspacing=&quot;0&quot;&gt;
 	&lt;thead&gt;
 	&lt;tr&gt;
-
-&lt;?php $posts_columns = wp_manage_posts_columns(); ?&gt;
-&lt;?php foreach($posts_columns as $post_column_key =&gt; $column_display_name) {
-	if ( 'cb' === $post_column_key )
-		$class = ' class=&quot;check-column&quot;';
-	elseif ( 'comments' === $post_column_key )
-		$class = ' class=&quot;num&quot;';
-	else
-		$class = '';
-?&gt;
-	&lt;th scope=&quot;col&quot;&lt;?php echo $class; ?&gt;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/th&gt;
-&lt;?php } ?&gt;
-
+&lt;?php print_column_headers('edit'); ?&gt;
 	&lt;/tr&gt;
 	&lt;/thead&gt;
-	&lt;tbody&gt;
-&lt;?php
-if ( have_posts() ) {
-$bgcolor = '';
-add_filter('the_title','wp_specialchars');
-
-// Create array of post IDs.
-$post_ids = array();
-foreach ( $wp_query-&gt;posts as $a_post )
-	$post_ids[] = $a_post-&gt;ID;
-
-$comment_pending_count = get_pending_comments_num($post_ids);
-
-while (have_posts()) : the_post();
-$class = 'alternate' == $class ? '' : 'alternate';
-global $current_user;
-$post_owner = ( $current_user-&gt;ID == $post-&gt;post_author ? 'self' : 'other' );
-$title = get_the_title();
-if ( empty($title) )
-	$title = __('(no title)');
-?&gt;
-	&lt;tr id='post-&lt;?php echo $id; ?&gt;' class='&lt;?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post-&gt;post_status ); ?&gt;' valign=&quot;top&quot;&gt;
-
-&lt;?php
-
-foreach($posts_columns as $column_name=&gt;$column_display_name) {
-
-	switch($column_name) {
-
-	case 'cb':
-		?&gt;
-		&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can( 'edit_post', $post-&gt;ID ) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;delete[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/th&gt;
-		&lt;?php
-		break;
-	case 'modified':
-	case 'date':
-		if ( '0000-00-00 00:00:00' == $post-&gt;post_date &amp;&amp; 'date' == $column_name ) {
-			$t_time = $h_time = __('Unpublished');
-		} else {
-			if ( 'modified' == $column_name ) {
-				$t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
-				$m_time = $post-&gt;post_modified;
-				$time = get_post_modified_time('G', true);
-			} else {
-				$t_time = get_the_time(__('Y/m/d g:i:s A'));
-				$m_time = $post-&gt;post_date;
-				$time = get_post_time('G', true);
-			}
-			if ( ( abs(time() - $time) ) &lt; 86400 ) {
-				if ( ( 'future' == $post-&gt;post_status) )
-					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
-				else
-					$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
-			} else {
-				$h_time = mysql2date(__('Y/m/d'), $m_time);
-			}
-		}
-		?&gt;
-		&lt;td&gt;&lt;abbr title=&quot;&lt;?php echo $t_time ?&gt;&quot;&gt;&lt;?php echo apply_filters('post_date_column_time', $h_time, $post, $column_name) ?&gt;&lt;/abbr&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-	case 'title':
-		?&gt;
-		&lt;td&gt;&lt;strong&gt;&lt;?php if ( current_user_can( 'edit_post', $post-&gt;ID ) ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;post.php?action=edit&amp;amp;post=&lt;?php the_ID(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $title; } ?&gt;&lt;/strong&gt;
-		&lt;?php if ( !empty($post-&gt;post_password) ) { _e(' &amp;#8212; &lt;strong&gt;Protected&lt;/strong&gt;'); } elseif ('private' == $post-&gt;post_status) { _e(' &amp;#8212; &lt;strong&gt;Private&lt;/strong&gt;'); } ?&gt;&lt;/td&gt;
-		&lt;?php
-		break;
 
-	case 'categories':
-		?&gt;
-		&lt;td&gt;&lt;?php
-		$categories = get_the_category();
-		if ( !empty( $categories ) ) {
-			$out = array();
-			foreach ( $categories as $c )
-				$out[] = &quot;&lt;a href='edit.php?category_name=$c-&gt;slug'&gt; &quot; . wp_specialchars(sanitize_term_field('name', $c-&gt;name, $c-&gt;term_id, 'category', 'display')) . &quot;&lt;/a&gt;&quot;;
-			echo join( ', ', $out );
-		} else {
-			_e('Uncategorized');
-		}
-		?&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'tags':
-		?&gt;
-		&lt;td&gt;&lt;?php
-		$tags = get_the_tags();
-		if ( !empty( $tags ) ) {
-			$out = array();
-			foreach ( $tags as $c )
-				$out[] = &quot;&lt;a href='edit.php?tag=$c-&gt;slug'&gt; &quot; . wp_specialchars(sanitize_term_field('name', $c-&gt;name, $c-&gt;term_id, 'post_tag', 'display')) . &quot;&lt;/a&gt;&quot;;
-			echo join( ', ', $out );
-		} else {
-			_e('No Tags');
-		}
-		?&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'comments':
-		?&gt;
-		&lt;td class=&quot;num&quot;&gt;&lt;div class=&quot;post-com-count-wrapper&quot;&gt;
-		&lt;?php
-		$left = isset($comment_pending_count) ? $comment_pending_count[$post-&gt;ID] : 0;
-		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
-		if ( $left )
-			echo '&lt;strong&gt;';
-		comments_number(&quot;&lt;a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
-		if ( $left )
-			echo '&lt;/strong&gt;';
-		?&gt;
-		&lt;/div&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'author':
-		?&gt;
-		&lt;td&gt;&lt;a href=&quot;edit.php?author=&lt;?php the_author_ID(); ?&gt;&quot;&gt;&lt;?php the_author() ?&gt;&lt;/a&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'status':
-		?&gt;
-		&lt;td&gt;
-		&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('View &quot;%s&quot;'), $title)); ?&gt;&quot; rel=&quot;permalink&quot;&gt;
-		&lt;?php
-		switch ( $post-&gt;post_status ) {
-			case 'publish' :
-			case 'private' :
-				_e('Published');
-				break;
-			case 'future' :
-				_e('Scheduled');
-				break;
-			case 'pending' :
-				_e('Pending Review');
-				break;
-			case 'draft' :
-				_e('Unpublished');
-				break;
-		}
-		?&gt;
-		&lt;/a&gt;
-		&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'control_view':
-		?&gt;
-		&lt;td&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; rel=&quot;permalink&quot; class=&quot;view&quot;&gt;&lt;?php _e('View'); ?&gt;&lt;/a&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'control_edit':
-		?&gt;
-		&lt;td&gt;&lt;?php if ( current_user_can('edit_post',$post-&gt;ID) ) { echo &quot;&lt;a href='post.php?action=edit&amp;amp;post=$id' class='edit'&gt;&quot; . __('Edit') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'control_delete':
-		?&gt;
-		&lt;td&gt;&lt;?php if ( current_user_can('delete_post',$post-&gt;ID) ) { echo &quot;&lt;a href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$id&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' class='delete'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	default:
-		?&gt;
-		&lt;td&gt;&lt;?php do_action('manage_posts_custom_column', $column_name, $id); ?&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-	}
-}
-?&gt;
+	&lt;tfoot&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('edit', false); ?&gt;
 	&lt;/tr&gt;
-&lt;?php
-endwhile;
-} else {
-?&gt;
-  &lt;tr style='background-color: &lt;?php echo $bgcolor; ?&gt;'&gt;
-    &lt;td colspan=&quot;8&quot;&gt;&lt;?php _e('No posts found.') ?&gt;&lt;/td&gt;
-  &lt;/tr&gt;
-&lt;?php
-} // end if ( have_posts() )
-?&gt;
+	&lt;/tfoot&gt;
+
+	&lt;tbody&gt;
+&lt;?php post_rows(); ?&gt;
 	&lt;/tbody&gt;
-&lt;/table&gt;
+&lt;/table&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/edit-post-rows.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,41 +1,40 @@
 &lt;?php
-if ( ! empty($tag_ID) ) {
-	$heading = __('Edit Tag');
-	$submit_text = __('Edit Tag');
-	$form = '&lt;form name=&quot;edittag&quot; id=&quot;edittag&quot; method=&quot;post&quot; action=&quot;edit-tags.php&quot; class=&quot;validate&quot;&gt;';
-	$action = 'editedtag';
-	$nonce_action = 'update-tag_' . $tag_ID;
-	do_action('edit_tag_form_pre', $tag);
-} else {
-	$heading = __('Add Tag');
-	$submit_text = __('Add Tag');
-	$form = '&lt;form name=&quot;addtag&quot; id=&quot;addtag&quot; method=&quot;post&quot; action=&quot;edit-tags.php&quot; class=&quot;add:the-list: validate&quot;&gt;';
-	$action = 'addtag';
-	$nonce_action = 'add-tag';
-	do_action('add_tag_form_pre', $tag);
+/**
+ * Edit tag form for inclusion in administration panels.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( empty($tag_ID) ) { ?&gt;
+	&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('A tag was not selected for editing.'); ?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php
+	return;
 }
-?&gt;
+
+do_action('edit_tag_form_pre', $tag); ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php echo $heading ?&gt;&lt;/h2&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php _e('Edit Tag'); ?&gt;&lt;/h2&gt;
 &lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
-&lt;?php echo $form ?&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;&lt;?php echo $action ?&gt;&quot; /&gt;
+&lt;form name=&quot;edittag&quot; id=&quot;edittag&quot; method=&quot;post&quot; action=&quot;edit-tags.php&quot; class=&quot;validate&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;editedtag&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;tag_ID&quot; value=&quot;&lt;?php echo $tag-&gt;term_id ?&gt;&quot; /&gt;
-&lt;?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?&gt;
+&lt;?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?&gt;
 	&lt;table class=&quot;form-table&quot;&gt;
 		&lt;tr class=&quot;form-field form-required&quot;&gt;
 			&lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;label for=&quot;name&quot;&gt;&lt;?php _e('Tag name') ?&gt;&lt;/label&gt;&lt;/th&gt;
-			&lt;td&gt;&lt;input name=&quot;name&quot; id=&quot;name&quot; type=&quot;text&quot; value=&quot;&lt;?php echo attribute_escape($tag-&gt;name); ?&gt;&quot; size=&quot;40&quot; aria-required=&quot;true&quot; /&gt;
+			&lt;td&gt;&lt;input name=&quot;name&quot; id=&quot;name&quot; type=&quot;text&quot; value=&quot;&lt;?php if ( isset( $tag-&gt;name ) ) echo attribute_escape($tag-&gt;name); ?&gt;&quot; size=&quot;40&quot; aria-required=&quot;true&quot; /&gt;
             &lt;p&gt;&lt;?php _e('The name is how the tag appears on your site.'); ?&gt;&lt;/p&gt;&lt;/td&gt;
 		&lt;/tr&gt;
 		&lt;tr class=&quot;form-field&quot;&gt;
 			&lt;th scope=&quot;row&quot; valign=&quot;top&quot;&gt;&lt;label for=&quot;slug&quot;&gt;&lt;?php _e('Tag slug') ?&gt;&lt;/label&gt;&lt;/th&gt;
-			&lt;td&gt;&lt;input name=&quot;slug&quot; id=&quot;slug&quot; type=&quot;text&quot; value=&quot;&lt;?php echo attribute_escape(apply_filters('editable_slug', $tag-&gt;slug)); ?&gt;&quot; size=&quot;40&quot; /&gt;
+			&lt;td&gt;&lt;input name=&quot;slug&quot; id=&quot;slug&quot; type=&quot;text&quot; value=&quot;&lt;?php if ( isset( $tag-&gt;slug ) ) echo attribute_escape(apply_filters('editable_slug', $tag-&gt;slug)); ?&gt;&quot; size=&quot;40&quot; /&gt;
             &lt;p&gt;&lt;?php _e('The &amp;#8220;slug&amp;#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?&gt;&lt;/p&gt;&lt;/td&gt;
 		&lt;/tr&gt;
 	&lt;/table&gt;
-&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;&lt;?php echo $submit_text ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button-primary&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Update Tag'); ?&gt;&quot; /&gt;&lt;/p&gt;
 &lt;?php do_action('edit_tag_form', $tag); ?&gt;
 &lt;/form&gt;
 &lt;/div&gt;</diff>
      <filename>wp-admin/edit-tag-form.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,19 @@
 &lt;?php
+/**
+ * Edit Tags Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
 require_once('admin.php');
 
 $title = __('Tags');
-$parent_file = 'edit.php';
 
-wp_reset_vars(array('action', 'tag'));
+wp_reset_vars( array('action', 'tag') );
 
-if ( isset($_GET['deleteit']) &amp;&amp; isset($_GET['delete_tags']) )
+if ( isset( $_GET['action'] ) &amp;&amp; isset($_GET['delete_tags']) &amp;&amp; ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) )
 	$action = 'bulk-delete';
 
 switch($action) {
@@ -65,6 +72,7 @@ case 'bulk-delete':
 break;
 
 case 'edit':
+	$title = __('Edit Tag');
 
 	require_once ('admin-header.php');
 	$tag_ID = (int) $_GET['tag_ID'];
@@ -100,13 +108,16 @@ break;
 
 default:
 
-if ( !empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+if ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
+	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
 	 exit;
 }
 
-wp_enqueue_script( 'admin-tags' );
-wp_enqueue_script('admin-forms');
+$can_manage = current_user_can('manage_categories');
+
+wp_enqueue_script('admin-tags');
+if ( $can_manage )
+	wp_enqueue_script('inline-edit-tax');
 
 require_once ('admin-header.php');
 
@@ -115,43 +126,47 @@ $messages[2] = __('Tag deleted.');
 $messages[3] = __('Tag updated.');
 $messages[4] = __('Tag not added.');
 $messages[5] = __('Tag not updated.');
-$messages[6] = __('Tags deleted.');
-?&gt;
+$messages[6] = __('Tags deleted.'); ?&gt;
+
+&lt;div class=&quot;wrap nosubsub&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title );
+if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
+	printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', wp_specialchars( stripslashes($_GET['s']) ) ); ?&gt;
+&lt;/h2&gt;
 
-&lt;?php if (isset($_GET['message'])) : ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$_GET['message']]; ?&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php if ( isset($_GET['message']) &amp;&amp; ( $msg = (int) $_GET['message'] ) ) : ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;?php echo $messages[$msg]; ?&gt;&lt;/p&gt;&lt;/div&gt;
 &lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
 endif; ?&gt;
 
-&lt;div class=&quot;wrap&quot;&gt;
-
-&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
-&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
-	&lt;h2&gt;&lt;?php printf(__('Manage Tags (&lt;a href=&quot;%s&quot;&gt;add new&lt;/a&gt;)'), '#addtag') ?&gt; &lt;/h2&gt;
-&lt;?php else : ?&gt;
-	&lt;h2&gt;&lt;?php _e('Manage Tags') ?&gt; &lt;/h2&gt;
-&lt;?php endif; ?&gt;
-
-&lt;p id=&quot;post-search&quot;&gt;
-	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e( 'Search Tags' ); ?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php echo attribute_escape(stripslashes($_GET['s'])); ?&gt;&quot; /&gt;
+&lt;form class=&quot;search-form&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
+&lt;p class=&quot;search-box&quot;&gt;
+	&lt;label class=&quot;hidden&quot; for=&quot;tag-search-input&quot;&gt;&lt;?php _e( 'Search Tags' ); ?&gt;:&lt;/label&gt;
+	&lt;input type=&quot;text&quot; class=&quot;search-input&quot; id=&quot;tag-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php _admin_search_query(); ?&gt;&quot; /&gt;
 	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Tags' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
 &lt;/p&gt;
-
+&lt;/form&gt;
 &lt;br class=&quot;clear&quot; /&gt;
 
-&lt;div class=&quot;tablenav&quot;&gt;
+&lt;div id=&quot;col-container&quot;&gt;
 
+&lt;div id=&quot;col-right&quot;&gt;
+&lt;div class=&quot;col-wrap&quot;&gt;
+&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
+&lt;div class=&quot;tablenav&quot;&gt;
 &lt;?php
-$pagenum = absint( $_GET['pagenum'] );
+$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
 if ( empty($pagenum) )
 	$pagenum = 1;
-if( !$tagsperpage || $tagsperpage &lt; 0 )
-	$tagsperpage = 20;
+
+$tagsperpage = apply_filters(&quot;tagsperpage&quot;,20);
 
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; ceil(wp_count_terms('post_tag') / $tagsperpage),
 	'current' =&gt; $pagenum
 ));
@@ -160,53 +175,127 @@ if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
 
-&lt;div class=&quot;alignleft&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Delete'); ?&gt;&quot; name=&quot;deleteit&quot; class=&quot;button-secondary delete&quot; /&gt;
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action&quot;&gt;
+&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
 &lt;?php wp_nonce_field('bulk-tags'); ?&gt;
 &lt;/div&gt;
 
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;table class=&quot;widefat tag fixed&quot; cellspacing=&quot;0&quot;&gt;
 	&lt;thead&gt;
 	&lt;tr&gt;
-	&lt;th scope=&quot;col&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/th&gt;
-        &lt;th scope=&quot;col&quot; class=&quot;num&quot; style=&quot;width: 90px&quot;&gt;&lt;?php _e('Posts') ?&gt;&lt;/th&gt;
+&lt;?php print_column_headers('edit-tags'); ?&gt;
 	&lt;/tr&gt;
 	&lt;/thead&gt;
+
+	&lt;tfoot&gt;
+	&lt;tr&gt;
+&lt;?php print_column_headers('edit-tags', false); ?&gt;
+	&lt;/tr&gt;
+	&lt;/tfoot&gt;
+
 	&lt;tbody id=&quot;the-list&quot; class=&quot;list:tag&quot;&gt;
 &lt;?php
 
-$searchterms = trim( $_GET['s'] );
+$searchterms = isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '';
 
 $count = tag_rows( $pagenum, $tagsperpage, $searchterms );
 ?&gt;
 	&lt;/tbody&gt;
 &lt;/table&gt;
-&lt;/form&gt;
 
 &lt;div class=&quot;tablenav&quot;&gt;
-
 &lt;?php
 if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
+
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action2&quot;&gt;
+&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
+&lt;/div&gt;
+
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
+
 &lt;br class=&quot;clear&quot; /&gt;
+&lt;/form&gt;
+&lt;/div&gt;
+&lt;/div&gt;&lt;!-- /col-right --&gt;
+
+&lt;div id=&quot;col-left&quot;&gt;
+&lt;div class=&quot;col-wrap&quot;&gt;
 
+&lt;div class=&quot;tagcloud&quot;&gt;
+&lt;h3&gt;&lt;?php _e('Popular Tags'); ?&gt;&lt;/h3&gt;
+&lt;?php
+if ( $can_manage )
+	wp_tag_cloud(array('link' =&gt; 'edit'));
+else
+	wp_tag_cloud();
+?&gt;
+&lt;/div&gt;
+
+&lt;?php if ( $can_manage ) {
+	do_action('add_tag_form_pre'); ?&gt;
+
+&lt;div class=&quot;form-wrap&quot;&gt;
+&lt;h3&gt;&lt;?php _e('Add a New Tag'); ?&gt;&lt;/h3&gt;
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
+&lt;form name=&quot;addtag&quot; id=&quot;addtag&quot; method=&quot;post&quot; action=&quot;edit-tags.php&quot; class=&quot;add:the-list: validate&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;addtag&quot; /&gt;
+&lt;?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?&gt;
+
+&lt;div class=&quot;form-field form-required&quot;&gt;
+	&lt;label for=&quot;name&quot;&gt;&lt;?php _e('Tag name') ?&gt;&lt;/label&gt;
+	&lt;input name=&quot;name&quot; id=&quot;name&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;40&quot; aria-required=&quot;true&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('The name is how the tag appears on your site.'); ?&gt;&lt;/p&gt;
 &lt;/div&gt;
 
-&lt;?php if ( current_user_can('manage_categories') ) : ?&gt;
+&lt;div class=&quot;form-field&quot;&gt;
+	&lt;label for=&quot;slug&quot;&gt;&lt;?php _e('Tag slug') ?&gt;&lt;/label&gt;
+	&lt;input name=&quot;slug&quot; id=&quot;slug&quot; type=&quot;text&quot; value=&quot;&quot; size=&quot;40&quot; /&gt;
+    &lt;p&gt;&lt;?php _e('The &amp;#8220;slug&amp;#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?&gt;&lt;/p&gt;
+&lt;/div&gt;
 
-&lt;br /&gt;
-&lt;?php include('edit-tag-form.php'); ?&gt;
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Add Tag'); ?&gt;&quot; /&gt;&lt;/p&gt;
+&lt;?php do_action('add_tag_form'); ?&gt;
+&lt;/form&gt;&lt;/div&gt;
+&lt;?php } ?&gt;
 
-&lt;?php endif; ?&gt;
+&lt;/div&gt;
+&lt;/div&gt;&lt;!-- /col-left --&gt;
+
+&lt;/div&gt;&lt;!-- /col-container --&gt;
+&lt;/div&gt;&lt;!-- /wrap --&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+(function($){
+	$(document).ready(function(){
+		$('#doaction, #doaction2').click(function(){
+			if ( $('select[name^=&quot;action&quot;]').val() == 'delete' ) {
+				var m = '&lt;?php echo js_escape(__(&quot;You are about to delete the selected tags.\n  'Cancel' to stop, 'OK' to delete.&quot;)); ?&gt;';
+				return showNotice.warn(m);
+			}
+		});
+	});
+})(jQuery);
+/* ]]&gt; */
+&lt;/script&gt;
+
+&lt;?php inline_edit_term_row('edit-tags'); ?&gt;
 
 &lt;?php
 break;</diff>
      <filename>wp-admin/edit-tags.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,90 +1,149 @@
 &lt;?php
+/**
+ * Edit Posts Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
 require_once('admin.php');
 
-// Handle bulk deletes
-if ( isset($_GET['deleteit']) &amp;&amp; isset($_GET['delete']) ) {
-	check_admin_referer('bulk-posts');
-	foreach( (array) $_GET['delete'] as $post_id_del ) {
-		$post_del = &amp; get_post($post_id_del);
-
-		if ( !current_user_can('delete_post', $post_id_del) )
-			wp_die( __('You are not allowed to delete this post.') );
-
-		if ( $post_del-&gt;post_type == 'attachment' ) {
-			if ( ! wp_delete_attachment($post_id_del) )
-				wp_die( __('Error in deleting...') );
-		} else {
-			if ( !wp_delete_post($post_id_del) )
-				wp_die( __('Error in deleting...') );
-		}
+// Back-compat for viewing comments of an entry
+if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) {
+	wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
+	exit;
+} else {
+	unset( $_redirect );
+}
+
+// Handle bulk actions
+if ( isset($_GET['action']) &amp;&amp; ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
+	$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
+
+	switch ( $doaction ) {
+		case 'delete':
+			if ( isset($_GET['post']) &amp;&amp; ! isset($_GET['bulk_edit']) &amp;&amp; (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
+				check_admin_referer('bulk-posts');
+				$deleted = 0;
+				foreach( (array) $_GET['post'] as $post_id_del ) {
+					$post_del = &amp; get_post($post_id_del);
+
+					if ( !current_user_can('delete_post', $post_id_del) )
+						wp_die( __('You are not allowed to delete this post.') );
+
+					if ( $post_del-&gt;post_type == 'attachment' ) {
+						if ( ! wp_delete_attachment($post_id_del) )
+							wp_die( __('Error in deleting...') );
+					} else {
+						if ( !wp_delete_post($post_id_del) )
+							wp_die( __('Error in deleting...') );
+					}
+					$deleted++;
+				}
+			}
+			break;
+		case 'edit':
+			if ( isset($_GET['post']) &amp;&amp; isset($_GET['bulk_edit']) ) {
+				check_admin_referer('bulk-posts');
+
+				if ( -1 == $_GET['_status'] ) {
+					$_GET['post_status'] = null;
+					unset($_GET['_status'], $_GET['post_status']);
+				} else {
+					$_GET['post_status'] = $_GET['_status'];
+				}
+
+				$done = bulk_edit_posts($_GET);
+			}
+			break;
 	}
 
 	$sendback = wp_get_referer();
-	if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php');
-	elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
-	$sendback = preg_replace('|[^a-z0-9-~+_.?#=&amp;;,/:]|i', '', $sendback);
-
+	if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php');
+	elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php');
+	if ( isset($done) ) {
+		$done['updated'] = count( $done['updated'] );
+		$done['skipped'] = count( $done['skipped'] );
+		$done['locked'] = count( $done['locked'] );
+		$sendback = add_query_arg( $done, $sendback );
+	}
+	if ( isset($deleted) )
+		$sendback = add_query_arg('deleted', $deleted, $sendback);
 	wp_redirect($sendback);
 	exit();
-} elseif ( !empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+} elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
+	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
 	 exit;
 }
 
-$title = __('Posts');
+if ( empty($title) )
+	$title = __('Edit Posts');
 $parent_file = 'edit.php';
-wp_enqueue_script('admin-forms');
+wp_enqueue_script('inline-edit-post');
 
 list($post_stati, $avail_post_stati) = wp_edit_posts_query();
 
-if ( 1 == count($posts) &amp;&amp; is_singular() )
-	wp_enqueue_script( 'admin-comments' );
 require_once('admin-header.php');
 
 if ( !isset( $_GET['paged'] ) )
 	$_GET['paged'] = 1;
 
-?&gt;
+if ( empty($_GET['mode']) )
+	$mode = 'list';
+else
+	$mode = attribute_escape($_GET['mode']); ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title );
+if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
+	printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', wp_specialchars( get_search_query() ) ); ?&gt;
+&lt;/h2&gt;
 
-&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
-&lt;h2&gt;&lt;?php
-if ( is_single() ) {
-	printf(__('Comments on %s'), apply_filters( &quot;the_title&quot;, $post-&gt;post_title));
-} else {
-	$post_status_label = _c('Manage Posts|manage posts header');
-	if ( isset($_GET['post_status']) &amp;&amp; in_array( $_GET['post_status'], array_keys($post_stati) ) )
-        $post_status_label = $post_stati[$_GET['post_status']][1];
-	if ( $post_listing_pageable &amp;&amp; !is_archive() &amp;&amp; !is_search() )
-		$h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);
-	else
-		$h2_noun = $post_status_label;
-	// Use $_GET instead of is_ since they can override each other
-	$h2_author = '';
-	$_GET['author'] = (int) $_GET['author'];
-	if ( $_GET['author'] != 0 ) {
-		if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion
-			$h2_author = ' ' . __('by other authors');
-		} else {
-			$author_user = get_userdata( get_query_var( 'author' ) );
-			$h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user-&gt;display_name ));
-		}
-	}
-	$h2_search = isset($_GET['s'])   &amp;&amp; $_GET['s']   ? ' ' . sprintf(__('matching &amp;#8220;%s&amp;#8221;'), wp_specialchars( get_search_query() ) ) : '';
-	$h2_cat    = isset($_GET['cat']) &amp;&amp; $_GET['cat'] ? ' ' . sprintf( __('in &amp;#8220;%s&amp;#8221;'), single_cat_title('', false) ) : '';
-	$h2_tag    = isset($_GET['tag']) &amp;&amp; $_GET['tag'] ? ' ' . sprintf( __('tagged with &amp;#8220;%s&amp;#8221;'), single_tag_title('', false) ) : '';
-	$h2_month  = isset($_GET['m'])   &amp;&amp; $_GET['m']   ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : '';
-	printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month );
+&lt;?php
+if ( isset($_GET['posted']) &amp;&amp; $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('Your post has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View post'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;&lt;?php echo get_edit_post_link( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('Edit post'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
+endif; ?&gt;
+
+&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?&gt;
+&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;
+&lt;?php if ( isset($_GET['updated']) &amp;&amp; (int) $_GET['updated'] ) {
+	printf( __ngettext( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
+	unset($_GET['updated']);
+}
+
+if ( isset($_GET['skipped']) &amp;&amp; (int) $_GET['skipped'] )
+	unset($_GET['skipped']);
+
+if ( isset($_GET['locked']) &amp;&amp; (int) $_GET['locked'] ) {
+	printf( __ngettext( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
+	unset($_GET['locked']);
+}
+
+if ( isset($_GET['deleted']) &amp;&amp; (int) $_GET['deleted'] ) {
+	printf( __ngettext( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
+	unset($_GET['deleted']);
 }
-?&gt;&lt;/h2&gt;
+
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
+?&gt;
+&lt;/p&gt;&lt;/div&gt;
+&lt;?php } ?&gt;
+
+&lt;form id=&quot;posts-filter&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
 
 &lt;ul class=&quot;subsubsub&quot;&gt;
 &lt;?php
+if ( empty($locked_post_status) ) :
 $status_links = array();
 $num_posts = wp_count_posts( 'post', 'readable' );
+$total_posts = array_sum( (array) $num_posts );
 $class = empty( $_GET['post_status'] ) ? ' class=&quot;current&quot;' : '';
-$status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php' $class&gt;&quot; . __('All Posts') . '&lt;/a&gt;';
+$status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php' $class&gt;&quot; . sprintf( __ngettext( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_posts ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
+
+
 foreach ( $post_stati as $status =&gt; $label ) {
 	$class = '';
 
@@ -93,52 +152,53 @@ foreach ( $post_stati as $status =&gt; $label ) {
 
 	if ( empty( $num_posts-&gt;$status ) )
 		continue;
-	if ( $status == $_GET['post_status'] )
+	if ( isset($_GET['post_status']) &amp;&amp; $status == $_GET['post_status'] )
 		$class = ' class=&quot;current&quot;';
 
-	$status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php?post_status=$status' $class&gt;&quot; .
-	sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts-&gt;$status ), number_format_i18n( $num_posts-&gt;$status ) ) . '&lt;/a&gt;';
+	$status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php?post_status=$status' $class&gt;&quot; . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts-&gt;$status ), number_format_i18n( $num_posts-&gt;$status ) ) . '&lt;/a&gt;';
 }
-echo implode( ' |&lt;/li&gt;', $status_links ) . '&lt;/li&gt;';
+echo implode( &quot; |&lt;/li&gt;\n&quot;, $status_links ) . '&lt;/li&gt;';
 unset( $status_links );
-?&gt;
-&lt;/ul&gt;
-
-&lt;?php if ( isset($_GET['post_status'] ) ) : ?&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;post_status&quot; value=&quot;&lt;?php echo attribute_escape($_GET['post_status']) ?&gt;&quot; /&gt;
-&lt;?php
-endif;
-
-if ( isset($_GET['posted']) &amp;&amp; $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('Your post has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View post'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;post.php?action=edit&amp;amp;post=&lt;?php echo $_GET['posted']; ?&gt;&quot;&gt;&lt;?php _e('Edit post'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
 endif;
 ?&gt;
+&lt;/ul&gt;
 
-&lt;p id=&quot;post-search&quot;&gt;
+&lt;p class=&quot;search-box&quot;&gt;
 	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e( 'Search Posts' ); ?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; /&gt;
+	&lt;input type=&quot;text&quot; class=&quot;search-input&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; /&gt;
 	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Search Posts' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
 &lt;/p&gt;
 
-&lt;div class=&quot;tablenav&quot;&gt;
+&lt;?php if ( isset($_GET['post_status'] ) ) : ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;post_status&quot; value=&quot;&lt;?php echo attribute_escape($_GET['post_status']) ?&gt;&quot; /&gt;
+&lt;?php endif; ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo $mode; ?&gt;&quot; /&gt;
 
+&lt;?php if ( have_posts() ) { ?&gt;
+
+&lt;div class=&quot;tablenav&quot;&gt;
 &lt;?php
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'paged', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; $wp_query-&gt;max_num_pages,
 	'current' =&gt; $_GET['paged']
 ));
 
-if ( $page_links )
-	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
 
-&lt;div class=&quot;alignleft&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Delete'); ?&gt;&quot; name=&quot;deleteit&quot; class=&quot;button-secondary delete&quot; /&gt;
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action&quot;&gt;
+&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
 &lt;?php wp_nonce_field('bulk-posts'); ?&gt;
-&lt;?php
+
+&lt;?php // view filters
 if ( !is_singular() ) {
 $arc_query = &quot;SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb-&gt;posts WHERE post_type = 'post' ORDER BY post_date DESC&quot;;
 
@@ -146,16 +206,18 @@ $arc_result = $wpdb-&gt;get_results( $arc_query );
 
 $month_count = count($arc_result);
 
-if ( $month_count &amp;&amp; !( 1 == $month_count &amp;&amp; 0 == $arc_result[0]-&gt;mmonth ) ) { ?&gt;
+if ( $month_count &amp;&amp; !( 1 == $month_count &amp;&amp; 0 == $arc_result[0]-&gt;mmonth ) ) {
+$m = isset($_GET['m']) ? (int)$_GET['m'] : 0;
+?&gt;
 &lt;select name='m'&gt;
-&lt;option&lt;?php selected( @$_GET['m'], 0 ); ?&gt; value='0'&gt;&lt;?php _e('Show all dates'); ?&gt;&lt;/option&gt;
+&lt;option&lt;?php selected( $m, 0 ); ?&gt; value='0'&gt;&lt;?php _e('Show all dates'); ?&gt;&lt;/option&gt;
 &lt;?php
 foreach ($arc_result as $arc_row) {
 	if ( $arc_row-&gt;yyear == 0 )
 		continue;
 	$arc_row-&gt;mmonth = zeroise( $arc_row-&gt;mmonth, 2 );
 
-	if ( $arc_row-&gt;yyear . $arc_row-&gt;mmonth == $_GET['m'] )
+	if ( $arc_row-&gt;yyear . $arc_row-&gt;mmonth == $m )
 		$default = ' selected=&quot;selected&quot;';
 	else
 		$default = '';
@@ -179,66 +241,75 @@ do_action('restrict_manage_posts');
 &lt;?php } ?&gt;
 &lt;/div&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;/div&gt;
+&lt;?php if ( $page_links ) { ?&gt;
+&lt;div class=&quot;tablenav-pages&quot;&gt;&lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
+	number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query-&gt;query_vars['posts_per_page'] + 1 ),
+	number_format_i18n( min( $_GET['paged'] * $wp_query-&gt;query_vars['posts_per_page'], $wp_query-&gt;found_posts ) ),
+	number_format_i18n( $wp_query-&gt;found_posts ),
+	$page_links
+); echo $page_links_text; ?&gt;&lt;/div&gt;
+&lt;?php } ?&gt;
 
-&lt;br class=&quot;clear&quot; /&gt;
+&lt;div class=&quot;view-switch&quot;&gt;
+	&lt;a href=&quot;&lt;?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'list' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-list&quot; src=&quot;../wp-includes/images/blank.gif&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e('List View') ?&gt;&quot; alt=&quot;&lt;?php _e('List View') ?&gt;&quot; /&gt;&lt;/a&gt;
+	&lt;a href=&quot;&lt;?php echo clean_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'excerpt' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-excerpt&quot; src=&quot;../wp-includes/images/blank.gif&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e('Excerpt View') ?&gt;&quot; alt=&quot;&lt;?php _e('Excerpt View') ?&gt;&quot; /&gt;&lt;/a&gt;
+&lt;/div&gt;
 
-&lt;?php include( 'edit-post-rows.php' ); ?&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
 
-&lt;/form&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 
-&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
+&lt;?php include( 'edit-post-rows.php' ); ?&gt;
 
 &lt;div class=&quot;tablenav&quot;&gt;
 
 &lt;?php
 if ( $page_links )
-	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
+	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
 ?&gt;
 
+&lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;select name=&quot;action2&quot;&gt;
+&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
+&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete'); ?&gt;&lt;/option&gt;
+&lt;/select&gt;
+&lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
 &lt;br class=&quot;clear&quot; /&gt;
 &lt;/div&gt;
-
 &lt;br class=&quot;clear&quot; /&gt;
+&lt;/div&gt;
 
-&lt;?php
-
-if ( 1 == count($posts) &amp;&amp; is_singular() ) :
-
-	$comments = $wpdb-&gt;get_results( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date&quot;, $id) );
-	if ( $comments ) :
-		// Make sure comments, post, and post_author are cached
-		update_comment_cache($comments);
-		$post = get_post($id);
-		$authordata = get_userdata($post-&gt;post_author);
-	?&gt;
-
-&lt;br class=&quot;clear&quot; /&gt;
+&lt;?php } else { // have_posts() ?&gt;
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;p&gt;&lt;?php _e('No posts found') ?&gt;&lt;/p&gt;
+&lt;?php } ?&gt;
 
-&lt;table class=&quot;widefat&quot; style=&quot;margin-top: .5em&quot;&gt;
-&lt;thead&gt;
-  &lt;tr&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Comment') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Date') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot;&gt;&lt;?php _e('Actions') ?&gt;&lt;/th&gt;
-  &lt;/tr&gt;
-&lt;/thead&gt;
-&lt;tbody id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;
-&lt;?php
-	foreach ($comments as $comment)
-		_wp_comment_row( $comment-&gt;comment_ID, 'detail', false, false );
-?&gt;
-&lt;/tbody&gt;
-&lt;/table&gt;
+&lt;/form&gt;
 
-&lt;?php
+&lt;?php inline_edit_row( 'post' ); ?&gt;
 
-endif; // comments
-endif; // posts;
+&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
 
-?&gt;
+&lt;br class=&quot;clear&quot; /&gt;
 
 &lt;/div&gt;
 
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+(function($){
+	$(document).ready(function(){
+		$('#doaction, #doaction2').click(function(){
+			if ( $('select[name^=&quot;action&quot;]').val() == 'delete' ) {
+				var m = '&lt;?php echo js_escape(__(&quot;You are about to delete the selected posts.\n  'Cancel' to stop, 'OK' to delete.&quot;)); ?&gt;';
+				return showNotice.warn(m);
+			}
+		});
+	});
+})(jQuery);
+columns.init('edit');
+/* ]]&gt; */
+&lt;/script&gt;
+
 &lt;?php include('admin-footer.php'); ?&gt;</diff>
      <filename>wp-admin/edit.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,21 @@
 &lt;?php
+/**
+ * WordPress Export Administration Panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
 require_once ('admin.php');
+
+/** Load WordPress export API */
 require_once('includes/export.php');
 $title = __('Export');
-$parent_file = 'edit.php';
 
 if ( isset( $_GET['download'] ) ) {
-	export_wp( $_GET['author'] );
+	$author = isset($_GET['author']) ? $_GET['author'] : 'all';
+	export_wp( $author );
 	die();
 }
 
@@ -13,7 +23,9 @@ require_once ('admin-header.php');
 ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php _e('Export'); ?&gt;&lt;/h2&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
+
 &lt;p&gt;&lt;?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?&gt;&lt;/p&gt;
 &lt;p&gt;&lt;?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?&gt;&lt;/p&gt;
 &lt;p&gt;&lt;?php _e('Once you&amp;#8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?&gt;&lt;/p&gt;
@@ -37,7 +49,7 @@ foreach ( $authors as $id ) {
 &lt;/td&gt;
 &lt;/tr&gt;
 &lt;/table&gt;
-&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Download Export File'); ?&gt;&quot; /&gt;
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php _e('Download Export File'); ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;download&quot; value=&quot;true&quot; /&gt;
 &lt;/p&gt;
 &lt;/form&gt;</diff>
      <filename>wp-admin/export.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,83 @@
 &lt;?php
+/**
+ * Defines the Gears manifest file for Google Gears offline storage.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/** Set ABSPATH for execution */
 define( 'ABSPATH', dirname(dirname(__FILE__)) );
 define( 'WPINC', '/wp-includes' );
 
+/**
+ * @ignore
+ */
 function __() {}
+
+/**
+ * @ignore
+ */
+function _c() {}
+
+/**
+ * @ignore
+ */
 function add_filter() {}
+
+/**
+ * @ignore
+ */
 function attribute_escape() {}
+
+/**
+ * @ignore
+ */
 function apply_filters() {}
+
+/**
+ * @ignore
+ */
 function get_option() {}
+
+/**
+ * @ignore
+ */
 function is_lighttpd_before_150() {}
+
+/**
+ * @ignore
+ */
 function add_action() {}
+
+/**
+ * @ignore
+ */
 function do_action_ref_array() {}
+
+/**
+ * @ignore
+ */
 function get_bloginfo() {}
+
+/**
+ * @ignore
+ */
 function is_admin() {return true;}
+
+/**
+ * @ignore
+ */
 function site_url() {}
+
+/**
+ * @ignore
+ */
 function admin_url() {}
+
+/**
+ * @ignore
+ */
 function wp_guess_url() {}
 
 require(ABSPATH . '/wp-includes/script-loader.php');
@@ -28,8 +91,9 @@ wp_default_styles($wp_styles);
 
 $defaults = $man_version = '';
 foreach ( $wp_scripts-&gt;registered as $script ) {
-	if ( empty($script-&gt;src) || strpos($script-&gt;src, 'tiny_mce_config.php') ) continue;
+	if ( empty($script-&gt;src) ) continue;
 	$ver = empty($script-&gt;ver) ? $wp_version : $script-&gt;ver;
+	if ( 'editor' == $script-&gt;handle ) $mce_ver = $script-&gt;ver;
 	$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script-&gt;src );
 	$defaults .= '{ &quot;url&quot; : &quot;' . $src . '?ver=' . $ver . '&quot; },' . &quot;\n&quot;;
 	$man_version .= $ver;
@@ -46,7 +110,7 @@ foreach ( $wp_styles-&gt;registered as $style ) {
 	if ( isset($style-&gt;extra['rtl']) &amp;&amp; $style-&gt;extra['rtl'] ) {
 		if ( is_bool( $style-&gt;extra['rtl'] ) )
 			$rtl_href = str_replace( '.css', '-rtl.css', $src );
-		else 
+		else
 			$rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style-&gt;extra['rtl'] );
 
 		$defaults .= '{ &quot;url&quot; : &quot;' . $rtl_href . '?ver=' . $ver . '&quot; },' . &quot;\n&quot;;
@@ -64,7 +128,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
 ?&gt;
 {
 &quot;betaManifestVersion&quot; : 1,
-&quot;version&quot; : &quot;&lt;?php echo $man_version; ?&gt;_20080810&quot;,
+&quot;version&quot; : &quot;&lt;?php echo $man_version; ?&gt;_20081201&quot;,
 &quot;entries&quot; : [
 &lt;?php echo $defaults; ?&gt;
 
@@ -72,85 +136,126 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
 { &quot;url&quot; : &quot;images/align-left.png&quot; },
 { &quot;url&quot; : &quot;images/align-none.png&quot; },
 { &quot;url&quot; : &quot;images/align-right.png&quot; },
+{ &quot;url&quot; : &quot;images/archive-link.png&quot; },
+{ &quot;url&quot; : &quot;images/blue-grad.png&quot; },
 { &quot;url&quot; : &quot;images/browse-happy.gif&quot; },
 { &quot;url&quot; : &quot;images/bubble_bg.gif&quot; },
+{ &quot;url&quot; : &quot;images/bubble_bg-rtl.gif&quot; },
+{ &quot;url&quot; : &quot;images/button-grad.png&quot; },
+{ &quot;url&quot; : &quot;images/button-grad-active.png&quot; },
 { &quot;url&quot; : &quot;images/comment-grey-bubble.png&quot; },
-{ &quot;url&quot; : &quot;images/comment-pill.gif&quot; },
-{ &quot;url&quot; : &quot;images/comment-stalk-classic.gif&quot; },
-{ &quot;url&quot; : &quot;images/comment-stalk-fresh.gif&quot; },
-{ &quot;url&quot; : &quot;images/comment-stalk-rtl.gif&quot; },
 { &quot;url&quot; : &quot;images/date-button.gif&quot; },
+{ &quot;url&quot; : &quot;images/ed-bg.gif&quot; },
 { &quot;url&quot; : &quot;images/fade-butt.png&quot; },
-{ &quot;url&quot; : &quot;images/gear.png&quot; },
+{ &quot;url&quot; : &quot;images/fav.png&quot; },
+{ &quot;url&quot; : &quot;images/fav-arrow.gif&quot; },
+{ &quot;url&quot; : &quot;images/fav-arrow-rtl.gif&quot; },
+{ &quot;url&quot; : &quot;images/fav-top.png&quot; },
+{ &quot;url&quot; : &quot;images/generic.png&quot; },
+{ &quot;url&quot; : &quot;images/gray-grad.png&quot; },
+{ &quot;url&quot; : &quot;images/icons32.png&quot; },
+{ &quot;url&quot; : &quot;images/icons32-vs.png&quot; },
+{ &quot;url&quot; : &quot;images/list.png&quot; },
+{ &quot;url&quot; : &quot;images/list-vs.png&quot; },
+{ &quot;url&quot; : &quot;images/loading.gif&quot; },
+{ &quot;url&quot; : &quot;images/loading-publish.gif&quot; },
+{ &quot;url&quot; : &quot;images/logo.gif&quot; },
 { &quot;url&quot; : &quot;images/logo-ghost.png&quot; },
 { &quot;url&quot; : &quot;images/logo-login.gif&quot; },
-{ &quot;url&quot; : &quot;images/logo.gif&quot; },
-{ &quot;url&quot; : &quot;images/media-button-gallery.gif&quot; },
 { &quot;url&quot; : &quot;images/media-button-image.gif&quot; },
 { &quot;url&quot; : &quot;images/media-button-music.gif&quot; },
 { &quot;url&quot; : &quot;images/media-button-other.gif&quot; },
 { &quot;url&quot; : &quot;images/media-button-video.gif&quot; },
-{ &quot;url&quot; : &quot;images/media-buttons.gif&quot; },
-{ &quot;url&quot; : &quot;images/tab.png&quot; },
-{ &quot;url&quot; : &quot;images/tail.gif&quot; },
-{ &quot;url&quot; : &quot;images/toggle-arrow-rtl.gif&quot; },
+{ &quot;url&quot; : &quot;images/menu.png&quot; },
+{ &quot;url&quot; : &quot;images/menu-vs.png&quot; },
+{ &quot;url&quot; : &quot;images/menu-arrows.gif&quot; },
+{ &quot;url&quot; : &quot;images/menu-bits.gif&quot; },
+{ &quot;url&quot; : &quot;images/menu-bits-rtl.gif&quot; },
+{ &quot;url&quot; : &quot;images/menu-dark.gif&quot; },
+{ &quot;url&quot; : &quot;images/menu-dark-rtl.gif&quot; },
+{ &quot;url&quot; : &quot;images/no.png&quot; },
+{ &quot;url&quot; : &quot;images/required.gif&quot; },
+{ &quot;url&quot; : &quot;images/resize.gif&quot; },
+{ &quot;url&quot; : &quot;images/screen-options-left.gif&quot; },
+{ &quot;url&quot; : &quot;images/screen-options-right.gif&quot; },
+{ &quot;url&quot; : &quot;images/screen-options-right-up.gif&quot; },
+{ &quot;url&quot; : &quot;images/se.png&quot; },
+{ &quot;url&quot; : &quot;images/star.gif&quot; },
 { &quot;url&quot; : &quot;images/toggle-arrow.gif&quot; },
+{ &quot;url&quot; : &quot;images/toggle-arrow-rtl.gif&quot; },
+{ &quot;url&quot; : &quot;images/white-grad.png&quot; },
+{ &quot;url&quot; : &quot;images/white-grad-active.png&quot; },
 { &quot;url&quot; : &quot;images/wordpress-logo.png&quot; },
+{ &quot;url&quot; : &quot;images/wp-logo.gif&quot; },
 { &quot;url&quot; : &quot;images/xit.gif&quot; },
-{ &quot;url&quot; : &quot;images/loading-publish.gif&quot; },
-{ &quot;url&quot; : &quot;images/loading.gif&quot; },
-{ &quot;url&quot; : &quot;images/required.gif&quot; },
-{ &quot;url&quot; : &quot;images/no.png&quot; },
 { &quot;url&quot; : &quot;images/yes.png&quot; },
 
-&lt;?php if ( is_file(ABSPATH.'/wp-includes/js/tinymce/tiny_mce.js') ) { ?&gt;
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/mctabs.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/validate.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/form_utils.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/editable_selects.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311g&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/tiny_mce.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311&quot; },
-
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/media.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311g&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/wp-mce-help.php?ver=311&quot; },
-
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311g&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/wordpress.css?ver=311&quot; },
+&lt;?php if ( is_file('../wp-includes/js/tinymce/tiny_mce.js') ) { ?&gt;
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/tiny_mce.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/tiny_mce.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/langs/wp-langs-en.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/langs/wp-langs-en.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/wordpress.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/wordpress.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/mctabs.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/utils/mctabs.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/validate.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/utils/validate.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/form_utils.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/utils/form_utils.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/utils/editable_selects.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/utils/editable_selects.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/tiny_mce_popup.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/tiny_mce_popup.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/editor_template.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/source_editor.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/anchor.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/image.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/image.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/link.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/link.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/color_picker.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/charmap.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/color_picker.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/charmap.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/image.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/link.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/source_editor.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/anchor.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/autosave/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/autosave/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/template.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/media/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/js/media.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/media/js/media.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/media.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/media/media.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/css/content.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/media/css/content.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/css/media.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/media/css/media.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/js/pasteword.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/js/pastetext.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/pasteword.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/blank.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/pastetext.htm&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/css/pasteword.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/css/blank.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/safari/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/safari/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/spellchecker/css/content.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/css/content.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
+
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js&quot;, &quot;src&quot; : &quot;../wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js?ver=&lt;?php echo $mce_ver; ?&gt;&quot;, &quot;ignoreQuery&quot; : true },
 
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/img/icons.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg&quot; },
@@ -179,18 +284,22 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/img/shockwave.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/media/img/trans.gif&quot; },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/spellchecker/img/wline.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/more.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/page.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/help.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/image.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/media.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/video.gif&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif&quot; },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png&quot; },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png&quot; },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpgallery/img/delete.png&quot; },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpgallery/img/edit.png&quot; },
+{ &quot;url&quot; : &quot;../wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png&quot; },
 &lt;?php } ?&gt;
 
 { &quot;url&quot; : &quot;../wp-includes/images/crystal/archive.png&quot; },
@@ -204,6 +313,5 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
 { &quot;url&quot; : &quot;../wp-includes/images/crystal/spreadsheet.png&quot; },
 { &quot;url&quot; : &quot;../wp-includes/images/rss.png&quot; },
 { &quot;url&quot; : &quot;../wp-includes/js/thickbox/loadingAnimation.gif&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/thickbox/tb-close.png&quot; },
-{ &quot;url&quot; : &quot;../wp-includes/js/swfupload/swfupload_f9.swf&quot; }
+{ &quot;url&quot; : &quot;../wp-includes/js/thickbox/tb-close.png&quot; }
 ]}</diff>
      <filename>wp-admin/gears-manifest.php</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>wp-admin/images/browse-happy.gif</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>wp-admin/images/loading-publish.gif</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>wp-admin/images/logo-ghost.png</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>wp-admin/images/logo-login.gif</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>wp-admin/images/logo.gif</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,21 @@
 &lt;?php
+/**
+ * Import WordPress Administration Panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
 require_once ('admin.php');
 $title = __('Import');
-$parent_file = 'edit.php';
 require_once ('admin-header.php');
+$parent_file = 'tools.php';
 ?&gt;
 
 &lt;div class=&quot;wrap&quot;&gt;
-&lt;h2&gt;&lt;?php _e('Import'); ?&gt;&lt;/h2&gt;
+&lt;?php screen_icon(); ?&gt;
+&lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
 &lt;p&gt;&lt;?php _e('If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:'); ?&gt;&lt;/p&gt;
 
 &lt;?php
@@ -32,7 +41,7 @@ if (empty ($importers)) {
 	echo '&lt;p&gt;'.__('No importers are available.').'&lt;/p&gt;'; // TODO: make more helpful
 } else {
 ?&gt;
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;table class=&quot;widefat&quot; cellspacing=&quot;0&quot;&gt;
 
 &lt;?php
 	$style = '';</diff>
      <filename>wp-admin/import.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,51 @@
 &lt;?php
-
-define( 'MAX_RESULTS',        50 ); // How many records per GData query
-define( 'MAX_EXECUTION_TIME', 20 ); // How many seconds to let the script run
-define( 'STATUS_INTERVAL',     3 ); // How many seconds between status bar updates
-
+/**
+ * Blogger Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * How many records per GData query
+ *
+ * @package WordPress
+ * @subpackage Blogger_Import
+ * @var int
+ * @since unknown
+ */
+define( 'MAX_RESULTS',        50 );
+
+/**
+ * How many seconds to let the script run
+ *
+ * @package WordPress
+ * @subpackage Blogger_Import
+ * @var int
+ * @since unknown
+ */
+define( 'MAX_EXECUTION_TIME', 20 );
+
+/**
+ * How many seconds between status bar updates
+ *
+ * @package WordPress
+ * @subpackage Blogger_Import
+ * @var int
+ * @since unknown
+ */
+define( 'STATUS_INTERVAL',     3 );
+
+/**
+ * Blogger Importer class
+ *
+ * @since unknown
+ */
 class Blogger_Import {
 
 	// Shows the welcome screen and the magic auth link.
 	function greet() {
-		$next_url = get_option('siteurl') . '/wp-admin/index.php?import=blogger&amp;noheader=true';
+		$next_url = get_option('siteurl') . '/wp-admin/index.php?import=blogger&amp;amp;noheader=true';
 		$auth_url = &quot;https://www.google.com/accounts/AuthSubRequest&quot;;
 		$title = __('Import Blogger');
 		$welcome = __('Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.');
@@ -17,7 +54,10 @@ class Blogger_Import {
 		$auth = __('Authorize');
 
 		echo &quot;
-		&lt;div class='wrap'&gt;&lt;h2&gt;$title&lt;/h2&gt;&lt;p&gt;$welcome&lt;/p&gt;&lt;p&gt;$prereqs&lt;/p&gt;&lt;p&gt;$stepone&lt;/p&gt;
+		&lt;div class='wrap'&gt;
+		&quot;.screen_icon().&quot;
+		&lt;h2&gt;$title&lt;/h2&gt;
+		&lt;p&gt;$welcome&lt;/p&gt;&lt;p&gt;$prereqs&lt;/p&gt;&lt;p&gt;$stepone&lt;/p&gt;
 			&lt;form action='$auth_url' method='get'&gt;
 				&lt;p class='submit' style='text-align:left;'&gt;
 					&lt;input type='submit' class='button' value='$auth' /&gt;
@@ -31,7 +71,9 @@ class Blogger_Import {
 	}
 
 	function uh_oh($title, $message, $info) {
-		echo &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$title&lt;/h2&gt;&lt;p&gt;$message&lt;/p&gt;&lt;pre&gt;$info&lt;/pre&gt;&lt;/div&gt;&quot;;
+		echo &quot;&lt;div class='wrap'&gt;&quot;;
+		screen_icon();
+		echo &quot;&lt;h2&gt;$title&lt;/h2&gt;&lt;p&gt;$message&lt;/p&gt;&lt;pre&gt;$info&lt;/pre&gt;&lt;/div&gt;&quot;;
 	}
 
 	function auth() {
@@ -181,9 +223,10 @@ class Blogger_Import {
 			$rows .= &quot;&lt;tr id='blog$i'&gt;&lt;td class='blogtitle'&gt;$blogtitle&lt;/td&gt;&lt;td class='bloghost'&gt;{$blog['host']}&lt;/td&gt;&lt;td class='bar'&gt;$pstat&lt;/td&gt;&lt;td class='bar'&gt;$cstat&lt;/td&gt;&lt;td class='submit'&gt;&lt;input type='submit' class='button' id='submit$i' value='$value' /&gt;&lt;input type='hidden' name='blog' value='$i' /&gt;&lt;/td&gt;&lt;/tr&gt;\n&quot;;
 		}
 
-		echo &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$title&lt;/h2&gt;&lt;noscript&gt;$noscript&lt;/noscript&gt;&lt;table cellpadding='5px'&gt;&lt;thead&gt;&lt;td&gt;$name&lt;/td&gt;&lt;td&gt;$url&lt;/td&gt;&lt;td&gt;$posts&lt;/td&gt;&lt;td&gt;$comments&lt;/td&gt;&lt;td&gt;$action&lt;/td&gt;&lt;/thead&gt;\n$rows&lt;/table&gt;&lt;/form&gt;&lt;/div&gt;&quot;;
+		echo &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$title&lt;/h2&gt;&lt;noscript&gt;$noscript&lt;/noscript&gt;&lt;table cellpadding='5px'&gt;&lt;thead&gt;&lt;tr&gt;&lt;td&gt;$name&lt;/td&gt;&lt;td&gt;$url&lt;/td&gt;&lt;td&gt;$posts&lt;/td&gt;&lt;td&gt;$comments&lt;/td&gt;&lt;td&gt;$action&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;\n$rows&lt;/table&gt;&lt;/div&gt;&quot;;
 		echo &quot;
 		&lt;script type='text/javascript'&gt;
+		/* &lt;![CDATA[ */
 			var strings = {cont:'$continue',stop:'$stop',stopping:'$stopping',authors:'$authors',nothing:'$nothing'};
 			var blogs = {};
 			function blog(i, title, mode, status){
@@ -296,6 +339,7 @@ class Blogger_Import {
 			};
 			$init
 			jQuery.each(blogs, function(i, me){me.init();});
+		/* ]]&gt; */
 		&lt;/script&gt;\n&quot;;
 	}
 
@@ -485,7 +529,7 @@ class Blogger_Import {
 	}
 
 	function import_post( $entry ) {
-		global $wpdb, $importing_blog;
+		global $importing_blog;
 
 		// The old permalink is all Blogger gives us to link comments to their posts.
 		if ( isset( $entry-&gt;draft ) )
@@ -618,11 +662,11 @@ class Blogger_Import {
 		foreach ( $blog['authors'] as $i =&gt; $author )
 			$rows .= &quot;&lt;tr&gt;&lt;td&gt;&lt;label for='authors[$i]'&gt;{$author[0]}&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;select name='authors[$i]' id='authors[$i]'&gt;&quot; . $this-&gt;get_user_options($author[1]) . &quot;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;&quot;;
 
-		return &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$heading&lt;/h2&gt;&lt;h3&gt;$blogtitle&lt;/h3&gt;&lt;p&gt;$directions&lt;/p&gt;&lt;form action='index.php?import=blogger&amp;noheader=true&amp;saveauthors=1' method='post'&gt;&lt;input type='hidden' name='blog' value='$importing_blog' /&gt;&lt;table cellpadding='5'&gt;&lt;thead&gt;&lt;td&gt;$mapthis&lt;/td&gt;&lt;td&gt;$tothis&lt;/td&gt;&lt;/thead&gt;$rows&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td class='submit'&gt;&lt;input type='submit' class='button authorsubmit' value='$submit' /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;&lt;/div&gt;&quot;;
+		return &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$heading&lt;/h2&gt;&lt;h3&gt;$blogtitle&lt;/h3&gt;&lt;p&gt;$directions&lt;/p&gt;&lt;form action='index.php?import=blogger&amp;amp;noheader=true&amp;saveauthors=1' method='post'&gt;&lt;input type='hidden' name='blog' value='$importing_blog' /&gt;&lt;table cellpadding='5'&gt;&lt;thead&gt;&lt;td&gt;$mapthis&lt;/td&gt;&lt;td&gt;$tothis&lt;/td&gt;&lt;/thead&gt;$rows&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td class='submit'&gt;&lt;input type='submit' class='button authorsubmit' value='$submit' /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;&lt;/div&gt;&quot;;
 	}
 
 	function get_user_options($current) {
-		global $wpdb, $importer_users;
+		global $importer_users;
 		if ( ! isset( $importer_users ) )
 			$importer_users = (array) get_users_of_blog();
 
@@ -777,7 +821,7 @@ class Blogger_Import {
 				echo $result-&gt;get_error_message();
 		} elseif ( isset($_GET['token']) )
 			$this-&gt;auth();
-		elseif ( $this-&gt;token &amp;&amp; $this-&gt;token_is_valid() )
+		elseif ( isset($this-&gt;token) &amp;&amp; $this-&gt;token_is_valid() )
 			$this-&gt;show_blogs();
 		else
 			$this-&gt;greet();
@@ -788,7 +832,7 @@ class Blogger_Import {
 			$restart = __('Restart');
 			$message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.');
 			$submit = __('Clear account information');
-			echo &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$restart&lt;/h2&gt;&lt;p&gt;$message&lt;/p&gt;&lt;form method='post' action='?import=blogger&amp;noheader=true'&gt;&lt;p class='submit' style='text-align:left;'&gt;&lt;input type='submit' class='button' value='$submit' name='restart' /&gt;&lt;/p&gt;&lt;/form&gt;&lt;/div&gt;&quot;;
+			echo &quot;&lt;div class='wrap'&gt;&lt;h2&gt;$restart&lt;/h2&gt;&lt;p&gt;$message&lt;/p&gt;&lt;form method='post' action='?import=blogger&amp;amp;noheader=true'&gt;&lt;p class='submit' style='text-align:left;'&gt;&lt;input type='submit' class='button' value='$submit' name='restart' /&gt;&lt;/p&gt;&lt;/form&gt;&lt;/div&gt;&quot;;
 		}
 	}
 </diff>
      <filename>wp-admin/import/blogger.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,27 @@
 &lt;?php
-
-/* By Shayne Sweeney - http://www.theshayne.com/ */
-
+/**
+ * Blogware XML Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ * @author Shayne Sweeney
+ * @link http://www.theshayne.com/
+ */
+
+/**
+ * Blogware XML Importer class
+ *
+ * Extract posts from Blogware XML export file into your blog.
+ *
+ * @since unknown
+ */
 class BW_Import {
 
 	var $file;
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Blogware').'&lt;/h2&gt;';
 	}
 </diff>
      <filename>wp-admin/import/blogware.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,24 @@
 &lt;?php
-
+/**
+ * BunnyTags Plugin Tag Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * BunnyTags Plugin tag converter
+ *
+ * This will process the BunnyTags plugin tags and convert them to the WordPress
+ * 2.3 taxonomy.
+ *
+ * @since unknown
+ */
 class BunnyTags_Import {
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Bunny&amp;#8217;s Technorati Tags').'&lt;/h2&gt;';
 		echo '&lt;p&gt;'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;';
 	}
@@ -20,7 +35,7 @@ class BunnyTags_Import {
 		echo '&lt;p&gt;&lt;strong&gt;'.__('Don&amp;#8217;t be stupid - backup your database before proceeding!').'&lt;/strong&gt;&lt;/p&gt;';
 		echo '&lt;form action=&quot;admin.php?import=btt&amp;amp;step=1&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-btt');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Import Tags').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Import Tags').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -90,7 +105,7 @@ class BunnyTags_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=btt&amp;amp;step='.($precheck? 2:3).'&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-btt');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Next').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Next').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}</diff>
      <filename>wp-admin/import/btt.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,11 @@
 &lt;?php
-/*
- * DotClear import plugin
- * by Thomas Quinot - http://thomas.quinot.org/
+/**
+ * DotClear Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ * @author Thomas Quinot
+ * @link http://thomas.quinot.org/
  */
 
 /**
@@ -10,6 +14,15 @@
 
 if(!function_exists('get_comment_count'))
 {
+	/**
+	 * Get the comment count for posts.
+	 *
+	 * @package WordPress
+	 * @subpackage Dotclear_Import
+	 *
+	 * @param int $post_ID Post ID
+	 * @return int
+	 */
 	function get_comment_count($post_ID)
 	{
 		global $wpdb;
@@ -19,6 +32,15 @@ if(!function_exists('get_comment_count'))
 
 if(!function_exists('link_exists'))
 {
+	/**
+	 * Check whether link already exists.
+	 *
+	 * @package WordPress
+	 * @subpackage Dotclear_Import
+	 *
+	 * @param string $linkname
+	 * @return int
+	 */
 	function link_exists($linkname)
 	{
 		global $wpdb;
@@ -40,31 +62,73 @@ if(!function_exists('link_exists'))
 //    This cries out for a C-implementation to be included in PHP core
 //
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $char
+ * @return string
+ */
 function valid_1byte($char) {
 	if(!is_int($char)) return false;
 		return ($char &amp; 0x80) == 0x00;
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $char
+ * @return string
+ */
 function valid_2byte($char) {
 	if(!is_int($char)) return false;
 		return ($char &amp; 0xE0) == 0xC0;
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $char
+ * @return string
+ */
 function valid_3byte($char) {
 	if(!is_int($char)) return false;
 		return ($char &amp; 0xF0) == 0xE0;
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $char
+ * @return string
+ */
 function valid_4byte($char) {
 	if(!is_int($char)) return false;
 		return ($char &amp; 0xF8) == 0xF0;
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $char
+ * @return string
+ */
 function valid_nextbyte($char) {
 	if(!is_int($char)) return false;
 		return ($char &amp; 0xC0) == 0x80;
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $string
+ * @return string
+ */
 function valid_utf8($string) {
 	$len = strlen($string);
 	$i = 0;
@@ -92,6 +156,13 @@ function valid_utf8($string) {
 	return true; // done
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $s
+ * @return string
+ */
 function csc ($s) {
 	if (valid_utf8 ($s)) {
 		return $s;
@@ -100,18 +171,34 @@ function csc ($s) {
 	}
 }
 
+/**
+ * @package WordPress
+ * @subpackage Dotclear_Import
+ *
+ * @param string $s
+ * @return string
+ */
 function textconv ($s) {
 	return csc (preg_replace ('|(?&lt;!&lt;br /&gt;)\s*\n|', ' ', $s));
 }
 
 /**
-	The Main Importer Class
-**/
+ * Dotclear Importer class
+ *
+ * Will process the WordPress eXtended RSS files that you upload from the export
+ * file.
+ *
+ * @package WordPress
+ * @subpackage Importer
+ *
+ * @since unknown
+ */
 class Dotclear_Import {
 
 	function header()
 	{
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import DotClear').'&lt;/h2&gt;';
 		echo '&lt;p&gt;'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'&lt;/p&gt;';
 	}
@@ -128,7 +215,7 @@ class Dotclear_Import {
 		echo '&lt;form action=&quot;admin.php?import=dotclear&amp;amp;step=1&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-dotclear');
 		$this-&gt;db_form();
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.attribute_escape(__('Import Categories')).'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.attribute_escape(__('Import Categories')).'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;&lt;/div&gt;';
 	}
 
@@ -545,7 +632,7 @@ class Dotclear_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=dotclear&amp;amp;step=2&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-dotclear');
-		printf('&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Users')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Users')));
 		echo '&lt;/form&gt;';
 
 	}
@@ -558,7 +645,7 @@ class Dotclear_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=dotclear&amp;amp;step=3&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-dotclear');
-		printf('&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Posts')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Posts')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -572,7 +659,7 @@ class Dotclear_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=dotclear&amp;amp;step=4&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-dotclear');
-		printf('&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Comments')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Comments')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -584,7 +671,7 @@ class Dotclear_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=dotclear&amp;amp;step=5&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-dotclear');
-		printf('&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Links')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Links')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -597,7 +684,7 @@ class Dotclear_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=dotclear&amp;amp;step=6&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-dotclear');
-		printf('&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Finish')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Finish')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -644,7 +731,7 @@ class Dotclear_Import {
 		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dbuser&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;dbuser&quot; id=&quot;dbuser&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;', __('DotClear Database User:'));
 		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dbpass&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;password&quot; name=&quot;dbpass&quot; id=&quot;dbpass&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;', __('DotClear Database Password:'));
 		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dbname&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;dbname&quot; id=&quot;dbname&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;', __('DotClear Database Name:'));
-		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dbhost&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;dbhost&quot; nameid=&quot;dbhost&quot; value=&quot;localhost&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;', __('DotClear Database Host:'));
+		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dbhost&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;dbhost&quot; id=&quot;dbhost&quot; value=&quot;localhost&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;', __('DotClear Database Host:'));
 		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dbprefix&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;dbprefix&quot; id=&quot;dbprefix&quot; value=&quot;dc_&quot;/&gt;&lt;/td&gt;&lt;/tr&gt;', __('DotClear Table prefix:'));
 		printf('&lt;tr&gt;&lt;th&gt;&lt;label for=&quot;dccharset&quot;&gt;%s&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;dccharset&quot; id=&quot;dccharset&quot; value=&quot;ISO-8859-15&quot;/&gt;&lt;/td&gt;&lt;/tr&gt;', __('Originating character set:'));
 		echo '&lt;/table&gt;';
@@ -742,5 +829,7 @@ class Dotclear_Import {
 }
 
 $dc_import = new Dotclear_Import();
+
 register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog.'), array ($dc_import, 'dispatch'));
+
 ?&gt;</diff>
      <filename>wp-admin/import/dotclear.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,26 @@
 &lt;?php
-
+/**
+ * GreyMatter Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * GreyMatter Importer class
+ *
+ * Basic GreyMatter to WordPress importer, will import posts, comments, and
+ * posts karma.
+ *
+ * @since unknown
+ */
 class GM_Import {
 
 	var $gmnames = array ();
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import GreyMatter').'&lt;/h2&gt;';
 	}
 
@@ -31,7 +46,7 @@ class GM_Import {
 &lt;/ul&gt;
 &lt;p&gt;&amp;nbsp;&lt;/p&gt;
 
-&lt;form name=&quot;stepOne&quot; method=&quot;get&quot;&gt;
+&lt;form name=&quot;stepOne&quot; method=&quot;get&quot; action=&quot;&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;import&quot; value=&quot;greymatter&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;step&quot; value=&quot;1&quot; /&gt;
 &lt;?php wp_nonce_field('import-greymatter'); ?&gt;
@@ -51,8 +66,7 @@ class GM_Import {
 	&lt;?php _e(&quot;This importer will search for files 00000001.cgi to 000-whatever.cgi,&lt;br /&gt;so you need to enter the number of the last GM post here.&lt;br /&gt;(if you don't know that number, just log into your FTP and look it out&lt;br /&gt;in the entries' folder)&quot;) ?&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/table&gt;
-&lt;/p&gt;
-&lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;&lt;?php _e('Start Importing') ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;/p&gt;
+&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php _e('Start Importing') ?&gt;&quot; /&gt;&lt;/p&gt;
 &lt;/form&gt;
 &lt;?php
 		$this-&gt;footer();</diff>
      <filename>wp-admin/import/greymatter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,23 @@
 &lt;?php
-
+/**
+ * Jeromes Keyword Plugin Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * Jeromes Keyword Plugin Importer class
+ *
+ * Will convert Jeromes Keyword Plugin tags to WordPress taxonomy tags.
+ *
+ * @since 2.3
+ */
 class JeromesKeyword_Import {
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Jerome&amp;#8217;s Keywords').'&lt;/h2&gt;';
 		echo '&lt;p&gt;'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;';
 	}
@@ -106,7 +120,7 @@ class JeromesKeyword_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=jkw&amp;amp;step='.($precheck? 2:6).'&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-jkw');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Next').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Next').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -139,7 +153,7 @@ class JeromesKeyword_Import {
 		}
 		echo '&lt;form action=&quot;admin.php?import=jkw&amp;amp;step='.($precheck? 4:5).'&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-jkw');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Next').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Next').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}</diff>
      <filename>wp-admin/import/jkw.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,25 @@
 &lt;?php
-
+/**
+ * LiveJournal Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * LiveJournal Importer class
+ *
+ * Imports your LiveJournal XML exported file into WordPress.
+ *
+ * @since unknown
+ */
 class LJ_Import {
 
 	var $file;
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import LiveJournal').'&lt;/h2&gt;';
 	}
 </diff>
      <filename>wp-admin/import/livejournal.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,18 @@
 &lt;?php
-
+/**
+ * Movable Type and Typepad Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * Moveable Type and Typepad Importer class
+ *
+ * Upload your exported Movable Type or Typepad entries into WordPress.
+ *
+ * @since unknown
+ */
 class MT_Import {
 
 	var $posts = array ();
@@ -11,6 +24,7 @@ class MT_Import {
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Movable Type or TypePad').'&lt;/h2&gt;';
 	}
 
@@ -32,7 +46,7 @@ class MT_Import {
 	&lt;input type=&quot;hidden&quot; name=&quot;upload_type&quot; value=&quot;ftp&quot; /&gt;
 &lt;?php _e('Or use &lt;code&gt;mt-export.txt&lt;/code&gt; in your &lt;code&gt;/wp-content/&lt;/code&gt; directory'); ?&gt;&lt;/p&gt;
 &lt;p class=&quot;submit&quot;&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php echo attribute_escape(__('Import mt-export.txt')); ?&gt;&quot; /&gt;
+&lt;input type=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php echo attribute_escape(__('Import mt-export.txt')); ?&gt;&quot; /&gt;
 &lt;/p&gt;
 &lt;/form&gt;
 &lt;p&gt;&lt;?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&amp;#8212;for whatever reason&amp;#8212;it doesn\'t finish. If you get an &lt;strong&gt;out of memory&lt;/strong&gt; error try splitting up the import file into pieces.'); ?&gt; &lt;/p&gt;
@@ -42,7 +56,7 @@ class MT_Import {
 	}
 
 	function users_form($n) {
-		global $wpdb, $testing;
+		global $wpdb;
 		$users = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;users ORDER BY ID&quot;);
 ?&gt;&lt;select name=&quot;userselect[&lt;?php echo $n; ?&gt;]&quot;&gt;
 	&lt;option value=&quot;#NONE#&quot;&gt;&lt;?php _e('- Select -') ?&gt;&lt;/option&gt;
@@ -56,12 +70,38 @@ class MT_Import {
 	&lt;/select&gt;
 	&lt;?php
 
+	}
+
+	function has_gzip() {
+		return is_callable('gzopen');
+	}
+
+	function fopen($filename, $mode='r') {
+		if ( $this-&gt;has_gzip() )
+			return gzopen($filename, $mode);
+		return fopen($filename, $mode);
+	}
 
+	function feof($fp) {
+		if ( $this-&gt;has_gzip() )
+			return gzeof($fp);
+		return feof($fp);
 	}
 
+	function fgets($fp, $len=8192) {
+		if ( $this-&gt;has_gzip() )
+			return gzgets($fp, $len);
+		return fgets($fp, $len);
+	}
+
+	function fclose($fp) {
+		if ( $this-&gt;has_gzip() )
+			return gzclose($fp);
+		return fclose($fp);
+ 	}
+
 	//function to check the authorname and do the mapping
 	function checkauthor($author) {
-		global $wpdb;
 		//mtnames is an array with the names in the mt import file
 		$pass = wp_generate_password();
 		if (!(in_array($author, $this-&gt;mtnames))) { //a new mt author name is found
@@ -69,7 +109,7 @@ class MT_Import {
 			$this-&gt;mtnames[$this-&gt;j] = $author; //add that new mt author name to an array
 			$user_id = username_exists($this-&gt;newauthornames[$this-&gt;j]); //check if the new author name defined by the user is a pre-existing wp user
 			if (!$user_id) { //banging my head against the desk now.
-				if ($newauthornames[$this-&gt;j] == 'left_blank') { //check if the user does not want to change the authorname
+				if ($this-&gt;newauthornames[$this-&gt;j] == 'left_blank') { //check if the user does not want to change the authorname
 					$user_id = wp_create_user($author, $pass);
 					$this-&gt;newauthornames[$this-&gt;j] = $author; //now we have a name, in the place of left_blank.
 				} else {
@@ -90,12 +130,12 @@ class MT_Import {
 		$temp = array();
 		$authors = array();
 
-		$handle = fopen($this-&gt;file, 'r');
+		$handle = $this-&gt;fopen($this-&gt;file, 'r');
 		if ( $handle == null )
 			return false;
 
 		$in_comment = false;
-		while ( $line = fgets($handle) ) {
+		while ( $line = $this-&gt;fgets($handle) ) {
 			$line = trim($line);
 
 			if ( 'COMMENT:' == $line )
@@ -118,7 +158,7 @@ class MT_Import {
 				array_push($authors, &quot;$next&quot;);
 		}
 
-		fclose($handle);
+		$this-&gt;fclose($handle);
 
 		return $authors;
 	}
@@ -152,6 +192,7 @@ class MT_Import {
 	function mt_authors_form() {
 ?&gt;
 &lt;div class=&quot;wrap&quot;&gt;
+&lt;?php screen_icon(); ?&gt;
 &lt;h2&gt;&lt;?php _e('Assign Authors'); ?&gt;&lt;/h2&gt;
 &lt;p&gt;&lt;?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin\'s entries.'); ?&gt;&lt;/p&gt;
 &lt;p&gt;&lt;?php _e('Below, you can see the names of the authors of the MovableType posts in &lt;em&gt;italics&lt;/em&gt;. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?&gt;&lt;/p&gt;
@@ -171,7 +212,7 @@ class MT_Import {
 			echo '&lt;/label&gt;&lt;/li&gt;';
 		}
 
-		echo '&lt;input type=&quot;submit&quot; value=&quot;'.__('Submit').'&quot;&gt;'.'&lt;br /&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Submit').'&quot;&gt;&lt;/p&gt;'.'&lt;br /&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/ol&gt;&lt;/div&gt;';
 
@@ -224,10 +265,10 @@ class MT_Import {
 			if ( 0 != count($post-&gt;categories) ) {
 				wp_create_categories($post-&gt;categories, $post_id);
 			}
-			
+
 			 // Add tags or keywords
 			if ( 1 &lt; strlen($post-&gt;post_keywords) ) {
-			 	// Keywords exist. 
+			 	// Keywords exist.
 				printf(__('&lt;br /&gt;Adding tags &lt;i&gt;%s&lt;/i&gt;...'), stripslashes($post-&gt;post_keywords));
 				wp_add_post_tags($post_id, $post-&gt;post_keywords);
 			}
@@ -273,7 +314,7 @@ class MT_Import {
 	function process_posts() {
 		global $wpdb;
 
-		$handle = fopen($this-&gt;file, 'r');
+		$handle = $this-&gt;fopen($this-&gt;file, 'r');
 		if ( $handle == null )
 			return false;
 
@@ -286,7 +327,7 @@ class MT_Import {
 
 		echo &quot;&lt;div class='wrap'&gt;&lt;ol&gt;&quot;;
 
-		while ( $line = fgets($handle) ) {
+		while ( $line = $this-&gt;fgets($handle) ) {
 			$line = trim($line);
 
 			if ( '-----' == $line ) {
@@ -415,6 +456,8 @@ class MT_Import {
 			}
 		}
 
+		$this-&gt;fclose($handle);
+
 		echo '&lt;/ol&gt;';
 
 		wp_import_cleanup($this-&gt;id);</diff>
      <filename>wp-admin/import/mt.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,20 @@
 &lt;?php
-
+/**
+ * RSS Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * RSS Importer
+ *
+ * Will process a RSS feed for importing posts into WordPress. This is a very
+ * limited importer and should only be used as the last resort, when no other
+ * importer is available.
+ *
+ * @since unknown
+ */
 class RSS_Import {
 
 	var $posts = array ();
@@ -7,6 +22,7 @@ class RSS_Import {
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import RSS').'&lt;/h2&gt;';
 	}
 </diff>
      <filename>wp-admin/import/rss.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,22 @@
 &lt;?php
+/**
+ * Simple Tags Plugin Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * Simple Tags Plugin Tags converter class.
+ *
+ * Will convert Simple Tags Plugin tags over to the WordPress 2.3 taxonomy.
+ *
+ * @since unknown
+ */
 class STP_Import {
 	function header()  {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Simple Tagging').'&lt;/h2&gt;';
 		echo '&lt;p&gt;'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;';
 	}
@@ -18,7 +33,7 @@ class STP_Import {
 		echo '&lt;p&gt;&lt;strong&gt;'.__('Don&amp;#8217;t be stupid - backup your database before proceeding!').'&lt;/strong&gt;&lt;/p&gt;';
 		echo '&lt;form action=&quot;admin.php?import=stp&amp;amp;step=1&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-stp');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 1').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 1').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -78,7 +93,7 @@ class STP_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=stp&amp;amp;step=2&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-stp');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 2').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 2').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -94,7 +109,7 @@ class STP_Import {
 		echo '&lt;p&gt;' . sprintf( __ngettext('Done! &lt;strong&gt;%s&lt;/strong&gt; tag was added!', 'Done! &lt;strong&gt;%s&lt;/strong&gt; tags were added!', $tags_added), $tags_added ) . '&lt;br /&gt;&lt;/p&gt;';
 		echo '&lt;form action=&quot;admin.php?import=stp&amp;amp;step=3&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-stp');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 3').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 3').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}</diff>
      <filename>wp-admin/import/stp.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,22 @@
 &lt;?php
 /**
-	Add These Functions to make our lives easier
-**/
+ * TextPattern Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
 
 if(!function_exists('get_comment_count'))
 {
+	/**
+	 * Get the comment count for posts.
+	 *
+	 * @package WordPress
+	 * @subpackage Textpattern_Import
+	 *
+	 * @param int $post_ID Post ID
+	 * @return int
+	 */
 	function get_comment_count($post_ID)
 	{
 		global $wpdb;
@@ -14,6 +26,15 @@ if(!function_exists('get_comment_count'))
 
 if(!function_exists('link_exists'))
 {
+	/**
+	 * Check whether link already exists.
+	 *
+	 * @package WordPress
+	 * @subpackage Textpattern_Import
+	 *
+	 * @param string $linkname
+	 * @return int
+	 */
 	function link_exists($linkname)
 	{
 		global $wpdb;
@@ -22,13 +43,16 @@ if(!function_exists('link_exists'))
 }
 
 /**
-	The Main Importer Class
-**/
+ * TextPattern Importer Class
+ *
+ * @since unknown
+ */
 class Textpattern_Import {
 
 	function header()
 	{
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Textpattern').'&lt;/h2&gt;';
 		echo '&lt;p&gt;'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'&lt;/p&gt;';
 	}
@@ -46,7 +70,7 @@ class Textpattern_Import {
 		echo '&lt;form action=&quot;admin.php?import=textpattern&amp;amp;step=1&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-textpattern');
 		$this-&gt;db_form();
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;'.attribute_escape(__('Import')).'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.attribute_escape(__('Import')).'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -481,7 +505,7 @@ class Textpattern_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=textpattern&amp;amp;step=2&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-textpattern');
-		printf('&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Users')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Users')));
 		echo '&lt;/form&gt;';
 
 	}
@@ -494,7 +518,7 @@ class Textpattern_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=textpattern&amp;amp;step=3&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-textpattern');
-		printf('&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Posts')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Posts')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -508,7 +532,7 @@ class Textpattern_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=textpattern&amp;amp;step=4&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-textpattern');
-		printf('&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Comments')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Comments')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -520,7 +544,7 @@ class Textpattern_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=textpattern&amp;amp;step=5&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-textpattern');
-		printf('&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Import Links')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Import Links')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -533,7 +557,7 @@ class Textpattern_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=textpattern&amp;amp;step=6&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-textpattern');
-		printf('&lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;submit&quot; value=&quot;%s&quot; /&gt;', attribute_escape(__('Finish')));
+		printf('&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;%s&quot; /&gt;&lt;/p&gt;', attribute_escape(__('Finish')));
 		echo '&lt;/form&gt;';
 	}
 
@@ -670,5 +694,7 @@ class Textpattern_Import {
 }
 
 $txp_import = new Textpattern_Import();
+
 register_importer('textpattern', __('Textpattern'), __('Import categories, users, posts, comments, and links from a Textpattern blog.'), array ($txp_import, 'dispatch'));
+
 ?&gt;</diff>
      <filename>wp-admin/import/textpattern.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,23 @@
 &lt;?php
-
+/**
+ * The Ultimate Tag Warrior Importer.
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * Ultimate Tag Warrior Converter to 2.3 taxonomy.
+ *
+ * This converts the Ultimate Tag Warrior tags to the 2.3 WordPress taxonomy.
+ *
+ * @since 2.3.0
+ */
 class UTW_Import {
 
 	function header()  {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import Ultimate Tag Warrior').'&lt;/h2&gt;';
 		echo '&lt;p&gt;'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;';
 	}
@@ -19,7 +33,7 @@ class UTW_Import {
 		echo '&lt;p&gt;'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'&lt;/p&gt;';
 		echo '&lt;p&gt;&lt;strong&gt;'.__('Don&amp;#8217;t be stupid - backup your database before proceeding!').'&lt;/strong&gt;&lt;/p&gt;';
 		echo '&lt;form action=&quot;admin.php?import=utw&amp;amp;step=1&quot; method=&quot;post&quot;&gt;';
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 1').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 1').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -106,7 +120,7 @@ class UTW_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=utw&amp;amp;step=2&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-utw');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 2').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 2').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 	}
@@ -142,7 +156,7 @@ class UTW_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=utw&amp;amp;step=3&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-utw');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 3').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 3').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 
@@ -161,7 +175,7 @@ class UTW_Import {
 
 		echo '&lt;form action=&quot;admin.php?import=utw&amp;amp;step=4&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-utw');
-		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;'.__('Step 4').'&quot; /&gt;&lt;/p&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.__('Step 4').'&quot; /&gt;&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 		echo '&lt;/div&gt;';
 </diff>
      <filename>wp-admin/import/utw.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,19 @@
 &lt;?php
-
+/**
+ * WordPress Importer
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * WordPress Importer
+ *
+ * Will process the WordPress eXtended RSS files that you upload from the export
+ * file.
+ *
+ * @since unknown
+ */
 class WP_Import {
 
 	var $post_ids_processed = array ();
@@ -20,6 +34,7 @@ class WP_Import {
 
 	function header() {
 		echo '&lt;div class=&quot;wrap&quot;&gt;';
+		screen_icon();
 		echo '&lt;h2&gt;'.__('Import WordPress').'&lt;/h2&gt;';
 	}
 
@@ -35,7 +50,7 @@ class WP_Import {
 
 	function greet() {
 		echo '&lt;div class=&quot;narrow&quot;&gt;';
-		echo '&lt;p&gt;'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&amp;#8217;ll import the posts, comments, custom fields, and categories into this blog.').'&lt;/p&gt;';
+		echo '&lt;p&gt;'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&amp;#8217;ll import the posts, pages, comments, custom fields, categories, and tags into this blog.').'&lt;/p&gt;';
 		echo '&lt;p&gt;'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'&lt;/p&gt;';
 		wp_import_upload_form(&quot;admin.php?import=wordpress&amp;amp;step=1&quot;);
 		echo '&lt;/div&gt;';
@@ -92,6 +107,11 @@ class WP_Import {
 				if ( !$is_wxr_file &amp;&amp; preg_match('|xmlns:wp=&quot;http://wordpress[.]org/export/\d+[.]\d+/&quot;|', $importline) )
 					$is_wxr_file = true;
 
+				if ( false !== strpos($importline, '&lt;wp:base_site_url&gt;') ) {
+					preg_match('|&lt;wp:base_site_url&gt;(.*?)&lt;/wp:base_site_url&gt;|is', $importline, $url);
+					$this-&gt;base_url = $url[1];
+					continue;
+				}
 				if ( false !== strpos($importline, '&lt;wp:category&gt;') ) {
 					preg_match('|&lt;wp:category&gt;(.*?)&lt;/wp:category&gt;|is', $importline, $category);
 					$this-&gt;categories[] = $category[1];
@@ -178,6 +198,7 @@ class WP_Import {
 
 	function wp_authors_form() {
 ?&gt;
+&lt;?php screen_icon(); ?&gt;
 &lt;h2&gt;&lt;?php _e('Assign Authors'); ?&gt;&lt;/h2&gt;
 &lt;p&gt;&lt;?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as &lt;code&gt;admin&lt;/code&gt;s entries.'); ?&gt;&lt;/p&gt;
 &lt;?php
@@ -187,9 +208,9 @@ class WP_Import {
 
 
 		$authors = $this-&gt;get_wp_authors();
-		echo '&lt;ol id=&quot;authors&quot;&gt;';
 		echo '&lt;form action=&quot;?import=wordpress&amp;amp;step=2&amp;amp;id=' . $this-&gt;id . '&quot; method=&quot;post&quot;&gt;';
 		wp_nonce_field('import-wordpress');
+		echo '&lt;ol id=&quot;authors&quot;&gt;';
 		$j = -1;
 		foreach ($authors as $author) {
 			++ $j;
@@ -201,6 +222,7 @@ class WP_Import {
 		if ( $this-&gt;allow_fetch_attachments() ) {
 ?&gt;
 &lt;/ol&gt;
+&lt;?php screen_icon(); ?&gt;
 &lt;h2&gt;&lt;?php _e('Import Attachments'); ?&gt;&lt;/h2&gt;
 &lt;p&gt;
 	&lt;input type=&quot;checkbox&quot; value=&quot;1&quot; name=&quot;attachments&quot; id=&quot;import-attachments&quot; /&gt;
@@ -210,7 +232,9 @@ class WP_Import {
 &lt;?php
 		}
 
-		echo '&lt;input type=&quot;submit&quot; value=&quot;'.attribute_escape( __('Submit') ).'&quot;&gt;'.'&lt;br /&gt;';
+		echo '&lt;p class=&quot;submit&quot;&gt;';
+		echo '&lt;input type=&quot;submit&quot; class=&quot;button&quot; value=&quot;'.attribute_escape( __('Submit') ).'&quot; /&gt;'.'&lt;br /&gt;';
+		echo '&lt;/p&gt;';
 		echo '&lt;/form&gt;';
 
 	}
@@ -218,7 +242,7 @@ class WP_Import {
 	function users_form($n, $author) {
 
 		if ( $this-&gt;allow_create_users() ) {
-			printf('&lt;label&gt;'.__('Create user %1$s or map to existing'), ' &lt;input type=&quot;text&quot; value=&quot;'.$author.'&quot; name=&quot;'.'user_create['.intval($n).']'.'&quot; maxlength=&quot;30&quot;&gt;&lt;/label&gt; &lt;br /&gt;');
+			printf('&lt;label&gt;'.__('Create user %1$s or map to existing'), ' &lt;input type=&quot;text&quot; value=&quot;'.$author.'&quot; name=&quot;'.'user_create['.intval($n).']'.'&quot; maxlength=&quot;30&quot; /&gt;&lt;/label&gt; &lt;br /&gt;');
 		}
 		else {
 			echo __('Map to existing').'&lt;br /&gt;';
@@ -320,7 +344,6 @@ class WP_Import {
 	}
 
 	function process_posts() {
-		$i = -1;
 		echo '&lt;ol&gt;';
 
 		$this-&gt;get_entries(array(&amp;$this, 'process_post'));
@@ -339,7 +362,7 @@ class WP_Import {
 		$post_ID = (int) $this-&gt;get_tag( $post, 'wp:post_id' );
   		if ( $post_ID &amp;&amp; !empty($this-&gt;post_ids_processed[$post_ID]) ) // Processed already
 			return 0;
-		
+
 		set_time_limit( 60 );
 
 		// There are only ever one of these
@@ -390,6 +413,7 @@ class WP_Import {
 		if ( $post_exists ) {
 			echo '&lt;li&gt;';
 			printf(__('Post &lt;em&gt;%s&lt;/em&gt; already exists.'), stripslashes($post_title));
+			$comment_post_ID = $post_id = $post_exists;
 		} else {
 
 			// If it has parent, process parent first.
@@ -410,6 +434,7 @@ class WP_Import {
 			$post_author = $this-&gt;checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
 
 			$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
+			$postdata['import_id'] = $post_ID;
 			if ($post_type == 'attachment') {
 				$remote_url = $this-&gt;get_tag( $post, 'wp:attachment_url' );
 				if ( !$remote_url )
@@ -436,6 +461,8 @@ class WP_Import {
 			if (count($categories) &gt; 0) {
 				$post_cats = array();
 				foreach ($categories as $category) {
+					if ( '' == $category )
+						continue;
 					$slug = sanitize_term_field('slug', $category, 0, 'category', 'db');
 					$cat = get_term_by('slug', $slug, 'category');
 					$cat_ID = 0;
@@ -444,6 +471,8 @@ class WP_Import {
 					if ($cat_ID == 0) {
 						$category = $wpdb-&gt;escape($category);
 						$cat_ID = wp_insert_category(array('cat_name' =&gt; $category));
+						if ( is_wp_error($cat_ID) )
+							continue;
 					}
 					$post_cats[] = $cat_ID;
 				}
@@ -454,6 +483,8 @@ class WP_Import {
 			if (count($tags) &gt; 0) {
 				$post_tags = array();
 				foreach ($tags as $tag) {
+					if ( '' == $tag )
+						continue;
 					$slug = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
 					$tag_obj = get_term_by('slug', $slug, 'post_tag');
 					$tag_id = 0;
@@ -462,6 +493,8 @@ class WP_Import {
 					if ( $tag_id == 0 ) {
 						$tag = $wpdb-&gt;escape($tag);
 						$tag_id = wp_insert_term($tag, 'post_tag');
+						if ( is_wp_error($tag_id) )
+							continue;
 						$tag_id = $tag_id['term_id'];
 					}
 					$post_tags[] = intval($tag_id);
@@ -525,6 +558,11 @@ class WP_Import {
 	function process_attachment($postdata, $remote_url) {
 		if ($this-&gt;fetch_attachments and $remote_url) {
 			printf( __('Importing attachment &lt;em&gt;%s&lt;/em&gt;... '), htmlspecialchars($remote_url) );
+
+			// If the URL is absolute, but does not contain http, upload it assuming the base_site_url variable
+			if ( preg_match('/^\/[\w\W]+$/', $remote_url) )
+				$remote_url = rtrim($this-&gt;base_url,'/').$remote_url;
+
 			$upload = $this-&gt;fetch_remote_file($postdata, $remote_url);
 			if ( is_wp_error($upload) ) {
 				printf( __('Remote file error: %s'), htmlspecialchars($upload-&gt;get_error_message()) );
@@ -579,10 +617,16 @@ class WP_Import {
 		// fetch the remote url and write it to the placeholder file
 		$headers = wp_get_http($url, $upload['file']);
 
+		//Request failed
+		if ( ! $headers ) {
+			@unlink($upload['file']);
+			return new WP_Error( 'import_file_error', __('Remote server did not respond') );
+		}
+
 		// make sure the fetch was successful
 		if ( $headers['response'] != '200' ) {
 			@unlink($upload['file']);
-			return new WP_Error( 'import_file_error', sprintf(__('Remote file returned error response %d'), intval($headers['response'])) );
+			return new WP_Error( 'import_file_error', sprintf(__('Remote file returned error response %1$d %2$s'), $headers['response'], get_status_header_desc($headers['response']) ) );
 		}
 		elseif ( isset($headers['content-length']) &amp;&amp; filesize($upload['file']) != $headers['content-length'] ) {
 			@unlink($upload['file']);
@@ -691,10 +735,12 @@ class WP_Import {
 
 		$this-&gt;import_start();
 		$this-&gt;get_authors_from_post();
+		wp_suspend_cache_invalidation(true);
 		$this-&gt;get_entries();
 		$this-&gt;process_categories();
 		$this-&gt;process_tags();
 		$result = $this-&gt;process_posts();
+		wp_suspend_cache_invalidation(false);
 		$this-&gt;backfill_parents();
 		$this-&gt;backfill_attachment_urls();
 		$this-&gt;import_end();
@@ -746,8 +792,15 @@ class WP_Import {
 	}
 }
 
+/**
+ * Register WordPress Importer
+ *
+ * @since unknown
+ * @var WP_Import
+ * @name $wp_import
+ */
 $wp_import = new WP_Import();
 
-register_importer('wordpress', 'WordPress', __('Import &lt;strong&gt;posts, comments, custom fields, pages, and categories&lt;/strong&gt; from a WordPress export file.'), array ($wp_import, 'dispatch'));
+register_importer('wordpress', 'WordPress', __('Import &lt;strong&gt;posts, pages, comments, custom fields, categories, and tags&lt;/strong&gt; from a WordPress export file.'), array ($wp_import, 'dispatch'));
 
 ?&gt;</diff>
      <filename>wp-admin/import/wordpress.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,19 @@
 &lt;?php
-
+/**
+ * WordPress Categories to Tags Converter.
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
+
+/**
+ * WordPress categories to tags converter class.
+ *
+ * Will convert WordPress categories to tags, removing the category after the
+ * process is complete and updating all posts to switch to the tag.
+ *
+ * @since unknown
+ */
 class WP_Categories_to_Tags {
 	var $categories_to_convert = array();
 	var $all_categories = array();
@@ -50,6 +64,7 @@ class WP_Categories_to_Tags {
 		echo '&lt;br class=&quot;clear&quot; /&gt;';
 
 		if ( $cat_num &gt; 0 ) {
+			screen_icon();
 			echo '&lt;h2&gt;' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '&lt;/h2&gt;';
 			echo '&lt;div class=&quot;narrow&quot;&gt;';
 			echo '&lt;p&gt;' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '&lt;/p&gt;';
@@ -103,7 +118,7 @@ function check_all_rows() {
 
 				 if ( in_array( intval($category-&gt;term_id),  $this-&gt;hybrids_ids ) )
 				 	echo ' &lt;a href=&quot;#note&quot;&gt; * &lt;/a&gt;';
-				
+
 				if ( isset($hier[$category-&gt;term_id]) )
 					$this-&gt;_category_children($category, $hier); ?&gt;&lt;/li&gt;
 &lt;?php		}
@@ -125,6 +140,7 @@ function check_all_rows() {
 		echo '&lt;br class=&quot;clear&quot; /&gt;';
 
 		if ( $tags_num &gt; 0 ) {
+			screen_icon();
 			echo '&lt;h2&gt;' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '&lt;/h2&gt;';
 			echo '&lt;div class=&quot;narrow&quot;&gt;';
 			echo '&lt;p&gt;' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '&lt;/p&gt;';
@@ -243,7 +259,7 @@ function check_all_tagrows() {
 
 					if ( ! ($id = is_term( $category-&gt;slug, 'post_tag' ) ) )
 						$id = wp_insert_term($category-&gt;name, 'post_tag', array('slug' =&gt; $category-&gt;slug));
-					
+
 					$id = $id['term_taxonomy_id'];
 					$posts = get_objects_in_term($category-&gt;term_id, 'category');
 					$term_order = 0;
@@ -252,7 +268,7 @@ function check_all_tagrows() {
 						$values[] = $wpdb-&gt;prepare( &quot;(%d, %d, %d)&quot;, $post, $id, $term_order);
 						clean_post_cache($post);
 					}
-					
+
 					if ( $values ) {
 						$wpdb-&gt;query(&quot;INSERT INTO $wpdb-&gt;term_relationships (object_id, term_taxonomy_id, term_order) VALUES &quot; . join(',', $values) . &quot; ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)&quot;);
 
@@ -262,7 +278,7 @@ function check_all_tagrows() {
 					echo __('Converted successfully.') . &quot;&lt;/li&gt;\n&quot;;
 					continue;
 				}
-				
+
 				// if tag already exists, add it to all posts in the category
 				if ( $tag_ttid = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT term_taxonomy_id FROM $wpdb-&gt;term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'&quot;, $category-&gt;term_id) ) ) {
 					$objects_ids = get_objects_in_term($category-&gt;term_id, 'category');</diff>
      <filename>wp-admin/import/wp-cat2tag.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,54 @@
 &lt;?php
+/**
+ * Includes all of the WordPress Administration API files.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/** WordPress Bookmark Administration API */
 require_once(ABSPATH . 'wp-admin/includes/bookmark.php');
+
+/** WordPress Comment Administration API */
 require_once(ABSPATH . 'wp-admin/includes/comment.php');
+
+/** WordPress Administration File API */
 require_once(ABSPATH . 'wp-admin/includes/file.php');
+
+/** WordPress Image Administration API */
 require_once(ABSPATH . 'wp-admin/includes/image.php');
+
+/** WordPress Media Administration API */
 require_once(ABSPATH . 'wp-admin/includes/media.php');
+
+/** WordPress Import Administration API */
 require_once(ABSPATH . 'wp-admin/includes/import.php');
+
+/** WordPress Misc Administration API */
 require_once(ABSPATH . 'wp-admin/includes/misc.php');
+
+/** WordPress Plugin Administration API */
 require_once(ABSPATH . 'wp-admin/includes/plugin.php');
+
+/** WordPress Post Administration API */
 require_once(ABSPATH . 'wp-admin/includes/post.php');
+
+/** WordPress Taxonomy Administration API */
 require_once(ABSPATH . 'wp-admin/includes/taxonomy.php');
+
+/** WordPress Template Administration API */
 require_once(ABSPATH . 'wp-admin/includes/template.php');
+
+/** WordPress Theme Administration API */
 require_once(ABSPATH . 'wp-admin/includes/theme.php');
+
+/** WordPress User Administration API */
 require_once(ABSPATH . 'wp-admin/includes/user.php');
+
+/** WordPress Update Administration API */
 require_once(ABSPATH . 'wp-admin/includes/update.php');
 
+/** WordPress Registration API */
 require_once(ABSPATH . WPINC . '/registration.php');
 
-?&gt;
+?&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/includes/admin.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,30 @@
 &lt;?php
-
+/**
+ * WordPress Bookmark Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function add_link() {
 	return edit_link();
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $link_id
+ * @return unknown
+ */
 function edit_link( $link_id = '' ) {
 	if (!current_user_can( 'manage_links' ))
 		wp_die( __( 'Cheatin&amp;#8217; uh?' ));
@@ -13,7 +34,7 @@ function edit_link( $link_id = '' ) {
 	$_POST['link_name'] = wp_specialchars( $_POST['link_name'] );
 	$_POST['link_image'] = wp_specialchars( $_POST['link_image'] );
 	$_POST['link_rss'] = clean_url($_POST['link_rss']);
-	if ( 'N' != $_POST['link_visible'] )
+	if ( !isset($_POST['link_visible']) || 'N' != $_POST['link_visible'] )
 		$_POST['link_visible'] = 'Y';
 
 	if ( !empty( $link_id ) ) {
@@ -24,6 +45,13 @@ function edit_link( $link_id = '' ) {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_default_link_to_edit() {
 	if ( isset( $_GET['linkurl'] ) )
 		$link-&gt;link_url = clean_url( $_GET['linkurl']);
@@ -40,44 +68,78 @@ function get_default_link_to_edit() {
 	return $link;
 }
 
-function wp_delete_link($link_id) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $link_id
+ * @return unknown
+ */
+function wp_delete_link( $link_id ) {
 	global $wpdb;
 
-	do_action('delete_link', $link_id);
+	do_action( 'delete_link', $link_id );
+
+	wp_delete_object_term_relationships( $link_id, 'link_category' );
 
-	wp_delete_object_term_relationships($link_id, 'link_category');
+	$wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM $wpdb-&gt;links WHERE link_id = %d&quot;, $link_id ) );
 
-	$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM $wpdb-&gt;links WHERE link_id = %d&quot;, $link_id) );
+	do_action( 'deleted_link', $link_id );
 
-	do_action('deleted_link', $link_id);
+	clean_bookmark_cache( $link_id );
 
 	return true;
 }
 
-function wp_get_link_cats($link_id = 0) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $link_id
+ * @return unknown
+ */
+function wp_get_link_cats( $link_id = 0 ) {
 
-	$cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids');
+	$cats = wp_get_object_terms( $link_id, 'link_category', 'fields=ids' );
 
-	return array_unique($cats);
+	return array_unique( $cats );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $link_id
+ * @return unknown
+ */
 function get_link_to_edit( $link_id ) {
 	return get_bookmark( $link_id, OBJECT, 'edit' );
 }
 
-function wp_insert_link($linkdata) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $linkdata
+ * @return unknown
+ */
+function wp_insert_link( $linkdata, $wp_error = false ) {
 	global $wpdb, $current_user;
 
-	$defaults = array('link_id' =&gt; 0, 'link_name' =&gt; '', 'link_url' =&gt; '', 'link_rating' =&gt; 0 );
+	$defaults = array( 'link_id' =&gt; 0, 'link_name' =&gt; '', 'link_url' =&gt; '', 'link_rating' =&gt; 0 );
 
-	$linkdata = wp_parse_args($linkdata, $defaults);
-	$linkdata = sanitize_bookmark($linkdata, 'db');
+	$linkdata = wp_parse_args( $linkdata, $defaults );
+	$linkdata = sanitize_bookmark( $linkdata, 'db' );
 
-	extract(stripslashes_deep($linkdata), EXTR_SKIP);
+	extract( stripslashes_deep( $linkdata ), EXTR_SKIP );
 
 	$update = false;
 
-	if ( !empty($link_id) )
+	if ( !empty( $link_id ) )
 		$update = true;
 
 	if ( trim( $link_name ) == '' )
@@ -86,91 +148,121 @@ function wp_insert_link($linkdata) {
 	if ( trim( $link_url ) == '' )
 		return 0;
 
-	if ( empty($link_rating) )
+	if ( empty( $link_rating ) )
 		$link_rating = 0;
 
-	if ( empty($link_image) )
+	if ( empty( $link_image ) )
 		$link_image = '';
 
-	if ( empty($link_target) )
+	if ( empty( $link_target ) )
 		$link_target = '';
 
-	if ( empty($link_visible) )
+	if ( empty( $link_visible ) )
 		$link_visible = 'Y';
 
-	if ( empty($link_owner) )
+	if ( empty( $link_owner ) )
 		$link_owner = $current_user-&gt;id;
 
-	if ( empty($link_notes) )
+	if ( empty( $link_notes ) )
 		$link_notes = '';
 
-	if ( empty($link_description) )
+	if ( empty( $link_description ) )
 		$link_description = '';
 
-	if ( empty($link_rss) )
+	if ( empty( $link_rss ) )
 		$link_rss = '';
 
-	if ( empty($link_rel) )
+	if ( empty( $link_rel ) )
 		$link_rel = '';
 
 	// Make sure we set a valid category
-	if (0 == count($link_category) || !is_array($link_category)) {
-		$link_category = array(get_option('default_link_category'));
+	if ( ! isset( $link_category ) ||0 == count( $link_category ) || !is_array( $link_category ) ) {
+		$link_category = array( get_option( 'default_link_category' ) );
 	}
 
 	if ( $update ) {
-		$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;UPDATE $wpdb-&gt;links SET link_url = %s,
-			link_name = %s, link_image = %s, link_target = %s, 
-			link_visible = %s, link_description = %s, link_rating = %s, 
+		if ( false === $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;UPDATE $wpdb-&gt;links SET link_url = %s,
+			link_name = %s, link_image = %s, link_target = %s,
+			link_visible = %s, link_description = %s, link_rating = %s,
 			link_rel = %s, link_notes = %s, link_rss = %s
-			WHERE link_id = %s&quot;, $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) );
+			WHERE link_id = %s&quot;, $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id ) ) ) {
+			if ( $wp_error )
+				return new WP_Error( 'db_update_error', __( 'Could not update link in the database' ), $wpdb-&gt;last_error );
+			else
+				return 0;
+		}
 	} else {
-		$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;INSERT INTO $wpdb-&gt;links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)&quot;, 
-		$link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) );
+		if ( false === $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;INSERT INTO $wpdb-&gt;links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)&quot;,
+		$link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss ) ) ) {
+			if ( $wp_error )
+				return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database' ), $wpdb-&gt;last_error );
+			else
+				return 0;
+		}
 		$link_id = (int) $wpdb-&gt;insert_id;
 	}
 
-	wp_set_link_cats($link_id, $link_category);
+	wp_set_link_cats( $link_id, $link_category );
 
 	if ( $update )
-		do_action('edit_link', $link_id);
+		do_action( 'edit_link', $link_id );
 	else
-		do_action('add_link', $link_id);
+		do_action( 'add_link', $link_id );
+
+	clean_bookmark_cache( $link_id );
 
 	return $link_id;
 }
 
-function wp_set_link_cats($link_id = 0, $link_categories = array()) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $link_id
+ * @param unknown_type $link_categories
+ */
+function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
 	// If $link_categories isn't already an array, make it one:
-	if (!is_array($link_categories) || 0 == count($link_categories))
-		$link_categories = array(get_option('default_link_category'));
+	if ( !is_array( $link_categories ) || 0 == count( $link_categories ) )
+		$link_categories = array( get_option( 'default_link_category' ) );
+
+	$link_categories = array_map( 'intval', $link_categories );
+	$link_categories = array_unique( $link_categories );
 
-	$link_categories = array_map('intval', $link_categories);
-	$link_categories = array_unique($link_categories);
+	wp_set_object_terms( $link_id, $link_categories, 'link_category' );
 
-	wp_set_object_terms($link_id, $link_categories, 'link_category');
+	clean_bookmark_cache( $link_id );
 }	// wp_set_link_cats()
 
-function wp_update_link($linkdata) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $linkdata
+ * @return unknown
+ */
+function wp_update_link( $linkdata ) {
 	$link_id = (int) $linkdata['link_id'];
 
-	$link = get_link($link_id, ARRAY_A);
+	$link = get_link( $link_id, ARRAY_A );
 
 	// Escape data pulled from DB.
-	$link = add_magic_quotes($link);
+	$link = add_magic_quotes( $link );
 
 	// Passed link category list overwrites existing category list if not empty.
-	if ( isset($linkdata['link_category']) &amp;&amp; is_array($linkdata['link_category'])
-			 &amp;&amp; 0 != count($linkdata['link_category']) )
+	if ( isset( $linkdata['link_category'] ) &amp;&amp; is_array( $linkdata['link_category'] )
+			 &amp;&amp; 0 != count( $linkdata['link_category'] ) )
 		$link_cats = $linkdata['link_category'];
 	else
 		$link_cats = $link['link_category'];
 
 	// Merge old and new fields with new fields overwriting old ones.
-	$linkdata = array_merge($link, $linkdata);
+	$linkdata = array_merge( $link, $linkdata );
 	$linkdata['link_category'] = $link_cats;
 
-	return wp_insert_link($linkdata);
+	return wp_insert_link( $linkdata );
 }
 
-?&gt;
\ No newline at end of file
+?&gt;</diff>
      <filename>wp-admin/includes/bookmark.php</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,20 @@
  * @link http://www.phpclasses.org/browse/package/1743.html Site
  * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
  */
+
+/**
+ * FTP implementation using fsockopen to connect.
+ *
+ * @package PemFTP
+ * @subpackage Pure
+ * @since 2.5
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ */
 class ftp extends ftp_base {
 
 	function ftp($verb=FALSE, $le=FALSE) {
@@ -172,4 +186,5 @@ class ftp extends ftp_base {
 		}
 	}
 }
+
 ?&gt;</diff>
      <filename>wp-admin/includes/class-ftp-pure.php</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,20 @@
  * @link http://www.phpclasses.org/browse/package/1743.html Site
  * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
  */
+
+/**
+ * Socket Based FTP implementation
+ *
+ * @package PemFTP
+ * @subpackage Socket
+ * @since 2.5
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ */
 class ftp extends ftp_base {
 
 	function ftp($verb=FALSE, $le=FALSE) {</diff>
      <filename>wp-admin/includes/class-ftp-sockets.php</filename>
    </modified>
    <modified>
      <diff>@@ -11,15 +11,75 @@
  * @link http://www.phpclasses.org/browse/package/1743.html Site
  * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
  */
+
+/**
+ * Defines the newline characters, if not defined already.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5
+ * @var string
+ */
 if(!defined('CRLF')) define('CRLF',&quot;\r\n&quot;);
+
+/**
+ * Sets whatever to autodetect ASCII mode.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5
+ * @var int
+ */
 if(!defined(&quot;FTP_AUTOASCII&quot;)) define(&quot;FTP_AUTOASCII&quot;, -1);
+
+/**
+ *
+ * This can be redefined.
+ * @since 2.5
+ * @var int
+ */
 if(!defined(&quot;FTP_BINARY&quot;)) define(&quot;FTP_BINARY&quot;, 1);
+
+/**
+ *
+ * This can be redefined.
+ * @since 2.5
+ * @var int
+ */
 if(!defined(&quot;FTP_ASCII&quot;)) define(&quot;FTP_ASCII&quot;, 0);
-if(!defined('FTP_FORCE')) define('FTP_FORCE', TRUE);
+
+/**
+ * Whether to force FTP.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5
+ * @var bool
+ */
+if(!defined('FTP_FORCE')) define('FTP_FORCE', true);
+
+/**
+ * @since 2.5
+ * @var string
+ */
 define('FTP_OS_Unix','u');
+
+/**
+ * @since 2.5
+ * @var string
+ */
 define('FTP_OS_Windows','w');
+
+/**
+ * @since 2.5
+ * @var string
+ */
 define('FTP_OS_Mac','m');
 
+/**
+ * PemFTP base class
+ *
+ */
 class ftp_base {
 	/* Public variables */
 	var $LocalEcho;
@@ -838,5 +898,6 @@ if (!extension_loaded('sockets')) {
 	$prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
 	if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE;
 }
+
 require_once &quot;class-ftp-&quot;.($mod_sockets?&quot;sockets&quot;:&quot;pure&quot;).&quot;.php&quot;;
 ?&gt;</diff>
      <filename>wp-admin/includes/class-ftp.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,51 +1,60 @@
 &lt;?php
-// --------------------------------------------------------------------------------
-// PhpConcept Library - Zip Module 2.5
-// --------------------------------------------------------------------------------
-// License GNU/LGPL - Vincent Blavet - March 2006
-// http://www.phpconcept.net
-// --------------------------------------------------------------------------------
-//
-// Presentation :
-//   PclZip is a PHP library that manage ZIP archives.
-//   So far tests show that archives generated by PclZip are readable by
-//   WinZip application and other tools.
-//
-// Description :
-//   See readme.txt and http://www.phpconcept.net
-//
-// Warning :
-//   This library and the associated files are non commercial, non professional
-//   work.
-//   It should not have unexpected results. However if any damage is caused by
-//   this software the author can not be responsible.
-//   The use of this software is at the risk of the user.
-//
-// --------------------------------------------------------------------------------
-// $Id: pclzip.lib.php,v 1.44 2006/03/08 21:23:59 vblavet Exp $
-// --------------------------------------------------------------------------------
-
-  // ----- Constants
-  define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
-
-  // ----- File list separator
-  // In version 1.x of PclZip, the separator for file list is a space
-  // (which is not a very smart choice, specifically for windows paths !).
-  // A better separator should be a comma (,). This constant gives you the
-  // abilty to change that.
-  // However notice that changing this value, may have impact on existing
-  // scripts, using space separated filenames.
-  // Recommanded values for compatibility with older versions :
-  //define( 'PCLZIP_SEPARATOR', ' ' );
-  // Recommanded values for smart separation of filenames.
-  define( 'PCLZIP_SEPARATOR', ',' );
-
-  // ----- Error configuration
-  // 0 : PclZip Class integrated error handling
-  // 1 : PclError external library error handling. By enabling this
-  //     you must ensure that you have included PclError library.
-  // [2,...] : reserved for futur use
-  define( 'PCLZIP_ERROR_EXTERNAL', 0 );
+/**
+ * PhpConcept Library - Zip Module 2.5
+ *
+ * Presentation :
+ *   PclZip is a PHP library that manage ZIP archives.
+ *   So far tests show that archives generated by PclZip are readable by
+ *   WinZip application and other tools.
+ *
+ * Warning :
+ *   This library and the associated files are non commercial, non professional
+ *   work.
+ *   It should not have unexpected results. However if any damage is caused by
+ *   this software the author can not be responsible.
+ *   The use of this software is at the risk of the user.
+ *
+ * @package External
+ * @subpackage PclZip
+ *
+ * @license License GNU/LGPL
+ * @copyright March 2006 Vincent Blavet
+ * @author Vincent Blavet
+ * @link http://www.phpconcept.net
+ * @version $Id: pclzip.lib.php,v 1.44 2006/03/08 21:23:59 vblavet Exp $
+ */
+
+/**
+ * The read block size for reading zip files.
+ *
+ * @since 2.5
+ */
+define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
+
+/**
+ * File list separator
+ *
+ * In version 1.x of PclZip, the separator for file list is a space(which is not
+ * a very smart choice, specifically for windows paths !). A better separator
+ * should be a comma (,). This constant gives you the abilty to change that.
+ *
+ * However notice that changing this value, may have impact on existing scripts,
+ * using space separated filenames. Recommanded values for compatibility with
+ * older versions :
+ * &lt;code&gt;define( 'PCLZIP_SEPARATOR', ' ' );&lt;/code&gt;
+ * Recommanded values for smart separation of filenames.
+ */
+define( 'PCLZIP_SEPARATOR', ',' );
+
+/**
+ * Error configuration
+ *
+ * 0 : PclZip Class integrated error handling
+ * 1 : PclError external library error handling. By enabling this you must
+ *     ensure that you have included PclError library.
+ * [2,...] : reserved for future use
+ */
+define( 'PCLZIP_ERROR_EXTERNAL', 0 );
 
   // ----- Optional static temporary directory
   //       By default temporary files are generated in the script current
@@ -137,7 +146,7 @@
   define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
   define( 'PCLZIP_CB_PRE_ADD', 78003 );
   define( 'PCLZIP_CB_POST_ADD', 78004 );
-  /* For futur use
+  /* For future use
   define( 'PCLZIP_CB_PRE_LIST', 78005 );
   define( 'PCLZIP_CB_POST_LIST', 78006 );
   define( 'PCLZIP_CB_PRE_DELETE', 78007 );</diff>
      <filename>wp-admin/includes/class-pclzip.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,41 +1,150 @@
 &lt;?php
-class WP_Filesystem_Base{
+/**
+ * Base WordPress Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * Base WordPress Filesystem class for which Filesystem implementations extend
+ *
+ * @since 2.5
+ */
+class WP_Filesystem_Base {
+	/**
+	 * Whether to display debug data for the connection or not.
+	 *
+	 * @since 2.5
+	 * @access public
+	 * @var bool
+	 */
 	var $verbose = false;
+	/**
+	 * Cached list of local filepaths to maped remote filepaths.
+	 *
+	 * @since 2.7
+	 * @access private
+	 * @var array
+	 */
 	var $cache = array();
-	
+
+	/**
+	 * The Access method of the current connection, Set automatically.
+	 *
+	 * @since 2.5
+	 * @access public
+	 * @var string
+	 */
 	var $method = '';
-	
+
+	/**
+	 * Returns the path on the remote filesystem of ABSPATH
+	 *
+	 * @since 2.7
+	 * @access public
+	 * @return string The location of the remote path.
+	 */
 	function abspath() {
-		if ( defined('FTP_BASE') &amp;&amp; strpos($this-&gt;method, 'ftp') !== false ) 
+		if ( defined('FTP_BASE') &amp;&amp; strpos($this-&gt;method, 'ftp') !== false )
 			return FTP_BASE;
-		return $this-&gt;find_folder(ABSPATH);
+		$folder = $this-&gt;find_folder(ABSPATH);
+		//Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
+		if ( ! $folder &amp;&amp; $this-&gt;is_dir('/wp-includes') )
+			$folder = '/';
+		return $folder;
 	}
+	/**
+	 * Returns the path on the remote filesystem of WP_CONTENT_DIR
+	 *
+	 * @since 2.7
+	 * @access public
+	 * @return string The location of the remote path.
+	 */
 	function wp_content_dir() {
-		if ( defined('FTP_CONTENT_DIR') &amp;&amp; strpos($this-&gt;method, 'ftp') !== false ) 
+		if ( defined('FTP_CONTENT_DIR') &amp;&amp; strpos($this-&gt;method, 'ftp') !== false )
 			return FTP_CONTENT_DIR;
 		return $this-&gt;find_folder(WP_CONTENT_DIR);
 	}
+	/**
+	 * Returns the path on the remote filesystem of WP_PLUGIN_DIR
+	 *
+	 * @since 2.7
+	 * @access public
+	 *
+	 * @return string The location of the remote path.
+	 */
 	function wp_plugins_dir() {
-		if ( defined('FTP_PLUGIN_DIR') &amp;&amp; strpos($this-&gt;method, 'ftp') !== false ) 
+		if ( defined('FTP_PLUGIN_DIR') &amp;&amp; strpos($this-&gt;method, 'ftp') !== false )
 			return FTP_PLUGIN_DIR;
 		return $this-&gt;find_folder(WP_PLUGIN_DIR);
 	}
+	/**
+	 * Returns the path on the remote filesystem of the Themes Directory
+	 *
+	 * @since 2.7
+	 * @access public
+	 *
+	 * @return string The location of the remote path.
+	 */
 	function wp_themes_dir() {
 		return $this-&gt;wp_content_dir() . '/themes';
 	}
-	//Back compat: use abspath() or wp_*_dir
+
+	/**
+	 * Locates a folder on the remote filesystem.
+	 *
+	 * Deprecated; use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead.
+	 *
+	 * @since 2.5
+	 * @deprecated 2.7
+	 * @access public
+	 *
+	 * @param string $base The folder to start searching from
+	 * @param bool $echo True to display debug information
+	 * @return string The location of the remote path.
+	 */
 	function find_base_dir($base = '.', $echo = false) {
+		_deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );
 		$this-&gt;verbose = $echo;
 		return $this-&gt;abspath();
 	}
-	//Back compat: use ::abspath() or ::wp_*_dir
+	/**
+	 * Locates a folder on the remote filesystem.
+	 *
+	 * Deprecated; use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead.
+	 *
+	 * @since 2.5
+	 * @deprecated 2.7
+	 * @access public
+	 *
+	 * @param string $base The folder to start searching from
+	 * @param bool $echo True to display debug information
+	 * @return string The location of the remote path.
+	 */
 	function get_base_dir($base = '.', $echo = false) {
+		_deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );
 		$this-&gt;verbose = $echo;
 		return $this-&gt;abspath();
 	}
-	
+
+	/**
+	 * Locates a folder on the remote filesystem.
+	 *
+	 * Assumes that on Windows systems, Stripping off the Drive letter is OK
+	 * Sanitizes \\ to / in windows filepaths.
+	 *
+	 * @since 2.7
+	 * @access public
+	 *
+	 * @param string $folder the folder to locate
+	 * @return string The location of the remote path.
+	 */
 	function find_folder($folder) {
-		$folder = str_replace('\\', '/', $folder); //Windows Sanitiation
+
+		$folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
+		$folder = str_replace('\\', '/', $folder); //Windows path sanitiation
+
 		if ( isset($this-&gt;cache[ $folder ] ) )
 			return $this-&gt;cache[ $folder ];
 
@@ -47,26 +156,37 @@ class WP_Filesystem_Base{
 			$this-&gt;cache[ $folder ] = $return;
 		return $return;
 	}
-	
-	// Assumes $folder is windows sanitized;
-	// Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers.
+
+	/**
+	 * Locates a folder on the remote filesystem.
+	 *
+	 * Expects Windows sanitized path
+	 *
+	 * @since 2.7
+	 * @access private
+	 *
+	 * @param string $folder the folder to locate
+	 * @param string $base the folder to start searching from
+	 * @param bool $loop if the function has recursed, Internal use only
+	 * @return string The location of the remote path.
+	 */
 	function search_for_folder($folder, $base = '.', $loop = false ) {
 		if ( empty( $base ) || '.' == $base )
 			$base = trailingslashit($this-&gt;cwd());
-		
-		$folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
-		
+
+		$folder = untrailingslashit($folder);
+
 		$folder_parts = explode('/', $folder);
 		$last_path = $folder_parts[ count($folder_parts) - 1 ];
-		
+
 		$files = $this-&gt;dirlist( $base );
-		
+
 		foreach ( $folder_parts as $key ) {
 			if ( $key == $last_path )
 				continue; //We want this to be caught by the next code block.
 
-			//Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, 
-			// If its found, change into it and follow through looking for it. 
+			//Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
+			// If its found, change into it and follow through looking for it.
 			// If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
 			// If it reaches the end, and still cant find it, it'll return false for the entire function.
 			if( isset($files[ $key ]) ){
@@ -78,7 +198,7 @@ class WP_Filesystem_Base{
 					return $ret;
 			}
 		}
-		
+
 		//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
 		if(isset( $files[ $last_path ] ) ) {
 			if( $this-&gt;verbose )
@@ -88,13 +208,23 @@ class WP_Filesystem_Base{
 		if( $loop )
 			return false;//Prevent tihs function looping again.
 		//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
-		return $this-&gt;search_for_folder($folder, '/', true); 
-		
+		return $this-&gt;search_for_folder($folder, '/', true);
+
 	}
-	
-	//Common Helper functions.
+
+	/**
+	 * Returns the *nix style file permissions for a file
+	 *
+	 * From the PHP documentation page for fileperms()
+	 *
+	 * @link http://docs.php.net/fileperms
+	 * @since 2.5
+	 * @access public
+	 *
+	 * @param string $file string filename
+	 * @return int octal representation of permissions
+	 */
 	function gethchmod($file){
-		//From the PHP.net page for ...?
 		$perms = $this-&gt;getchmod($file);
 		if (($perms &amp; 0xC000) == 0xC000) // Socket
 			$info = 's';
@@ -135,24 +265,52 @@ class WP_Filesystem_Base{
 					(($perms &amp; 0x0200) ? 'T' : '-'));
 		return $info;
 	}
+
+	/**
+	 * Converts *nix style file permissions to a octal number.
+	 *
+	 * Converts '-rw-r--r--' to 0644
+	 * From &quot;info at rvgate dot nl&quot;'s comment on the PHP documentation for chmod()
+ 	 *
+	 * @link http://docs.php.net/manual/en/function.chmod.php#49614
+	 * @since 2.5
+	 * @access public
+	 *
+	 * @param string $mode string *nix style file permission
+	 * @return int octal representation
+	 */
 	function getnumchmodfromh($mode) {
-		$realmode = &quot;&quot;;
-		$legal =  array(&quot;&quot;, &quot;w&quot;, &quot;r&quot;, &quot;x&quot;, &quot;-&quot;);
-		$attarray = preg_split(&quot;//&quot;, $mode);
+		$realmode = '';
+		$legal =  array('', 'w', 'r', 'x', '-');
+		$attarray = preg_split('//', $mode);
 
 		for($i=0; $i &lt; count($attarray); $i++)
 		   if($key = array_search($attarray[$i], $legal))
 			   $realmode .= $legal[$key];
-			   
+
 		$mode = str_pad($realmode, 9, '-');
 		$trans = array('-'=&gt;'0', 'r'=&gt;'4', 'w'=&gt;'2', 'x'=&gt;'1');
 		$mode = strtr($mode,$trans);
-		
+
 		$newmode = '';
 		$newmode .= $mode[0] + $mode[1] + $mode[2];
 		$newmode .= $mode[3] + $mode[4] + $mode[5];
 		$newmode .= $mode[6] + $mode[7] + $mode[8];
 		return $newmode;
 	}
+
+	/**
+	 * Determines if the string provided contains binary characters.
+	 *
+	 * @since 2.7
+	 * @access private
+	 *
+	 * @param string $text String to test against
+	 * @return bool true if string is binary, false otherwise
+	 */
+	function is_binary( $text ) {
+		return (bool) preg_match('|[^\x20-\x7E]|', $text); //chr(32)..chr(127)
+	}
 }
+
 ?&gt;</diff>
      <filename>wp-admin/includes/class-wp-filesystem-base.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,19 @@
 &lt;?php
+/**
+ * WordPress Direct Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
 
+/**
+ * WordPress Filesystem Class for direct PHP file and folder manipulation.
+ *
+ * @since 2.5
+ * @package WordPress
+ * @subpackage Filesystem
+ * @uses WP_Filesystem_Base Extends class
+ */
 class WP_Filesystem_Direct  extends WP_Filesystem_Base {
 	var $permission = null;
 	var $errors = array();
@@ -218,7 +232,9 @@ class WP_Filesystem_Direct  extends WP_Filesystem_Base {
 			return false;
 
 		$ret = array();
-		$dir = dir($path);
+		$dir = @dir($path);
+		if ( ! $dir )
+			return false;
 		while (false !== ($entry = $dir-&gt;read()) ) {
 			$struc = array();
 			$struc['name'] = $entry;</diff>
      <filename>wp-admin/includes/class-wp-filesystem-direct.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,20 @@
 &lt;?php
-class WP_Filesystem_FTPext extends WP_Filesystem_Base{
+/**
+ * WordPress FTP Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * WordPress Filesystem Class for implementing FTP.
+ *
+ * @since 2.5
+ * @package WordPress
+ * @subpackage Filesystem
+ * @uses WP_Filesystem_Base Extends class
+ */
+class WP_Filesystem_FTPext extends WP_Filesystem_Base {
 	var $link;
 	var $timeout = 5;
 	var $errors = array();
@@ -7,21 +22,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base{
 
 	var $permission = null;
 
-	var $filetypes = array(
-							'php'=&gt;FTP_ASCII,
-							'css'=&gt;FTP_ASCII,
-							'txt'=&gt;FTP_ASCII,
-							'js'=&gt;FTP_ASCII,
-							'html'=&gt;FTP_ASCII,
-							'htm'=&gt;FTP_ASCII,
-							'xml'=&gt;FTP_ASCII,
-
-							'jpg'=&gt;FTP_BINARY,
-							'png'=&gt;FTP_BINARY,
-							'gif'=&gt;FTP_BINARY,
-							'bmp'=&gt;FTP_BINARY
-							);
-
 	function WP_Filesystem_FTPext($opt='') {
 		$this-&gt;method = 'ftpext';
 		$this-&gt;errors = new WP_Error();
@@ -57,7 +57,11 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base{
 		else
 			$this-&gt;options['password'] = $opt['password'];
 
-		$this-&gt;options['ssl'] = ( !empty($opt['ssl']) );
+		$this-&gt;options['ssl'] = false;
+		if ( isset($opt['ssl']) )
+			$this-&gt;options['ssl'] = ( !empty($opt['ssl']) );
+		elseif ( isset( $opt['connection_type']) )
+			$this-&gt;options['ssl'] = ( 'ftps' == $opt['connection_type'] );
 	}
 
 	function connect() {
@@ -76,28 +80,33 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base{
 			return false;
 		}
 
+		//Set the Connection to use Passive FTP
+		@ftp_pasv( $this-&gt;link, true );
+
 		return true;
 	}
 
 	function setDefaultPermissions($perm) {
 		$this-&gt;permission = $perm;
 	}
-	
+
 	function get_contents($file, $type = '', $resumepos = 0 ){
-		if( empty($type) ){
-			$extension = substr(strrchr($file, &quot;.&quot;), 1);
-			$type = isset($this-&gt;filetypes[ $extension ]) ? $this-&gt;filetypes[ $extension ] : FTP_ASCII;
-		}
+		if( empty($type) )
+			$type = FTP_BINARY;
+
 		$temp = tmpfile();
 		if ( ! $temp )
 			return false;
+
 		if( ! @ftp_fget($this-&gt;link, $temp, $file, $type, $resumepos) )
 			return false;
+
 		fseek($temp, 0); //Skip back to the start of the file being written to
 		$contents = '';
-		while (!feof($temp)) {
+
+		while ( ! feof($temp) )
 			$contents .= fread($temp, 8192);
-		}
+
 		fclose($temp);
 		return $contents;
 	}
@@ -105,21 +114,23 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base{
 		return explode(&quot;\n&quot;, $this-&gt;get_contents($file));
 	}
 	function put_contents($file, $contents, $type = '' ) {
-		if( empty($type) ) {
-			$extension = substr(strrchr($file, &quot;.&quot;), 1);
-			$type = isset($this-&gt;filetypes[ $extension ]) ? $this-&gt;filetypes[ $extension ] : FTP_ASCII;
-		}
+		if( empty($type) )
+			$type = $this-&gt;is_binary($contents) ? FTP_BINARY : FTP_ASCII;
+
 		$temp = tmpfile();
 		if ( ! $temp )
 			return false;
+
 		fwrite($temp, $contents);
 		fseek($temp, 0); //Skip back to the start of the file being written to
+
 		$ret = @ftp_fput($this-&gt;link, $file, $temp, $type);
+
 		fclose($temp);
 		return $ret;
 	}
 	function cwd() {
-		$cwd = ftp_pwd($this-&gt;link);
+		$cwd = @ftp_pwd($this-&gt;link);
 		if( $cwd )
 			$cwd = trailingslashit($cwd);
 		return $cwd;</diff>
      <filename>wp-admin/includes/class-wp-filesystem-ftpext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,19 @@
 &lt;?php
+/**
+ * WordPress FTP Sockets Filesystem.
+ *
+ * @package WordPress
+ * @subpackage Filesystem
+ */
+
+/**
+ * WordPress Filesystem Class for implementing FTP Sockets.
+ *
+ * @since 2.5
+ * @package WordPress
+ * @subpackage Filesystem
+ * @uses WP_Filesystem_Base Extends class
+ */
 class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 	var $ftp = false;
 	var $timeout = 5;
@@ -7,22 +22,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 
 	var $permission = null;
 
-	var $filetypes = array(
-							'php' =&gt; FTP_ASCII,
-							'css' =&gt; FTP_ASCII,
-							'txt' =&gt; FTP_ASCII,
-							'js'  =&gt; FTP_ASCII,
-							'html'=&gt; FTP_ASCII,
-							'htm' =&gt; FTP_ASCII,
-							'xml' =&gt; FTP_ASCII,
-
-							'jpg' =&gt; FTP_BINARY,
-							'png' =&gt; FTP_BINARY,
-							'gif' =&gt; FTP_BINARY,
-							'bmp' =&gt; FTP_BINARY
-							);
-
-	function WP_Filesystem_ftpsockets($opt='') {
+	function WP_Filesystem_ftpsockets($opt = '') {
 		$this-&gt;method = 'ftpsockets';
 		$this-&gt;errors = new WP_Error();
 
@@ -86,51 +86,57 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 		$this-&gt;permission = $perm;
 	}
 
-	function get_contents($file, $type = '', $resumepos = 0){
+	function get_contents($file, $type = '', $resumepos = 0) {
 		if( ! $this-&gt;exists($file) )
 			return false;
 
-		if( empty($type) ){
-			$extension = substr(strrchr($file, '.'), 1);
-			$type = isset($this-&gt;filetypes[ $extension ]) ? $this-&gt;filetypes[ $extension ] : FTP_AUTOASCII;
-		}
+		if( empty($type) )
+			$type = FTP_AUTOASCII;
 		$this-&gt;ftp-&gt;SetType($type);
+
 		$temp = wp_tempnam( $file );
+
 		if ( ! $temphandle = fopen($temp, 'w+') )
 			return false;
+
 		if ( ! $this-&gt;ftp-&gt;fget($temphandle, $file) ) {
 			fclose($temphandle);
 			unlink($temp);
 			return ''; //Blank document, File does exist, Its just blank.
 		}
+
 		fseek($temphandle, 0); //Skip back to the start of the file being written to
 		$contents = '';
+
 		while ( ! feof($temphandle) )
 			$contents .= fread($temphandle, 8192);
+
 		fclose($temphandle);
 		unlink($temp);
 		return $contents;
 	}
 
-	function get_contents_array($file){
+	function get_contents_array($file) {
 		return explode(&quot;\n&quot;, $this-&gt;get_contents($file) );
 	}
 
 	function put_contents($file, $contents, $type = '' ) {
-		if( empty($type) ){
-			$extension = substr(strrchr($file, '.'), 1);
-			$type = isset($this-&gt;filetypes[ $extension ]) ? $this-&gt;filetypes[ $extension ] : FTP_AUTOASCII;
-		}
+		if( empty($type) )
+			$type = $this-&gt;is_binary($contents) ? FTP_BINARY : FTP_ASCII;
+
 		$this-&gt;ftp-&gt;SetType($type);
 
 		$temp = wp_tempnam( $file );
 		if ( ! $temphandle = fopen($temp, 'w+') ){
-			unlink($temp);		
+			unlink($temp);
 			return false;
 		}
+
 		fwrite($temphandle, $contents);
 		fseek($temphandle, 0); //Skip back to the start of the file being written to
+
 		$ret = $this-&gt;ftp-&gt;fput($file, $temphandle);
+
 		fclose($temphandle);
 		unlink($temp);
 		return $ret;
@@ -146,12 +152,12 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 	function chdir($file) {
 		return $this-&gt;ftp-&gt;chdir($file);
 	}
-	
+
 	function chgrp($file, $group, $recursive = false ) {
 		return false;
 	}
 
-	function chmod($file, $mode = false, $recursive = false ){
+	function chmod($file, $mode = false, $recursive = false ) {
 		if( ! $mode )
 			$mode = $this-&gt;permission;
 		if( ! $mode )
@@ -251,7 +257,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 		return $this-&gt;ftp-&gt;filesize($file);
 	}
 
-	function touch($file, $time = 0, $atime = 0 ){
+	function touch($file, $time = 0, $atime = 0 ) {
 		return false;
 	}
 
@@ -311,8 +317,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 		return $ret;
 	}
 
-	function __destruct(){
+	function __destruct() {
 		$this-&gt;ftp-&gt;quit();
 	}
 }
+
 ?&gt;</diff>
      <filename>wp-admin/includes/class-wp-filesystem-ftpsockets.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,21 @@
 &lt;?php
-
+/**
+ * WordPress Comment Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ * @uses $wpdb
+ *
+ * @param string $comment_author
+ * @param string $comment_date
+ * @return mixed Comment ID on success.
+ */
 function comment_exists($comment_author, $comment_date) {
 	global $wpdb;
 
@@ -7,6 +23,11 @@ function comment_exists($comment_author, $comment_date) {
 			WHERE comment_author = %s AND comment_date = %s&quot;, $comment_author, $comment_date) );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function edit_comment() {
 
 	$comment_post_ID = (int) $_POST['comment_post_ID'];
@@ -28,7 +49,6 @@ function edit_comment() {
 		}
 	}
 
-
 	if (!empty ( $_POST['edit_date'] ) ) {
 		$aa = $_POST['aa'];
 		$mm = $_POST['mm'];
@@ -46,6 +66,14 @@ function edit_comment() {
 	wp_update_comment( $_POST);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @return unknown
+ */
 function get_comment_to_edit( $id ) {
 	if ( !$comment = get_comment($id) )
 		return false;
@@ -64,6 +92,15 @@ function get_comment_to_edit( $id ) {
 	return $comment;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ * @uses $wpdb
+ *
+ * @param int $post_id Post ID
+ * @return unknown
+ */
 function get_pending_comments_num( $post_id ) {
 	global $wpdb;
 
@@ -90,8 +127,15 @@ function get_pending_comments_num( $post_id ) {
 	return $pending_keyed;
 }
 
-// Add avatars to relevant places in admin, or try to
-
+/**
+ * Add avatars to relevant places in admin, or try to.
+ *
+ * @since unknown
+ * @uses $comment
+ *
+ * @param string $name User name.
+ * @return string Avatar with Admin name.
+ */
 function floated_admin_avatar( $name ) {
 	global $comment;
 
@@ -107,6 +151,11 @@ function floated_admin_avatar( $name ) {
 	return &quot;$avatar $name&quot;;
 }
 
+function enqueue_comment_hotkeys_js() {
+	if ( 'true' == get_user_option( 'comment_shortcuts' ) )
+		wp_enqueue_script( 'jquery-table-hotkeys' );
+}
+
 if ( is_admin() &amp;&amp; ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
 	if ( get_option('show_avatars') )
 		add_filter( 'comment_author', 'floated_admin_avatar' );</diff>
      <filename>wp-admin/includes/comment.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,39 +1,35 @@
 &lt;?php
-
-// Registers dashboard widgets, handles POST data, sets up filters
+/**
+ * WordPress Dashboard Widget Administration Panel API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Registers dashboard widgets.
+ *
+ * handles POST data, sets up filters.
+ *
+ * @since unknown
+ */
 function wp_dashboard_setup() {
-	global $wpdb, $wp_dashboard_sidebars;
+	global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
+	$wp_dashboard_control_callbacks = array();
+
 	$update = false;
 	$widget_options = get_option( 'dashboard_widget_options' );
 	if ( !$widget_options || !is_array($widget_options) )
 		$widget_options = array();
 
-
-	/* Register WP Dashboard Dynamic Sidebar */
-	register_sidebar( array(
-		'name' =&gt; 'WordPress Dashboard',
-		'id' =&gt; 'wp_dashboard',
-		'before_widget' =&gt; &quot;\t&lt;div class='dashboard-widget-holder %2\$s' id='%1\$s'&gt;\n\n\t\t&lt;div class='dashboard-widget'&gt;\n\n&quot;,
-		'after_widget' =&gt; &quot;\t\t&lt;/div&gt;\n\n\t&lt;/div&gt;\n\n&quot;,
-		'before_title' =&gt; &quot;\t\t\t&lt;h3 class='dashboard-widget-title'&gt;&quot;,
-		'after_title' =&gt; &quot;&lt;/h3&gt;\n\n&quot;
-	) );
-
-
 	/* Register Widgets and Controls */
 
+	// Right Now
+	wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
+
 	// Recent Comments Widget
-	$mod_comments = wp_count_comments();
-	$mod_comments = $mod_comments-&gt;moderated;
-	if ( current_user_can( 'moderate_comments' ) &amp;&amp; $mod_comments ) {
-		$notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments );
-		$notice = &quot;&lt;a href='edit-comments.php?comment_status=moderated'&gt;$notice&lt;/a&gt;&quot;;
-	} else {
-		$notice = '';
-	}
-	wp_register_sidebar_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments',
-		array( 'all_link' =&gt; 'edit-comments.php', 'notice' =&gt; $notice, 'width' =&gt; 'half' )
-	);
+	$recent_comments_title = __( 'Recent Comments' );
+	wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments' );
 
 	// Incoming Links Widget
 	if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
@@ -42,25 +38,23 @@ function wp_dashboard_setup() {
 			'home' =&gt; get_option('home'),
 			'link' =&gt; apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&amp;scoring=d&amp;partner=wordpress&amp;q=link:' . trailingslashit( get_option('home') ) ),
 			'url' =&gt; apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&amp;scoring=d&amp;ie=utf-8&amp;num=10&amp;output=rss&amp;partner=wordpress&amp;q=link:' . trailingslashit( get_option('home') ) ),
-			'items' =&gt; 5,
-			'show_date' =&gt; 0
+			'items' =&gt; isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
+			'show_date' =&gt; isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
 		);
 	}
-	wp_register_sidebar_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_empty',
-		array( 'all_link' =&gt; $widget_options['dashboard_incoming_links']['link'], 'feed_link' =&gt; $widget_options['dashboard_incoming_links']['url'], 'width' =&gt; 'half' ),
-		'wp_dashboard_cached_rss_widget', 'wp_dashboard_incoming_links_output'
-	);
-	wp_register_widget_control( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_rss_control', array(),
-		array( 'widget_id' =&gt; 'dashboard_incoming_links', 'form_inputs' =&gt; array( 'title' =&gt; false, 'show_summary' =&gt; false, 'show_author' =&gt; false ) )
-	);
-
+	wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
 
 	// WP Plugins Widget
-	wp_register_sidebar_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_empty',
-		array( 'all_link' =&gt; 'http://wordpress.org/extend/plugins/', 'feed_link' =&gt; 'http://wordpress.org/extend/plugins/rss/topics/', 'width' =&gt; 'half' ),
-		'wp_dashboard_cached_rss_widget', 'wp_dashboard_plugins_output',
-		array( 'http://wordpress.org/extend/plugins/rss/browse/popular/', 'http://wordpress.org/extend/plugins/rss/browse/new/', 'http://wordpress.org/extend/plugins/rss/browse/updated/' )
-	);
+	if ( current_user_can( 'activate_plugins' ) )
+		wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
+
+	// QuickPress Widget
+	if ( current_user_can('edit_posts') )
+		wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
+
+	// Recent Drafts
+	if ( current_user_can('edit_posts') )
+		wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
 
 	// Primary feed (Dev Blog) Widget
 	if ( !isset( $widget_options['dashboard_primary'] ) ) {
@@ -75,14 +69,7 @@ function wp_dashboard_setup() {
 			'show_date' =&gt; 1
 		);
 	}
-	wp_register_sidebar_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_empty',
-		array( 'all_link' =&gt; $widget_options['dashboard_primary']['link'], 'feed_link' =&gt; $widget_options['dashboard_primary']['url'], 'width' =&gt; 'half', 'class' =&gt; 'widget_rss' ),
-		'wp_dashboard_cached_rss_widget', 'wp_dashboard_rss_output'
-	);
-	wp_register_widget_control( 'dashboard_primary', __( 'Primary Feed' ), 'wp_dashboard_rss_control', array(),
-		array( 'widget_id' =&gt; 'dashboard_primary' )
-	);
-
+	wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' );
 
 	// Secondary Feed (Planet) Widget
 	if ( !isset( $widget_options['dashboard_secondary'] ) ) {
@@ -91,60 +78,21 @@ function wp_dashboard_setup() {
 			'link' =&gt; apply_filters( 'dashboard_secondary_link',  __( 'http://planet.wordpress.org/' ) ),
 			'url' =&gt; apply_filters( 'dashboard_secondary_feed',  __( 'http://planet.wordpress.org/feed/' ) ),
 			'title' =&gt; apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
-			'items' =&gt; 15
+			'items' =&gt; 5
 		);
 	}
-	wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty',
-		array( 'all_link' =&gt; $widget_options['dashboard_secondary']['link'], 'feed_link' =&gt; $widget_options['dashboard_secondary']['url'], 'width' =&gt; 'full' ),
-		'wp_dashboard_cached_rss_widget', 'wp_dashboard_secondary_output'
-	);
-	wp_register_widget_control( 'dashboard_secondary', __( 'Secondary Feed' ), 'wp_dashboard_rss_control', array(),
-		array( 'widget_id' =&gt; 'dashboard_secondary', 'form_inputs' =&gt; array( 'show_summary' =&gt; false, 'show_author' =&gt; false, 'show_date' =&gt; false ) )
-	);
-
-
-		/* Dashboard Widget Template
-		wp_register_sidebar_widget( $widget_id (unique slug) , $widget_title, $output_callback,
-			array(
-				'all_link'  =&gt; full url for &quot;See All&quot; link,
-				'feed_link' =&gt; full url for &quot;RSS&quot; link,
-				'width'     =&gt; 'fourth', 'third', 'half', 'full' (defaults to 'half'),
-				'height'    =&gt; 'single', 'double' (defaults to 'single'),
-			),
-			$wp_dashboard_empty_callback (only needed if using 'wp_dashboard_empty' as your $output_callback),
-			$arg, $arg, $arg... (further args passed to callbacks)
-		);
-
-		// optional: if you want users to be able to edit the settings of your widget, you need to register a widget_control
-		wp_register_widget_control( $widget_id, $widget_control_title, $control_output_callback,
-			array(), // leave an empty array here: oddity in widget code
-			array(
-				'widget_id' =&gt; $widget_id, // Yes - again.  This is required: oddity in widget code
-				'arg'       =&gt; an arg to pass to the $control_output_callback,
-				'another'   =&gt; another arg to pass to the $control_output_callback,
-				...
-			)
-		);
-		*/
+	wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );
 
 	// Hook to register new widgets
 	do_action( 'wp_dashboard_setup' );
 
-	// Hard code the sidebar's widgets and order
-	$dashboard_widgets = array();
-	$dashboard_widgets[] = 'dashboard_recent_comments';
-	$dashboard_widgets[] = 'dashboard_incoming_links';
-	$dashboard_widgets[] = 'dashboard_primary';
-	if ( current_user_can( 'activate_plugins' ) )
-		$dashboard_widgets[] = 'dashboard_plugins';
-	$dashboard_widgets[] = 'dashboard_secondary';
-
 	// Filter widget order
-	$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets );
+	$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
 
-	$wp_dashboard_sidebars = array( 'wp_dashboard' =&gt; $dashboard_widgets, 'array_version' =&gt; 3.5 );
-
-	add_filter( 'dynamic_sidebar_params', 'wp_dashboard_dynamic_sidebar_params' );
+	foreach ( $dashboard_widgets as $widget_id ) {
+		$name = empty( $wp_registered_widgets[$widget_id]['all_link'] ) ? $wp_registered_widgets[$widget_id]['name'] : $wp_registered_widgets[$widget_id]['name'] . &quot; &lt;a href='{$wp_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'&gt;&quot; . __('View all') . '&lt;/a&gt;';
+		wp_add_dashboard_widget( $widget_id, $name, $wp_registered_widgets[$widget_id]['callback'], $wp_registered_widget_controls[$widget_id]['callback'] );
+	}
 
 	if ( 'POST' == $_SERVER['REQUEST_METHOD'] &amp;&amp; isset($_POST['widget_id']) ) {
 		ob_start(); // hack - but the same hack wp-admin/widgets.php uses
@@ -156,162 +104,447 @@ function wp_dashboard_setup() {
 
 	if ( $update )
 		update_option( 'dashboard_widget_options', $widget_options );
+
+	do_action('do_meta_boxes', 'dashboard', 'normal', '');
+	do_action('do_meta_boxes', 'dashboard', 'side', '');
 }
 
-// Echoes out the dashboard
-function wp_dashboard() {
-	echo &quot;&lt;div id='dashboard-widgets'&gt;\n\n&quot;;
+function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) {
+	global $wp_dashboard_control_callbacks;
+	if ( $control_callback &amp;&amp; current_user_can( 'edit_dashboard' ) &amp;&amp; is_callable( $control_callback ) ) {
+		$wp_dashboard_control_callbacks[$widget_id] = $control_callback;
+		if ( isset( $_GET['edit'] ) &amp;&amp; $widget_id == $_GET['edit'] ) {
+			list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
+			$widget_name .= ' &lt;span class=&quot;postbox-title-action&quot;&gt;&lt;a href=&quot;' . clean_url( $url ) . '&quot;&gt;' . __( 'Cancel' ) . '&lt;/a&gt;&lt;/span&gt;';
+			add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', 'dashboard', 'normal', 'core' );
+			return;
+		}
+		list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
+		$widget_name .= ' &lt;span class=&quot;postbox-title-action&quot;&gt;&lt;a href=&quot;' . clean_url( &quot;$url#$widget_id&quot; ) . '&quot; class=&quot;edit-box open-box&quot;&gt;' . __( 'Configure' ) . '&lt;/a&gt;&lt;/span&gt;';
+	}
+	$side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
+	$location = 'normal';
+	if ( in_array($widget_id, $side_widgets) )
+		$location = 'side';
+	add_meta_box( $widget_id, $widget_name , $callback, 'dashboard', $location, 'core' );
+}
 
-	// We're already filtering dynamic_sidebar_params obove
-	add_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); // here there be hackery
-	dynamic_sidebar( 'wp_dashboard' );
-	remove_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' );
+function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
+	echo '&lt;form action=&quot;&quot; method=&quot;post&quot; class=&quot;dashboard-widget-control-form&quot;&gt;';
+	wp_dashboard_trigger_widget_control( $meta_box['id'] );
+	echo &quot;&lt;p class='submit'&gt;&lt;input type='hidden' name='widget_id' value='$meta_box[id]' /&gt;&lt;input type='submit' value='&quot; . __( 'Submit' ) . &quot;' /&gt;&lt;/p&gt;&quot;;
 
-	echo &quot;&lt;br class='clear' /&gt;\n&lt;/div&gt;\n\n\n&quot;;
+	echo '&lt;/form&gt;';
 }
 
-// Makes sidebar_widgets option reflect the dashboard settings
-function wp_dashboard_sidebars_widgets() { // hackery
-	return $GLOBALS['wp_dashboard_sidebars'];
+/**
+ * Displays the dashboard.
+ *
+ * @since unknown
+ */
+function wp_dashboard() {
+	echo &quot;&lt;div id='dashboard-widgets' class='metabox-holder'&gt;\n\n&quot;;
+
+	echo &quot;&lt;div id='side-info-column' class='inner-sidebar'&gt;\n\n&quot;;
+	$class = do_meta_boxes( 'dashboard', 'side', '' ) ? ' class=&quot;has-sidebar&quot;' : '';
+	echo &quot;&lt;/div&gt;\n\n&quot;;
+
+	echo &quot;&lt;div id='post-body'$class&gt;\n\n&quot;;
+	echo &quot;&lt;div id='dashboard-widgets-main-content' class='has-sidebar-content'&gt;\n\n&quot;;
+	do_meta_boxes( 'dashboard', 'normal', '' );
+	echo &quot;&lt;/div&gt;\n\n&quot;;
+	echo &quot;&lt;/div&gt;\n\n&quot;;
+
+	echo &quot;&lt;form style='display: none' method='get' action=''&gt;\n&lt;p&gt;\n&quot;;
+	wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+	wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+	echo &quot;&lt;/p&gt;\n&lt;/form&gt;\n&quot;;
+
+	echo &quot;&lt;/div&gt;&quot;;
 }
 
-// Modifies sidbar params on the fly to set up ids, class names, titles for each widget (called once per widget)
-// Switches widget to edit mode if $_GET['edit']
-function wp_dashboard_dynamic_sidebar_params( $params ) {
-	global $wp_registered_widgets, $wp_registered_widget_controls;
+/* Dashboard Widgets */
+
+function wp_dashboard_right_now() {
+	$num_posts = wp_count_posts( 'post' );
+	$num_pages = wp_count_posts( 'page' );
 
-	$sidebar_defaults = array('widget_id' =&gt; 0, 'before_widget' =&gt; '', 'after_widget' =&gt; '', 'before_title' =&gt; '', 'after_title' =&gt; '');
-	extract( $sidebar_defaults, EXTR_PREFIX_ALL, 'sidebar' );
-	extract( $params[0], EXTR_PREFIX_ALL, 'sidebar' );
+	$num_cats  = wp_count_terms('category');
 
-	if ( !isset($wp_registered_widgets[$sidebar_widget_id]) || !is_array($wp_registered_widgets[$sidebar_widget_id]) ) {
-		return $params;
+	$num_tags = wp_count_terms('post_tag');
+
+	$num_comm = wp_count_comments( );
+
+	echo &quot;\n\t&quot;.'&lt;p class=&quot;sub&quot;&gt;' . __('At a Glance') . '&lt;/p&gt;';
+	echo &quot;\n\t&quot;.'&lt;div class=&quot;table&quot;&gt;'.&quot;\n\t&quot;.'&lt;table&gt;';
+	echo &quot;\n\t&quot;.'&lt;tr class=&quot;first&quot;&gt;';
+
+	// Posts
+	$num = number_format_i18n( $num_posts-&gt;publish );
+	if ( current_user_can( 'edit_posts' ) )
+		$text = &quot;&lt;a href='edit.php'&gt;$num&lt;/a&gt;&quot;;
+	else
+		$text = $num;
+	echo '&lt;td class=&quot;first b b-posts&quot;&gt;' . $text . '&lt;/td&gt;';
+	echo '&lt;td class=&quot;t posts&quot;&gt;' . __ngettext( 'Post', 'Posts', intval($num_posts-&gt;publish) ) . '&lt;/td&gt;';
+	/* TODO: Show status breakdown on hover
+	if ( $can_edit_pages &amp;&amp; !empty($num_pages-&gt;publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can
+		$post_type_texts[] = '&lt;a href=&quot;edit-pages.php&quot;&gt;'.sprintf( __ngettext( '%s page', '%s pages', $num_pages-&gt;publish ), number_format_i18n( $num_pages-&gt;publish ) ).'&lt;/a&gt;';
+	}
+	if ( $can_edit_posts &amp;&amp; !empty($num_posts-&gt;draft) ) {
+		$post_type_texts[] = '&lt;a href=&quot;edit.php?post_status=draft&quot;&gt;'.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts-&gt;draft ), number_format_i18n( $num_posts-&gt;draft ) ).'&lt;/a&gt;';
 	}
-	$widget_defaults = array('id' =&gt; '', 'width' =&gt; '', 'height' =&gt; '', 'class' =&gt; '', 'feed_link' =&gt; '', 'all_link' =&gt; '', 'notice' =&gt; false, 'error' =&gt; false);
-	extract( $widget_defaults, EXTR_PREFIX_ALL, 'widget' );
-	extract( $wp_registered_widgets[$sidebar_widget_id], EXTR_PREFIX_ALL, 'widget' );
-
-	$the_classes = array();
-	if ( in_array($widget_width, array( 'third', 'fourth', 'full' ) ) )
-		$the_classes[] = $widget_width;
-
-	if ( 'double' == $widget_height )
-		$the_classes[] = 'double';
-
-	if ( $widget_class )
-		$the_classes[] = $widget_class;
-
-	// Add classes to the widget holder
-	if ( $the_classes )
-		$sidebar_before_widget = str_replace( &quot;&lt;div class='dashboard-widget-holder &quot;, &quot;&lt;div class='dashboard-widget-holder &quot; . join( ' ', $the_classes ) . ' ', $sidebar_before_widget );
-
-	$links = array();
-	if ( $widget_all_link )
-		$links[] = '&lt;a href=&quot;' . clean_url( $widget_all_link ) . '&quot;&gt;' . __( 'See&amp;nbsp;All' ) . '&lt;/a&gt;';
-
-	$content_class = 'dashboard-widget-content';
-	if ( current_user_can( 'edit_dashboard' ) &amp;&amp; isset($wp_registered_widget_controls[$widget_id]) &amp;&amp; is_callable($wp_registered_widget_controls[$widget_id]['callback']) ) {
-		// Switch this widget to edit mode
-		if ( isset($_GET['edit']) &amp;&amp; $_GET['edit'] == $widget_id ) {
-			$content_class .= ' dashboard-widget-control';
-			$wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty';
-			$sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name'];
-			$params[1] = 'wp_dashboard_trigger_widget_control';
-			$sidebar_before_widget .= '&lt;form action=&quot;' . clean_url(remove_query_arg( 'edit' ))  . '&quot; method=&quot;post&quot;&gt;';
-			$sidebar_after_widget   = &quot;&lt;div class='dashboard-widget-submit'&gt;&lt;input type='hidden' name='sidebar' value='wp_dashboard' /&gt;&lt;input type='hidden' name='widget_id' value='$widget_id' /&gt;&lt;input type='submit' value='&quot; . __( 'Save' ) . &quot;' /&gt;&lt;/div&gt;&lt;/form&gt;$sidebar_after_widget&quot;;
-			$links[] = '&lt;a href=&quot;' . clean_url(remove_query_arg( 'edit' )) . '&quot;&gt;' . __( 'Cancel' ) . '&lt;/a&gt;';
+	if ( $can_edit_posts &amp;&amp; !empty($num_posts-&gt;future) ) {
+		$post_type_texts[] = '&lt;a href=&quot;edit.php?post_status=future&quot;&gt;'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts-&gt;future ), number_format_i18n( $num_posts-&gt;future ) ).'&lt;/a&gt;';
+	}
+	if ( current_user_can('publish_posts') &amp;&amp; !empty($num_posts-&gt;pending) ) {
+		$pending_text = sprintf( __ngettext( 'There is &lt;a href=&quot;%1$s&quot;&gt;%2$s post&lt;/a&gt; pending your review.', 'There are &lt;a href=&quot;%1$s&quot;&gt;%2$s posts&lt;/a&gt; pending your review.', $num_posts-&gt;pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts-&gt;pending ) );
+	} else {
+		$pending_text = '';
+	}
+	*/
+
+	// Total Comments
+	$num = number_format_i18n($num_comm-&gt;total_comments);
+	if ( current_user_can( 'moderate_comments' ) )
+		$num = &quot;&lt;a href='edit-comments.php'&gt;$num&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;b b-comments&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;last t comments&quot;&gt;' . __ngettext( 'Comment', 'Comments', $num_comm-&gt;total_comments ) . '&lt;/td&gt;';
+
+	echo '&lt;/tr&gt;&lt;tr&gt;';
+
+	// Pages
+	$num = number_format_i18n( $num_pages-&gt;publish );
+	if ( current_user_can( 'edit_pages' ) )
+		$num = &quot;&lt;a href='edit-pages.php'&gt;$num&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;first b b_pages&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;t pages&quot;&gt;' . __ngettext( 'Page', 'Pages', $num_pages-&gt;publish ) . '&lt;/td&gt;';
+
+	// Approved Comments
+	$num = number_format_i18n($num_comm-&gt;approved);
+	if ( current_user_can( 'moderate_comments' ) )
+		$num = &quot;&lt;a href='edit-comments.php?comment_status=approved'&gt;$num&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;b b_approved&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;last t approved&quot;&gt;' . __ngettext( 'Approved', 'Approved', $num_comm-&gt;approved ) . '&lt;/td&gt;';
+
+	echo &quot;&lt;/tr&gt;\n\t&lt;tr&gt;&quot;;
+
+	// Categories
+	$num = number_format_i18n( $num_cats );
+	if ( current_user_can( 'manage_categories' ) )
+		$num = &quot;&lt;a href='categories.php'&gt;$num&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;first b b-cats&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;t cats&quot;&gt;' . __ngettext( 'Category', 'Categories', $num_cats ) . '&lt;/td&gt;';
+
+	// Pending Comments
+	$num = number_format_i18n($num_comm-&gt;moderated);
+	if ( current_user_can( 'moderate_comments' ) )
+		$num = &quot;&lt;a href='edit-comments.php?comment_status=moderated'&gt;&lt;span class='pending-count'&gt;$num&lt;/span&gt;&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;b b-waiting&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;last t waiting&quot;&gt;' . __ngettext( 'Pending', 'Pending', $num_comm-&gt;moderated ) . '&lt;/td&gt;';
+
+	echo &quot;&lt;/tr&gt;\n\t&lt;tr&gt;&quot;;
+
+	// Tags
+	$num = number_format_i18n( $num_tags );
+	if ( current_user_can( 'manage_categories' ) )
+		$num = &quot;&lt;a href='edit-tags.php'&gt;$num&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;first b b-tags&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;t tags&quot;&gt;' . __ngettext( 'Tag', 'Tags', $num_tags ) . '&lt;/td&gt;';
+
+	// Spam Comments
+	$num = number_format_i18n($num_comm-&gt;spam);
+	if ( current_user_can( 'moderate_comments' ) )
+		$num = &quot;&lt;a href='edit-comments.php?comment_status=spam'&gt;&lt;span class='spam-count'&gt;$num&lt;/span&gt;&lt;/a&gt;&quot;;
+	echo '&lt;td class=&quot;b b-spam&quot;&gt;'.$num.'&lt;/td&gt;';
+	echo '&lt;td class=&quot;last t spam&quot;&gt;' . __ngettext( 'Spam', 'Spam', $num_comm-&gt;spam ) . '&lt;/td&gt;';
+
+	echo &quot;&lt;/tr&gt;&quot;;
+	do_action('right_now_table_end');
+	echo &quot;\n\t&lt;/table&gt;\n\t&lt;/div&gt;&quot;;
+
+	echo &quot;\n\t&quot;.'&lt;div class=&quot;versions&quot;&gt;';
+	$ct = current_theme_info();
+	$sidebars_widgets = wp_get_sidebars_widgets();
+	$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 );
+	$num = number_format_i18n( $num_widgets );
+
+	echo &quot;\n\t&lt;p&gt;&quot;;
+	if ( current_user_can( 'switch_themes' ) ) {
+		echo '&lt;a href=&quot;themes.php&quot; class=&quot;button rbutton&quot;&gt;' . __('Change Theme') . '&lt;/a&gt;';
+		printf(__ngettext('Theme &lt;span class=&quot;b&quot;&gt;&lt;a href=&quot;themes.php&quot;&gt;%1$s&lt;/a&gt;&lt;/span&gt; with &lt;span class=&quot;b&quot;&gt;&lt;a href=&quot;widgets.php&quot;&gt;%2$s Widget&lt;/a&gt;&lt;/span&gt;', 'Theme &lt;span class=&quot;b&quot;&gt;&lt;a href=&quot;themes.php&quot;&gt;%1$s&lt;/a&gt;&lt;/span&gt; with &lt;span class=&quot;b&quot;&gt;&lt;a href=&quot;widgets.php&quot;&gt;%2$s Widgets&lt;/a&gt;&lt;/span&gt;', $num_widgets), $ct-&gt;title, $num);
+	} else {
+		printf(__ngettext('Theme &lt;span class=&quot;b&quot;&gt;%1$s&lt;/span&gt; with &lt;span class=&quot;b&quot;&gt;%2$s Widget&lt;/span&gt;', 'Theme &lt;span class=&quot;b&quot;&gt;%1$s&lt;/span&gt; with &lt;span class=&quot;b&quot;&gt;%2$s Widgets&lt;/span&gt;', $num_widgets), $ct-&gt;title, $num);
+	}
+
+	echo '&lt;/p&gt;';
+
+	update_right_now_message();
+
+	echo &quot;\n\t&quot;.'&lt;/div&gt;';
+	do_action( 'rightnow_end' );
+	do_action( 'activity_box_end' );
+}
+
+function wp_dashboard_quick_press() {
+	$drafts = false;
+	if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) &amp;&amp; isset( $_POST['action'] ) &amp;&amp; 0 === strpos( $_POST['action'], 'post-quickpress' ) &amp;&amp; (int) $_POST['post_ID'] ) {
+		$view = get_permalink( $_POST['post_ID'] );
+		$edit = clean_url( get_edit_post_link( $_POST['post_ID'] ) );
+		if ( 'post-quickpress-publish' == $_POST['action'] ) {
+			if ( current_user_can('publish_posts') )
+				printf( '&lt;div class=&quot;message&quot;&gt;&lt;p&gt;' . __( 'Post Published. &lt;a href=&quot;%s&quot;&gt;View post&lt;/a&gt; | &lt;a href=&quot;%s&quot;&gt;Edit post&lt;/a&gt;' ) . '&lt;/p&gt;&lt;/div&gt;', clean_url( $view ), $edit );
+			else
+				printf( '&lt;div class=&quot;message&quot;&gt;&lt;p&gt;' . __( 'Post submitted. &lt;a href=&quot;%s&quot;&gt;Preview post&lt;/a&gt; | &lt;a href=&quot;%s&quot;&gt;Edit post&lt;/a&gt;' ) . '&lt;/p&gt;&lt;/div&gt;', clean_url( add_query_arg( 'preview', 1, $view ) ), $edit );
 		} else {
-			$links[] = '&lt;a href=&quot;' . clean_url(add_query_arg( 'edit', $widget_id )) . &quot;#$widget_id&quot; . '&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt;';
+			printf( '&lt;div class=&quot;message&quot;&gt;&lt;p&gt;' . __( 'Draft Saved. &lt;a href=&quot;%s&quot;&gt;Preview post&lt;/a&gt; | &lt;a href=&quot;%s&quot;&gt;Edit post&lt;/a&gt;' ) . '&lt;/p&gt;&lt;/div&gt;', clean_url( add_query_arg( 'preview', 1, $view ) ), $edit );
+			$drafts_query = new WP_Query( array(
+				'post_type' =&gt; 'post',
+				'what_to_show' =&gt; 'posts',
+				'post_status' =&gt; 'draft',
+				'author' =&gt; $GLOBALS['current_user']-&gt;ID,
+				'posts_per_page' =&gt; 1,
+				'orderby' =&gt; 'modified',
+				'order' =&gt; 'DESC'
+			) );
+
+			if ( $drafts_query-&gt;posts )
+				$drafts =&amp; $drafts_query-&gt;posts;
 		}
+		printf('&lt;p class=&quot;textright&quot;&gt;' . __('You can also try %s, easy blogging from anywhere on the Web.') . '&lt;/p&gt;', '&lt;a href=&quot;tools.php&quot;&gt;' . __('Press This') . '&lt;/a&gt;' );
+		$_REQUEST = array(); // hack for get_default_post_to_edit()
 	}
 
-	if ( $widget_feed_link )
-		$links[] = '&lt;img class=&quot;rss-icon&quot; src=&quot;' . includes_url('images/rss.png') . '&quot; alt=&quot;' . __( 'rss icon' ) . '&quot; /&gt; &lt;a href=&quot;' . clean_url( $widget_feed_link ) . '&quot;&gt;' . __( 'RSS' ) . '&lt;/a&gt;';
+	$post = get_default_post_to_edit();
+?&gt;
+
+	&lt;form name=&quot;post&quot; action=&quot;&lt;?php echo clean_url( admin_url( 'post.php' ) ); ?&gt;&quot; method=&quot;post&quot; id=&quot;quick-press&quot;&gt;
+		&lt;h4 id=&quot;quick-post-title&quot;&gt;&lt;label for=&quot;title&quot;&gt;&lt;?php _e('Title') ?&gt;&lt;/label&gt;&lt;/h4&gt;
+		&lt;div class=&quot;input-text-wrap&quot;&gt;
+			&lt;input type=&quot;text&quot; name=&quot;post_title&quot; id=&quot;title&quot; tabindex=&quot;1&quot; autocomplete=&quot;off&quot; value=&quot;&lt;?php echo attribute_escape( $post-&gt;post_title ); ?&gt;&quot; /&gt;
+		&lt;/div&gt;
+
+		&lt;?php if ( current_user_can( 'upload_files' ) ) : ?&gt;
+		&lt;div id=&quot;media-buttons&quot; class=&quot;hide-if-no-js&quot;&gt;
+			&lt;?php do_action( 'media_buttons' ); ?&gt;
+		&lt;/div&gt;
+		&lt;?php endif; ?&gt;
+
+		&lt;h4 id=&quot;content-label&quot;&gt;&lt;label for=&quot;content&quot;&gt;&lt;?php _e('Content') ?&gt;&lt;/label&gt;&lt;/h4&gt;
+		&lt;div class=&quot;textarea-wrap&quot;&gt;
+			&lt;textarea name=&quot;content&quot; id=&quot;content&quot; class=&quot;mceEditor&quot; rows=&quot;3&quot; cols=&quot;15&quot; tabindex=&quot;2&quot;&gt;&lt;?php echo $post-&gt;post_content; ?&gt;&lt;/textarea&gt;
+		&lt;/div&gt;
+
+		&lt;script type=&quot;text/javascript&quot;&gt;edCanvas = document.getElementById('content');edInsertContent = null;&lt;/script&gt;
+
+		&lt;h4&gt;&lt;label for=&quot;tags-input&quot;&gt;&lt;?php _e('Tags') ?&gt;&lt;/label&gt;&lt;/h4&gt;
+		&lt;div class=&quot;input-text-wrap&quot;&gt;
+			&lt;input type=&quot;text&quot; name=&quot;tags_input&quot; id=&quot;tags-input&quot; tabindex=&quot;3&quot; value=&quot;&lt;?php echo get_tags_to_edit( $post-&gt;ID ); ?&gt;&quot; /&gt;
+		&lt;/div&gt;
+
+		&lt;p class=&quot;submit&quot;&gt;
+			&lt;input type=&quot;hidden&quot; name=&quot;action&quot; id=&quot;quickpost-action&quot; value=&quot;post-quickpress-save&quot; /&gt;
+			&lt;input type=&quot;hidden&quot; name=&quot;quickpress_post_ID&quot; value=&quot;&lt;?php echo (int) $post-&gt;ID; ?&gt;&quot; /&gt;
+			&lt;?php wp_nonce_field('add-post'); ?&gt;
+			&lt;input type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save-post&quot; class=&quot;button&quot; tabindex=&quot;4&quot; value=&quot;&lt;?php _e('Save Draft'); ?&gt;&quot; /&gt;
+			&lt;input type=&quot;reset&quot; value=&quot;&lt;?php _e( 'Cancel' ); ?&gt;&quot; class=&quot;cancel&quot; /&gt;
+			&lt;?php if ( current_user_can('publish_posts') ) { ?&gt;
+			&lt;input type=&quot;submit&quot; name=&quot;publish&quot; id=&quot;publish&quot; accesskey=&quot;p&quot; tabindex=&quot;5&quot; class=&quot;button-primary&quot; value=&quot;&lt;?php _e('Publish'); ?&gt;&quot; /&gt;
+			&lt;?php } else { ?&gt;
+			&lt;input type=&quot;submit&quot; name=&quot;publish&quot; id=&quot;publish&quot; accesskey=&quot;p&quot; tabindex=&quot;5&quot; class=&quot;button-primary&quot; value=&quot;&lt;?php _e('Submit for Review'); ?&gt;&quot; /&gt;
+			&lt;?php } ?&gt;
+			&lt;br class=&quot;clear&quot; /&gt;
+		&lt;/p&gt;
+
+	&lt;/form&gt;
 
-	$links = apply_filters( &quot;wp_dashboard_widget_links_$widget_id&quot;, $links );
+&lt;?php
+	if ( $drafts )
+		wp_dashboard_recent_drafts( $drafts );
+}
 
-	// Add links to widget's title bar
-	if ( $links ) {
-		$sidebar_before_title .= '&lt;span&gt;';
-		$sidebar_after_title   = '&lt;/span&gt;&lt;small&gt;' . join( '&amp;nbsp;|&amp;nbsp;', $links ) . &quot;&lt;/small&gt;&lt;br class='clear' /&gt;$sidebar_after_title&quot;;
+function wp_dashboard_recent_drafts( $drafts = false ) {
+	if ( !$drafts ) {
+		$drafts_query = new WP_Query( array(
+			'post_type' =&gt; 'post',
+			'what_to_show' =&gt; 'posts',
+			'post_status' =&gt; 'draft',
+			'author' =&gt; $GLOBALS['current_user']-&gt;ID,
+			'posts_per_page' =&gt; 5,
+			'orderby' =&gt; 'modified',
+			'order' =&gt; 'DESC'
+		) );
+		$drafts =&amp; $drafts_query-&gt;posts;
 	}
 
-	// Could have put this in widget-content.  Doesn't really matter
-	if ( $widget_notice )
-		$sidebar_after_title .= &quot;\t\t\t&lt;div class='dashboard-widget-notice'&gt;$widget_notice&lt;/div&gt;\n\n&quot;;
+	if ( $drafts &amp;&amp; is_array( $drafts ) ) {
+		$list = array();
+		foreach ( $drafts as $draft ) {
+			$url = get_edit_post_link( $draft-&gt;ID );
+			$title = _draft_or_post_title( $draft-&gt;ID );
+			$item = &quot;&lt;h4&gt;&lt;a href='$url' title='&quot; . sprintf( __( 'Edit &quot;%s&quot;' ), attribute_escape( $title ) ) . &quot;'&gt;$title&lt;/a&gt; &lt;abbr title='&quot; . get_the_time(__('Y/m/d g:i:s A'), $draft) . &quot;'&gt;&quot; . get_the_time( get_option( 'date_format' ), $draft ) . '&lt;/abbr&gt;&lt;/h4&gt;';
+			if ( $the_content = preg_split( '#\s#', strip_tags( $draft-&gt;post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
+				$item .= '&lt;p&gt;' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 &lt; count( $the_content ) ? '&amp;hellip;' : '' ) . '&lt;/p&gt;';
+			$list[] = $item;
+		}
+?&gt;
+	&lt;ul&gt;
+		&lt;li&gt;&lt;?php echo join( &quot;&lt;/li&gt;\n&lt;li&gt;&quot;, $list ); ?&gt;&lt;/li&gt;
+	&lt;/ul&gt;
+	&lt;p class=&quot;textright&quot;&gt;&lt;a href=&quot;edit.php?post_status=draft&quot; class=&quot;button&quot;&gt;&lt;?php _e('View all'); ?&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;?php
+	} else {
+		_e('There are no drafts at the moment');
+	}
+}
 
-	if ( $widget_error )
-		$sidebar_after_title .= &quot;\t\t\t&lt;div class='dashboard-widget-error'&gt;$widget_error&lt;/div&gt;\n\n&quot;;
+/**
+ * Display recent comments dashboard widget content.
+ *
+ * @since unknown
+ */
+function wp_dashboard_recent_comments() {
+	global $wpdb;
+
+	if ( current_user_can('edit_posts') )
+		$allowed_states = array('0', '1');
+	else
+		$allowed_states = array('1');
+
+	// Select all comment types and filter out spam later for better query performance.
+	$comments = array();
+	$start = 0;
+
+	while ( count( $comments ) &lt; 5 &amp;&amp; $possible = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;comments ORDER BY comment_date_gmt DESC LIMIT $start, 50&quot; ) ) {
+
+		foreach ( $possible as $comment ) {
+			if ( count( $comments ) &gt;= 5 )
+				break;
+			if ( in_array( $comment-&gt;comment_approved, $allowed_states ) )
+				$comments[] = $comment;
+		}
 
-	$sidebar_after_title .= &quot;\t\t\t&lt;div class='$content_class'&gt;\n\n&quot;;
+		$start = $start + 50;
+	}
 
-	$sidebar_after_widget .= &quot;\t\t\t&lt;/div&gt;\n\n&quot;;
+	if ( $comments ) :
+?&gt;
 
-	foreach( array_keys( $params[0] ) as $key )
-		$$key = ${'sidebar_' . $key};
+		&lt;div id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;
+&lt;?php
+		foreach ( $comments as $comment )
+			_wp_dashboard_recent_comments_row( $comment );
+?&gt;
 
-	$params[0] = compact( array_keys( $params[0] ) );
+		&lt;/div&gt;
 
-	return $params;
-}
+&lt;?php
+		if ( current_user_can('edit_posts') ) { ?&gt;
+			&lt;p class=&quot;textright&quot;&gt;&lt;a href=&quot;edit-comments.php&quot; class=&quot;button&quot;&gt;&lt;?php _e('View all'); ?&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;?php	}
 
+		wp_comment_reply( -1, false, 'dashboard', false );
 
-/* Dashboard Widgets */
+	else :
+?&gt;
 
-function wp_dashboard_recent_comments( $sidebar_args ) {
-	global $comment;
-	extract( $sidebar_args, EXTR_SKIP );
+	&lt;p&gt;&lt;?php _e( 'No comments yet.' ); ?&gt;&lt;/p&gt;
 
-	echo $before_widget;
+&lt;?php
+	endif; // $comments;
+}
 
-	echo $before_title;
-	echo $widget_name;
-	echo $after_title;
+function _wp_dashboard_recent_comments_row( &amp;$comment, $show_date = true ) {
+	$GLOBALS['comment'] =&amp; $comment;
 
-	$lambda = create_function( '', 'return 5;' );
-	add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter
-	$comments_query = new WP_Query(array('feed' =&gt; 'rss2', 'withcomments' =&gt; 1));
-	remove_filter( 'option_posts_per_rss', $lambda );
+	$comment_post_url = get_edit_post_link( $comment-&gt;comment_post_ID );
+	$comment_post_title = get_the_title( $comment-&gt;comment_post_ID );
+	$comment_post_link = &quot;&lt;a href='$comment_post_url'&gt;$comment_post_title&lt;/a&gt;&quot;;
+	$comment_link = '&lt;a class=&quot;comment-link&quot; href=&quot;' . get_comment_link() . '&quot;&gt;#&lt;/a&gt;';
 
-	$is_first = true;
+	$delete_url = clean_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
+	$approve_url = clean_url( wp_nonce_url( &quot;comment.php?action=approvecomment&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;approve-comment_$comment-&gt;comment_ID&quot; ) );
+	$unapprove_url = clean_url( wp_nonce_url( &quot;comment.php?action=unapprovecomment&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;unapprove-comment_$comment-&gt;comment_ID&quot; ) );
+	$spam_url = clean_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;dt=spam&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
 
-	if ( $comments_query-&gt;have_comments() ) {
-		while ( $comments_query-&gt;have_comments() ) { $comments_query-&gt;the_comment();
+	$actions = array();
 
-			$comment_post_url = get_permalink( $comment-&gt;comment_post_ID );
-			$comment_post_title = get_the_title( $comment-&gt;comment_post_ID );
-			$comment_post_link = &quot;&lt;a href='$comment_post_url'&gt;$comment_post_title&lt;/a&gt;&quot;;
-			$comment_link = '&lt;a class=&quot;comment-link&quot; href=&quot;' . get_comment_link() . '&quot;&gt;#&lt;/a&gt;';
-			$comment_meta = sprintf( __( 'From &lt;strong&gt;%1$s&lt;/strong&gt; on %2$s %3$s' ), get_comment_author(), $comment_post_link, $comment_link );
+	$actions_string = '';
+	if ( current_user_can('edit_post', $comment-&gt;comment_post_ID) ) {
+		$actions['approve'] = &quot;&lt;a href='$approve_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='&quot; . __( 'Approve this comment' ) . &quot;'&gt;&quot; . __( 'Approve' ) . '&lt;/a&gt;';
+		$actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='&quot; . __( 'Unapprove this comment' ) . &quot;'&gt;&quot; . __( 'Unapprove' ) . '&lt;/a&gt;';
+		$actions['edit'] = &quot;&lt;a href='comment.php?action=editcomment&amp;amp;c={$comment-&gt;comment_ID}' title='&quot; . __('Edit comment') . &quot;'&gt;&quot;. __('Edit') . '&lt;/a&gt;';
+		//$actions['quickedit'] = '&lt;a onclick=&quot;commentReply.open(\''.$comment-&gt;comment_ID.'\',\''.$comment-&gt;comment_post_ID.'\',\'edit\');return false;&quot; class=&quot;vim-q&quot; title=&quot;'.__('Quick Edit').'&quot; href=&quot;#&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+		$actions['reply'] = '&lt;a onclick=&quot;commentReply.open(\''.$comment-&gt;comment_ID.'\',\''.$comment-&gt;comment_post_ID.'\');return false;&quot; class=&quot;vim-r hide-if-no-js&quot; title=&quot;'.__('Reply to this comment').'&quot; href=&quot;#&quot;&gt;' . __('Reply') . '&lt;/a&gt;';
+		$actions['spam'] = &quot;&lt;a href='$spam_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::spam=1 vim-s vim-destructive' title='&quot; . __( 'Mark this comment as spam' ) . &quot;'&gt;&quot; . _c( 'Spam|verb' ) . '&lt;/a&gt;';
+		$actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete vim-d vim-destructive'&gt;&quot; . __('Delete') . '&lt;/a&gt;';
 
-			if ( $is_first ) : $is_first = false;
-?&gt;
-				&lt;blockquote&gt;&lt;p&gt;&amp;#8220;&lt;?php comment_excerpt(); ?&gt;&amp;#8221;&lt;/p&gt;&lt;/blockquote&gt;
-				&lt;p class='comment-meta'&gt;&lt;?php echo $comment_meta; ?&gt;&lt;/p&gt;
-&lt;?php
-				if ( $comments_query-&gt;comment_count &gt; 1 ) : ?&gt;
-				&lt;ul id=&quot;dashboard-comments-list&quot;&gt;
-&lt;?php
-				endif; // comment_count
-			else : // is_first
-?&gt;
+		$actions = apply_filters( 'comment_row_actions', $actions, $comment );
 
-					&lt;li class='comment-meta'&gt;&lt;?php echo $comment_meta; ?&gt;&lt;/li&gt;
-&lt;?php
-			endif; // is_first
-		}
+		$i = 0;
+		foreach ( $actions as $action =&gt; $link ) {
+			++$i;
+			( ( ('approve' == $action || 'unapprove' == $action) &amp;&amp; 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
 
-		if ( $comments_query-&gt;comment_count &gt; 1 ) : ?&gt;
-				&lt;/ul&gt;
-&lt;?php
-		endif; // comment_count;
+			// Reply and quickedit need a hide-if-no-js span
+			if ( 'reply' == $action || 'quickedit' == $action )
+				$action .= ' hide-if-no-js';
 
+			$actions_string .= &quot;&lt;span class='$action'&gt;$sep$link&lt;/span&gt;&quot;;
+		}
 	}
 
-	echo $after_widget;
+?&gt;
+
+		&lt;div id=&quot;comment-&lt;?php echo $comment-&gt;comment_ID; ?&gt;&quot; &lt;?php comment_class( array( 'comment-item', wp_get_comment_status($comment-&gt;comment_ID) ) ); ?&gt;&gt;
+			&lt;?php if ( !$comment-&gt;comment_type || 'comment' == $comment-&gt;comment_type ) : ?&gt;
+
+			&lt;?php echo get_avatar( $comment, 50 ); ?&gt;
+			&lt;h4 class=&quot;comment-meta&quot;&gt;&lt;?php printf( __( 'From %1$s on %2$s%3$s' ), '&lt;cite class=&quot;comment-author&quot;&gt;' . get_comment_author_link() . '&lt;/cite&gt;', $comment_post_link.&quot; &quot;.$comment_link, ' &lt;span class=&quot;approve&quot;&gt;' . __( '[Pending]' ) . '&lt;/span&gt;' ); ?&gt;&lt;/h4&gt;
+
+			&lt;?php
+			else :
+				switch ( $comment-&gt;comment_type ) :
+				case 'pingback' :
+					$type = __( 'Pingback' );
+					break;
+				case 'trackback' :
+					$type = __( 'Trackback' );
+					break;
+				default :
+					$type = ucwords( $comment-&gt;comment_type );
+				endswitch;
+				$type = wp_specialchars( $type );
+			?&gt;
+
+			&lt;h4 class=&quot;comment-meta&quot;&gt;&lt;?php printf( __( '%1$s on %2$s' ), &quot;&lt;strong&gt;$type&lt;/strong&gt;&quot;, $comment_post_link ); ?&gt;&lt;/h4&gt;
+			&lt;p class=&quot;comment-author&quot;&gt;&lt;?php comment_author_link(); ?&gt;&lt;/p&gt;
+
+			&lt;?php endif; // comment_type ?&gt;
+			&lt;blockquote&gt;&lt;p&gt;&lt;?php comment_excerpt(); ?&gt;&lt;/p&gt;&lt;/blockquote&gt;
+			&lt;p class=&quot;row-actions&quot;&gt;&lt;?php echo $actions_string; ?&gt;&lt;/p&gt;
+
+			&lt;div id=&quot;inline-&lt;?php echo $comment-&gt;comment_ID; ?&gt;&quot; class=&quot;hidden&quot;&gt;
+				&lt;textarea class=&quot;comment&quot; rows=&quot;3&quot; cols=&quot;10&quot;&gt;&lt;?php echo $comment-&gt;comment_content; ?&gt;&lt;/textarea&gt;
+				&lt;div class=&quot;author-email&quot;&gt;&lt;?php echo attribute_escape( $comment-&gt;comment_author_email ); ?&gt;&lt;/div&gt;
+				&lt;div class=&quot;author&quot;&gt;&lt;?php echo attribute_escape( $comment-&gt;comment_author ); ?&gt;&lt;/div&gt;
+				&lt;div class=&quot;author-url&quot;&gt;&lt;?php echo attribute_escape( $comment-&gt;comment_author_url ); ?&gt;&lt;/div&gt;
+				&lt;div class=&quot;comment_status&quot;&gt;&lt;?php echo $comment-&gt;comment_approved; ?&gt;&lt;/div&gt;
+			&lt;/div&gt;
+
+		&lt;/div&gt;
+&lt;?php
+}
+
+function wp_dashboard_incoming_links() {
+	wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' );
 }
 
-// $sidebar_args are handled by wp_dashboard_empty()
+/**
+ * Display incoming links dashboard widget content.
+ *
+ * @since unknown
+ */
 function wp_dashboard_incoming_links_output() {
 	$widgets = get_option( 'dashboard_widget_options' );
 	@extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP );
@@ -371,35 +604,83 @@ function wp_dashboard_incoming_links_output() {
 	}
 }
 
-// $sidebar_args are handled by wp_dashboard_empty()
+function wp_dashboard_incoming_links_control() {
+	wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' =&gt; false, 'show_summary' =&gt; false, 'show_author' =&gt; false ) );
+}
+
+function wp_dashboard_primary() {
+	wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );
+}
+
+function wp_dashboard_primary_control() {
+	wp_dashboard_rss_control( 'dashboard_primary' );
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param int $widget_id
+ */
 function wp_dashboard_rss_output( $widget_id ) {
 	$widgets = get_option( 'dashboard_widget_options' );
+	echo &quot;&lt;div class='rss-widget'&gt;&quot;;
 	wp_widget_rss_output( $widgets[$widget_id] );
+	echo &quot;&lt;/div&gt;&quot;;
+}
+
+function wp_dashboard_secondary() {
+	wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );
 }
 
-// $sidebar_args are handled by wp_dashboard_empty()
+function wp_dashboard_secondary_control() {
+	wp_dashboard_rss_control( 'dashboard_secondary' );
+}
+
+/**
+ * Display secondary dashboard RSS widget feed.
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function wp_dashboard_secondary_output() {
 	$widgets = get_option( 'dashboard_widget_options' );
 	@extract( @$widgets['dashboard_secondary'], EXTR_SKIP );
 	$rss = @fetch_rss( $url );
+
 	if ( !isset($rss-&gt;items) || 0 == count($rss-&gt;items) )
 		return false;
 
-	echo &quot;&lt;ul id='planetnews'&gt;\n&quot;;
-
 	$rss-&gt;items = array_slice($rss-&gt;items, 0, $items);
-	foreach ($rss-&gt;items as $item ) {
-		$title = wp_specialchars($item['title']);
-		list($author,$post) = explode( ':', $title, 2 );
-		$link = clean_url($item['link']);
 
-		echo &quot;\t&lt;li&gt;&lt;a href='$link'&gt;&lt;span class='post'&gt;$post&lt;/span&gt;&lt;span class='hidden'&gt; - &lt;/span&gt;&lt;cite&gt;$author&lt;/cite&gt;&lt;/a&gt;&lt;/li&gt;\n&quot;;
+	if ( 'http://planet.wordpress.org/' == $rss-&gt;channel['link'] ) {
+		foreach ( array_keys($rss-&gt;items) as $i ) {
+			list($site, $description) = explode( ':', wp_specialchars($rss-&gt;items[$i]['title']), 2 );
+			$rss-&gt;items[$i]['dc']['creator'] = trim($site);
+			$rss-&gt;items[$i]['title'] = trim($description);
+		}
 	}
 
-	echo &quot;&lt;/ul&gt;\n&lt;br class='clear' /&gt;\n&quot;;
+	echo &quot;&lt;div class='rss-widget'&gt;&quot;;
+	wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
+	echo &quot;&lt;/div&gt;&quot;;
+}
+
+function wp_dashboard_plugins() {
+	wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
+		'http://wordpress.org/extend/plugins/rss/browse/popular/',
+		'http://wordpress.org/extend/plugins/rss/browse/new/',
+		'http://wordpress.org/extend/plugins/rss/browse/updated/'
+	) );
 }
 
-// $sidebar_args are handled by wp_dashboard_empty()
+/**
+ * Display plugins most popular, newest plugins, and recently updated widget text.
+ *
+ * @since unknown
+ */
 function wp_dashboard_plugins_output() {
 	$popular = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
 	$new     = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
@@ -433,18 +714,35 @@ function wp_dashboard_plugins_output() {
 		list($link, $frag) = explode( '#', $item['link'] );
 
 		$link = clean_url($link);
-		$dlink = rtrim($link, '/') . '/download/';
+		if( preg_match('|/([^/]+?)/?$|', $link, $matches) )
+			$slug = $matches[1];
+		else
+			$slug = '';
+
+		$ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $slug, 'install-plugin_' . $slug) .
+							'&amp;amp;TB_iframe=true&amp;amp;width=600&amp;amp;height=800';
 
 		echo &quot;&lt;h4&gt;$label&lt;/h4&gt;\n&quot;;
-		echo &quot;&lt;h5&gt;&lt;a href='$link'&gt;$title&lt;/a&gt;&lt;/h5&gt;&amp;nbsp;&lt;span&gt;(&lt;a href='$dlink'&gt;&quot; . __( 'Download' ) . &quot;&lt;/a&gt;)&lt;/span&gt;\n&quot;;
+		echo &quot;&lt;h5&gt;&lt;a href='$link'&gt;$title&lt;/a&gt;&lt;/h5&gt;&amp;nbsp;&lt;span&gt;(&lt;a href='$ilink' class='thickbox' title='$title'&gt;&quot; . __( 'Install' ) . &quot;&lt;/a&gt;)&lt;/span&gt;\n&quot;;
 		echo &quot;&lt;p&gt;$description&lt;/p&gt;\n&quot;;
 	}
 }
 
-// Checks to see if all of the feed url in $check_urls are cached.
-// If $check_urls is empty, look for the rss feed url found in the dashboard widget optios of $widget_id.
-// If cached, call $callback, a function that echoes out output for this widget.
-// If not cache, echo a &quot;Loading...&quot; stub which is later replaced by AJAX call (see top of /wp-admin/index.php)
+/**
+ * Checks to see if all of the feed url in $check_urls are cached.
+ *
+ * If $check_urls is empty, look for the rss feed url found in the dashboard
+ * widget optios of $widget_id. If cached, call $callback, a function that
+ * echoes out output for this widget. If not cache, echo a &quot;Loading...&quot; stub
+ * which is later replaced by AJAX call (see top of /wp-admin/index.php)
+ *
+ * @since unknown
+ *
+ * @param int $widget_id
+ * @param callback $callback
+ * @param array $check_urls RSS feeds
+ * @return bool False on failure. True on success.
+ */
 function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
 	$loading = '&lt;p class=&quot;widget-loading&quot;&gt;' . __( 'Loading&amp;#8230;' ) . '&lt;/p&gt;';
 
@@ -480,42 +778,36 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar
 	return true;
 }
 
-// Empty widget used for JS/AJAX created output.
-// Callback inserts content between before_widget and after_widget.  Used when widget is in edit mode.  Can also be used for custom widgets.
-function wp_dashboard_empty( $sidebar_args, $callback = false ) {
-	extract( $sidebar_args, EXTR_SKIP );
-
-	echo $before_widget;
-
-	echo $before_title;
-	echo $widget_name;
-	echo $after_title;
-
-	// When in edit mode, the callback passed to this function is the widget_control callback
-	if ( $callback &amp;&amp; is_callable( $callback ) ) {
-		$args = array_slice( func_get_args(), 2 );
-		array_unshift( $args, $widget_id );
-		call_user_func_array( $callback, $args );
-	}
-
-	echo $after_widget;
-}
-
-/* Dashboard Widgets Controls. Ssee also wp_dashboard_empty() */
+/* Dashboard Widgets Controls */
 
 // Calls widget_control callback
+/**
+ * Calls widget control callback.
+ *
+ * @since unknown
+ *
+ * @param int $widget_control_id Registered Widget ID.
+ */
 function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
-	global $wp_registered_widget_controls;
-	if ( is_scalar($widget_control_id) &amp;&amp; $widget_control_id &amp;&amp; isset($wp_registered_widget_controls[$widget_control_id]) &amp;&amp; is_callable($wp_registered_widget_controls[$widget_control_id]['callback']) )
-		call_user_func_array( $wp_registered_widget_controls[$widget_control_id]['callback'], $wp_registered_widget_controls[$widget_control_id]['params'] );
-}
+	global $wp_dashboard_control_callbacks;
 
-// Sets up $args to be used as input to wp_widget_rss_form(), handles POST data from RSS-type widgets
-function wp_dashboard_rss_control( $args ) {
-	extract( $args );
-	if ( !$widget_id )
-		return false;
+	if ( is_scalar($widget_control_id) &amp;&amp; $widget_control_id &amp;&amp; isset($wp_dashboard_control_callbacks[$widget_control_id]) &amp;&amp; is_callable($wp_dashboard_control_callbacks[$widget_control_id]) ) {
+		call_user_func( $wp_dashboard_control_callbacks[$widget_control_id], '', array( 'id' =&gt; $widget_control_id, 'callback' =&gt; $wp_dashboard_control_callbacks[$widget_control_id] ) );
+	}
+}
 
+/**
+ * The RSS dashboard widget control.
+ *
+ * Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data
+ * from RSS-type widgets.
+ *
+ * @since unknown
+ *
+ * @param string widget_id
+ * @param array form_inputs
+ */
+function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
 	if ( !$widget_options = get_option( 'dashboard_widget_options' ) )
 		$widget_options = array();
 
@@ -540,4 +832,9 @@ function wp_dashboard_rss_control( $args ) {
 	wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );
 }
 
+/**
+ * Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).
+ */
+function wp_dashboard_empty() {}
+
 ?&gt;</diff>
      <filename>wp-admin/includes/dashboard.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,28 @@
 &lt;?php
-
-// version number for the export format.  bump this when something changes that might affect compatibility.
+/**
+ * WordPress Export Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Version number for the export format.
+ *
+ * Bump this when something changes that might affect compatibility.
+ *
+ * @since unknown
+ * @var string
+ */
 define('WXR_VERSION', '1.0');
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $author
+ */
 function export_wp($author='') {
 global $wpdb, $post_ids, $post;
 
@@ -26,6 +46,13 @@ $post_ids = $wpdb-&gt;get_col(&quot;SELECT ID FROM $wpdb-&gt;posts $where ORDER BY post_dat
 $categories = (array) get_categories('get=all');
 $tags = (array) get_tags('get=all');
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $categories
+ */
 function wxr_missing_parents($categories) {
 	if ( !is_array($categories) || empty($categories) )
 		return array();
@@ -61,6 +88,13 @@ while ( ( $cat = array_shift($categories) ) &amp;&amp; ++$pass &lt; $passes ) {
 }
 unset($categories);
 
+/**
+ * Place string in CDATA tag.
+ *
+ * @since unknown
+ *
+ * @param string $str String to place in XML CDATA tag.
+ */
 function wxr_cdata($str) {
 	if ( seems_utf8($str) == false )
 		$str = utf8_encode($str);
@@ -72,6 +106,13 @@ function wxr_cdata($str) {
 	return $str;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return string Site URL.
+ */
 function wxr_site_url() {
 	global $current_site;
 
@@ -85,6 +126,13 @@ function wxr_site_url() {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $c Category Object
+ */
 function wxr_cat_name($c) {
 	if ( empty($c-&gt;name) )
 		return;
@@ -92,6 +140,13 @@ function wxr_cat_name($c) {
 	echo '&lt;wp:cat_name&gt;' . wxr_cdata($c-&gt;name) . '&lt;/wp:cat_name&gt;';
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $c Category Object
+ */
 function wxr_category_description($c) {
 	if ( empty($c-&gt;description) )
 		return;
@@ -99,6 +154,13 @@ function wxr_category_description($c) {
 	echo '&lt;wp:category_description&gt;' . wxr_cdata($c-&gt;description) . '&lt;/wp:category_description&gt;';
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $t Tag Object
+ */
 function wxr_tag_name($t) {
 	if ( empty($t-&gt;name) )
 		return;
@@ -106,6 +168,13 @@ function wxr_tag_name($t) {
 	echo '&lt;wp:tag_name&gt;' . wxr_cdata($t-&gt;name) . '&lt;/wp:tag_name&gt;';
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $t Tag Object
+ */
 function wxr_tag_description($t) {
 	if ( empty($t-&gt;description) )
 		return;
@@ -113,6 +182,11 @@ function wxr_tag_description($t) {
 	echo '&lt;wp:tag_description&gt;' . wxr_cdata($t-&gt;description) . '&lt;/wp:tag_description&gt;';
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function wxr_post_taxonomy() {
 	$categories = get_the_category();
 	$tags = get_the_tags();
@@ -148,7 +222,7 @@ echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;' . get_bloginfo('charset') . '&quot;?' . &quot;&gt;\n&quot;;
 
 &lt;!-- To import this information into a WordPress blog follow these steps. --&gt;
 &lt;!-- 1. Log into that blog as an administrator. --&gt;
-&lt;!-- 2. Go to Manage: Import in the blog's admin panels. --&gt;
+&lt;!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). --&gt;
 &lt;!-- 3. Choose &quot;WordPress&quot; from the list. --&gt;
 &lt;!-- 4. Upload this file using the form provided on that page. --&gt;
 &lt;!-- 5. You will first be asked to map the authors in this export file to users --&gt;
@@ -159,6 +233,7 @@ echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;' . get_bloginfo('charset') . '&quot;?' . &quot;&gt;\n&quot;;
 
 &lt;?php the_generator('export');?&gt;
 &lt;rss version=&quot;2.0&quot;
+	xmlns:excerpt=&quot;http://wordpress.org/export/&lt;?php echo WXR_VERSION; ?&gt;/excerpt/&quot;
 	xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
 	xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
 	xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
@@ -190,6 +265,9 @@ echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;' . get_bloginfo('charset') . '&quot;?' . &quot;&gt;\n&quot;;
 			$where = &quot;WHERE ID IN (&quot;.join(',', $next_posts).&quot;)&quot;;
 			$posts = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;posts $where ORDER BY post_date_gmt ASC&quot;);
 				foreach ($posts as $post) {
+			// Don't export revisions.  They bloat the export.
+			if ( 'revision' == $post-&gt;post_type )
+				continue;
 			setup_postdata($post); ?&gt;
 &lt;item&gt;
 &lt;title&gt;&lt;?php echo apply_filters('the_title_rss', $post-&gt;post_title); ?&gt;&lt;/title&gt;</diff>
      <filename>wp-admin/includes/export.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,70 @@
 &lt;?php
-
-$wp_file_descriptions = array ('index.php' =&gt; __( 'Main Index Template' ), 'style.css' =&gt; __( 'Stylesheet' ), 'rtl.css' =&gt; __( 'RTL Stylesheet' ), 'comments.php' =&gt; __( 'Comments' ), 'comments-popup.php' =&gt; __( 'Popup Comments' ), 'footer.php' =&gt; __( 'Footer' ), 'header.php' =&gt; __( 'Header' ), 'sidebar.php' =&gt; __( 'Sidebar' ), 'archive.php' =&gt; __( 'Archives' ), 'category.php' =&gt; __( 'Category Template' ), 'page.php' =&gt; __( 'Page Template' ), 'search.php' =&gt; __( 'Search Results' ), 'searchform.php' =&gt; __( 'Search Form' ), 'single.php' =&gt; __( 'Single Post' ), '404.php' =&gt; __( '404 Template' ), 'link.php' =&gt; __( 'Links Template' ), 'functions.php' =&gt; __( 'Theme Functions' ), 'attachment.php' =&gt; __( 'Attachment Template' ), 'my-hacks.php' =&gt; __( 'my-hacks.php (legacy hacks support)' ), '.htaccess' =&gt; __( '.htaccess (for rewrite rules )' ),
+/**
+ * File contains all the administration image manipulation functions.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** The descriptions for theme files. */
+$wp_file_descriptions = array (
+	'index.php' =&gt; __( 'Main Index Template' ),
+	'style.css' =&gt; __( 'Stylesheet' ),
+	'rtl.css' =&gt; __( 'RTL Stylesheet' ),
+	'comments.php' =&gt; __( 'Comments' ),
+	'comments-popup.php' =&gt; __( 'Popup Comments' ),
+	'footer.php' =&gt; __( 'Footer' ),
+	'header.php' =&gt; __( 'Header' ),
+	'sidebar.php' =&gt; __( 'Sidebar' ),
+	'archive.php' =&gt; __( 'Archives' ),
+	'category.php' =&gt; __( 'Category Template' ),
+	'page.php' =&gt; __( 'Page Template' ),
+	'search.php' =&gt; __( 'Search Results' ),
+	'searchform.php' =&gt; __( 'Search Form' ),
+	'single.php' =&gt; __( 'Single Post' ),
+	'404.php' =&gt; __( '404 Template' ),
+	'link.php' =&gt; __( 'Links Template' ),
+	'functions.php' =&gt; __( 'Theme Functions' ),
+	'attachment.php' =&gt; __( 'Attachment Template' ),
+	'image.php' =&gt; __('Image Attachment Template'),
+	'video.php' =&gt; __('Video Attachment Template'),
+	'audio.php' =&gt; __('Audio Attachment Template'),
+	'application.php' =&gt; __('Application Attachment Template'),
+	'my-hacks.php' =&gt; __( 'my-hacks.php (legacy hacks support)' ),
+	'.htaccess' =&gt; __( '.htaccess (for rewrite rules )' ),
 	// Deprecated files
 	'wp-layout.css' =&gt; __( 'Stylesheet' ), 'wp-comments.php' =&gt; __( 'Comments Template' ), 'wp-comments-popup.php' =&gt; __( 'Popup Comments Template' ));
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ * @return unknown
+ */
 function get_file_description( $file ) {
 	global $wp_file_descriptions;
 
 	if ( isset( $wp_file_descriptions[basename( $file )] ) ) {
 		return $wp_file_descriptions[basename( $file )];
 	}
-	elseif ( file_exists( ABSPATH . $file ) &amp;&amp; is_file( ABSPATH . $file ) ) {
-		$template_data = implode( '', file( ABSPATH . $file ) );
-		if ( preg_match( &quot;|Template Name:(.*)|i&quot;, $template_data, $name ))
-			return $name[1];
+	elseif ( file_exists( WP_CONTENT_DIR . $file ) &amp;&amp; is_file( WP_CONTENT_DIR . $file ) ) {
+		$template_data = implode( '', file( WP_CONTENT_DIR . $file ) );
+		if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ))
+			return $name[1] . ' Page Template';
 	}
 
 	return basename( $file );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_home_path() {
 	$home = get_option( 'home' );
 	if ( $home != '' &amp;&amp; $home != get_option( 'siteurl' ) ) {
@@ -32,6 +79,14 @@ function get_home_path() {
 	return $home_path;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ * @return unknown
+ */
 function get_real_file_to_edit( $file ) {
 	if ('index.php' == $file || '.htaccess' == $file ) {
 		$real_file = get_home_path() . $file;
@@ -41,8 +96,16 @@ function get_real_file_to_edit( $file ) {
 
 	return $real_file;
 }
-//$folder = Full path to folder
-//$levels = Levels of folders to follow, Default: 100 (PHP Loop limit)
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param string $folder Optional. Full path to folder
+ * @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit).
+ * @return bool|array
+ */
 function list_files( $folder = '', $levels = 100 ) {
 	if( empty($folder) )
 		return false;
@@ -70,6 +133,13 @@ function list_files( $folder = '', $levels = 100 ) {
 	return $files;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_temp_dir() {
 	if ( defined('WP_TEMP_DIR') )
 		return trailingslashit(WP_TEMP_DIR);
@@ -84,6 +154,15 @@ function get_temp_dir() {
 	return '/tmp/';
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $filename
+ * @param unknown_type $dir
+ * @return unknown
+ */
 function wp_tempnam($filename = '', $dir = ''){
 	if ( empty($dir) )
 		$dir = get_temp_dir();
@@ -96,6 +175,15 @@ function wp_tempnam($filename = '', $dir = ''){
 	return $filename;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ * @param unknown_type $allowed_files
+ * @return unknown
+ */
 function validate_file_to_edit( $file, $allowed_files = '' ) {
 	$file = stripslashes( $file );
 
@@ -116,12 +204,16 @@ function validate_file_to_edit( $file, $allowed_files = '' ) {
 	}
 }
 
-// array wp_handle_upload ( array &amp;file [, array overrides] )
-// file: reference to a single element of $_FILES. Call the function once for each uploaded file.
-// overrides: an associative array of names=&gt;values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
-// On success, returns an associative array of file attributes.
-// On failure, returns $overrides['upload_error_handler'](&amp;$file, $message ) or array( 'error'=&gt;$message ).
-function wp_handle_upload( &amp;$file, $overrides = false ) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file.
+ * @param array $overrides Optional. An associative array of names=&gt;values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
+ * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&amp;$file, $message ) or array( 'error'=&gt;$message ).
+ */
+function wp_handle_upload( &amp;$file, $overrides = false, $time = null ) {
 	// The default error handler.
 	if (! function_exists( 'wp_handle_upload_error' ) ) {
 		function wp_handle_upload_error( &amp;$file, $message ) {
@@ -132,6 +224,9 @@ function wp_handle_upload( &amp;$file, $overrides = false ) {
 	// You may define your own function and pass the name in $overrides['upload_error_handler']
 	$upload_error_handler = 'wp_handle_upload_error';
 
+	// You may define your own function and pass the name in $overrides['unique_filename_callback']
+	$unique_filename_callback = null;
+
 	// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
 	$action = 'wp_handle_upload';
 
@@ -141,6 +236,7 @@ function wp_handle_upload( &amp;$file, $overrides = false ) {
 		__( &quot;The uploaded file exceeds the &lt;em&gt;MAX_FILE_SIZE&lt;/em&gt; directive that was specified in the HTML form.&quot; ),
 		__( &quot;The uploaded file was only partially uploaded.&quot; ),
 		__( &quot;No file was uploaded.&quot; ),
+		'',
 		__( &quot;Missing a temporary folder.&quot; ),
 		__( &quot;Failed to write file to disk.&quot; ));
 
@@ -189,7 +285,7 @@ function wp_handle_upload( &amp;$file, $overrides = false ) {
 	}
 
 	// A writable uploads dir will pass this test. Again, there's no point overriding this one.
-	if ( ! ( ( $uploads = wp_upload_dir() ) &amp;&amp; false === $uploads['error'] ) )
+	if ( ! ( ( $uploads = wp_upload_dir($time) ) &amp;&amp; false === $uploads['error'] ) )
 		return $upload_error_handler( $file, $uploads['error'] );
 
 	$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
@@ -212,7 +308,18 @@ function wp_handle_upload( &amp;$file, $overrides = false ) {
 
 	return $return;
 }
-// Pass this function an array similar to that of a $_FILES POST array.
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Pass this function an array similar to that of a $_FILES POST array.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ * @param unknown_type $overrides
+ * @return unknown
+ */
 function wp_handle_sideload( &amp;$file, $overrides = false ) {
 	// The default error handler.
 	if (! function_exists( 'wp_handle_upload_error' ) ) {
@@ -224,6 +331,9 @@ function wp_handle_sideload( &amp;$file, $overrides = false ) {
 	// You may define your own function and pass the name in $overrides['upload_error_handler']
 	$upload_error_handler = 'wp_handle_upload_error';
 
+	// You may define your own function and pass the name in $overrides['unique_filename_callback']
+	$unique_filename_callback = null;
+
 	// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
 	$action = 'wp_handle_sideload';
 
@@ -285,11 +395,11 @@ function wp_handle_sideload( &amp;$file, $overrides = false ) {
 		return $upload_error_handler( $file, $uploads['error'] );
 
 	$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
-	
+
 	// Strip the query strings.
 	$filename = str_replace('?','-', $filename);
 	$filename = str_replace('&amp;','-', $filename);
-	
+
 	// Move the file to the uploads dir
 	$new_file = $uploads['path'] . &quot;/$filename&quot;;
 	if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
@@ -310,45 +420,65 @@ function wp_handle_sideload( &amp;$file, $overrides = false ) {
 }
 
 /**
-* Downloads a url to a local file using the Snoopy HTTP Class
-*
-* @param string $url the URL of the file to download
-* @return mixed WP_Error on failure, string Filename on success.
-*/
+ * Downloads a url to a local file using the Snoopy HTTP Class.
+ *
+ * @since unknown
+ * @todo Transition over to using the new HTTP Request API (jacob).
+ *
+ * @param string $url the URL of the file to download
+ * @return mixed WP_Error on failure, string Filename on success.
+ */
 function download_url( $url ) {
 	//WARNING: The file is not automatically deleted, The script must unlink() the file.
-	if( ! $url )
+	if ( ! $url )
 		return new WP_Error('http_no_url', __('Invalid URL Provided'));
 
 	$tmpfname = wp_tempnam($url);
-	if( ! $tmpfname )
+	if ( ! $tmpfname )
 		return new WP_Error('http_no_file', __('Could not create Temporary file'));
 
-	$handle = @fopen($tmpfname, 'w');
-	if( ! $handle )
+	$handle = @fopen($tmpfname, 'wb');
+	if ( ! $handle )
 		return new WP_Error('http_no_file', __('Could not create Temporary file'));
 
-	require_once( ABSPATH . 'wp-includes/class-snoopy.php' );
-	$snoopy = new Snoopy();
-	$snoopy-&gt;fetch($url);
+	$response = wp_remote_get($url, array('timeout' =&gt; 30));
+
+	if ( is_wp_error($response) ) {
+		fclose($handle);
+		unlink($tmpfname);
+		return $response;
+	}
 
-	if( $snoopy-&gt;status != '200' ){
+	if ( $response['response']['code'] != '200' ){
 		fclose($handle);
 		unlink($tmpfname);
-		return new WP_Error('http_404', trim($snoopy-&gt;response_code));
+		return new WP_Error('http_404', trim($response['response']['message']));
 	}
-	fwrite($handle, $snoopy-&gt;results);
+
+	fwrite($handle, $response['body']);
 	fclose($handle);
 
 	return $tmpfname;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ * @param unknown_type $to
+ * @return unknown
+ */
 function unzip_file($file, $to) {
 	global $wp_filesystem;
 
 	if ( ! $wp_filesystem || !is_object($wp_filesystem) )
 		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
 
+	// Unzip uses a lot of memory
+	@ini_set('memory_limit', '256M');
+
 	$fs =&amp; $wp_filesystem;
 
 	require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
@@ -362,37 +492,56 @@ function unzip_file($file, $to) {
 	if ( 0 == count($archive_files) )
 		return new WP_Error('empty_archive', __('Empty archive'));
 
-	$to = trailingslashit($to);
-	$path = explode('/', $to);
-	$tmppath = '';
-	for ( $j = 0; $j &lt; count($path) - 1; $j++ ) {
-		$tmppath .= $path[$j] . '/';
-		if ( ! $fs-&gt;is_dir($tmppath) )
-			$fs-&gt;mkdir($tmppath, 0755);
+	$path = explode('/', untrailingslashit($to));
+	for ( $i = count($path); $i &gt; 0; $i-- ) { //&gt;0 = first element is empty allways for paths starting with '/'
+		$tmppath = implode('/', array_slice($path, 0, $i) );
+		if ( $fs-&gt;is_dir($tmppath) ) { //Found the highest folder that exists, Create from here(ie +1)
+			for ( $i = $i + 1; $i &lt;= count($path); $i++ ) {
+				$tmppath = implode('/', array_slice($path, 0, $i) );
+				if ( ! $fs-&gt;mkdir($tmppath, FS_CHMOD_DIR) )
+					return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath);
+			}
+			break; //Exit main for loop
+		}
 	}
 
+	$to = trailingslashit($to);
 	foreach ($archive_files as $file) {
-		$path = explode('/', $file['filename']);
-		$tmppath = '';
-
-		// Loop through each of the items and check that the folder exists.
-		for ( $j = 0; $j &lt; count($path) - 1; $j++ ) {
-			$tmppath .= $path[$j] . '/';
-			if ( ! $fs-&gt;is_dir($to . $tmppath) )
-				if ( !$fs-&gt;mkdir($to . $tmppath, 0755) )
-					return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath);
+		$path = $file['folder'] ? $file['filename'] : dirname($file['filename']);
+		$path = explode('/', $path);
+		for ( $i = count($path); $i &gt;= 0; $i-- ) { //&gt;=0 as the first element contains data
+			if ( empty($path[$i]) )
+				continue;
+			$tmppath = $to . implode('/', array_slice($path, 0, $i) );
+			if ( $fs-&gt;is_dir($tmppath) ) {//Found the highest folder that exists, Create from here
+				for ( $i = $i + 1; $i &lt;= count($path); $i++ ) { //&lt; count() no file component please.
+					$tmppath = $to . implode('/', array_slice($path, 0, $i) );
+					if ( ! $fs-&gt;is_dir($tmppath) &amp;&amp; ! $fs-&gt;mkdir($tmppath, FS_CHMOD_DIR) )
+						return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath);
+				}
+				break; //Exit main for loop
+			}
 		}
 
 		// We've made sure the folders are there, so let's extract the file now:
-		if ( ! $file['folder'] )
+		if ( ! $file['folder'] ) {
 			if ( !$fs-&gt;put_contents( $to . $file['filename'], $file['content']) )
 				return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']);
-			$fs-&gt;chmod($to . $file['filename'], 0644);
+			$fs-&gt;chmod($to . $file['filename'], FS_CHMOD_FILE);
+		}
 	}
-
 	return true;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $from
+ * @param unknown_type $to
+ * @return unknown
+ */
 function copy_dir($from, $to) {
 	global $wp_filesystem;
 
@@ -403,12 +552,18 @@ function copy_dir($from, $to) {
 
 	foreach ( (array) $dirlist as $filename =&gt; $fileinfo ) {
 		if ( 'f' == $fileinfo['type'] ) {
-			if ( ! $wp_filesystem-&gt;copy($from . $filename, $to . $filename, true) )
-				return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
-			$wp_filesystem-&gt;chmod($to . $filename, 0644);
+			if ( ! $wp_filesystem-&gt;copy($from . $filename, $to . $filename, true) ) {
+				// If copy failed, chmod file to 0644 and try again.
+				$wp_filesystem-&gt;chmod($to . $filename, 0644);
+				if ( ! $wp_filesystem-&gt;copy($from . $filename, $to . $filename, true) )
+					return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
+			}
+			$wp_filesystem-&gt;chmod($to . $filename, FS_CHMOD_FILE);
 		} elseif ( 'd' == $fileinfo['type'] ) {
-			if ( !$wp_filesystem-&gt;mkdir($to . $filename, 0755) )
-				return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename);
+			if ( !$wp_filesystem-&gt;is_dir($to . $filename) ) {
+				if ( !$wp_filesystem-&gt;mkdir($to . $filename, FS_CHMOD_DIR) )
+					return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename);
+			}
 			$result = copy_dir($from . $filename, $to . $filename);
 			if ( is_wp_error($result) )
 				return $result;
@@ -416,17 +571,25 @@ function copy_dir($from, $to) {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $args
+ * @return unknown
+ */
 function WP_Filesystem( $args = false ) {
 	global $wp_filesystem;
 
 	require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php');
 
-	$method = get_filesystem_method();
+	$method = get_filesystem_method($args);
 
 	if ( ! $method )
 		return false;
 
-	$abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method);
+	$abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method);
 	if( ! file_exists($abstraction_file) )
 		return;
 
@@ -441,10 +604,24 @@ function WP_Filesystem( $args = false ) {
 	if ( !$wp_filesystem-&gt;connect() )
 		return false; //There was an erorr connecting to the server.
 
+	// Set the permission constants if not already set.
+	if ( ! defined('FS_CHMOD_DIR') )
+		define('FS_CHMOD_DIR', 0755 );
+	if ( ! defined('FS_CHMOD_FILE') )
+		define('FS_CHMOD_FILE', 0644 );
+
 	return true;
 }
 
-function get_filesystem_method() {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $args
+ * @return unknown
+ */
+function get_filesystem_method($args = array()) {
 	$method = false;
 	if( function_exists('getmyuid') &amp;&amp; function_exists('fileowner') ){
 		$temp_file = wp_tempnam();
@@ -453,9 +630,140 @@ function get_filesystem_method() {
 		unlink($temp_file);
 	}
 
+	if ( ! $method &amp;&amp; isset($args['connection_type']) &amp;&amp; 'ssh' == $args['connection_type'] &amp;&amp; extension_loaded('ssh2') ) $method = 'ssh2';
 	if ( ! $method &amp;&amp; extension_loaded('ftp') ) $method = 'ftpext';
 	if ( ! $method &amp;&amp; ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
 	return apply_filters('filesystem_method', $method);
 }
 
-?&gt;
\ No newline at end of file
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $form_post
+ * @param unknown_type $type
+ * @param unknown_type $error
+ * @return unknown
+ */
+function request_filesystem_credentials($form_post, $type = '', $error = false) {
+	$req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error);
+	if ( '' !== $req_cred )
+		return $req_cred;
+
+	if ( empty($type) )
+		$type = get_filesystem_method();
+
+	if ( 'direct' == $type )
+		return true;
+
+	$credentials = get_option('ftp_credentials', array());
+	// If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
+	$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']);
+	$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']);
+	$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']);
+
+	// Check to see if we are setting the public/private keys for ssh
+	$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : $credentials['public_key']);
+	$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : $credentials['private_key']);
+
+	if ( strpos($credentials['hostname'], ':') )
+		list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2);
+
+	if ( defined('FTP_SSH') || (isset($_POST['connection_type']) &amp;&amp; 'ssh' == $_POST['connection_type']) )
+		$credentials['connection_type'] = 'ssh';
+	else if ( defined('FTP_SSL') || (isset($_POST['connection_type']) &amp;&amp; 'ftps' == $_POST['connection_type']) )
+		$credentials['connection_type'] = 'ftps';
+	else if ( !isset($credentials['connection_type']) || (isset($_POST['connection_type']) &amp;&amp; 'ftp' == $_POST['connection_type']) )
+		$credentials['connection_type'] = 'ftp';
+
+	if ( ! $error &amp;&amp; !empty($credentials['password']) &amp;&amp; !empty($credentials['username']) &amp;&amp; !empty($credentials['hostname']) ) {
+		$stored_credentials = $credentials;
+		unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']);
+		update_option('ftp_credentials', $stored_credentials);
+		return $credentials;
+	}
+	$hostname = '';
+	$username = '';
+	$password = '';
+	$connection_type = '';
+	if ( !empty($credentials) )
+		extract($credentials, EXTR_OVERWRITE);
+	if ( $error ) {
+		$error_string = __('&lt;strong&gt;Error:&lt;/strong&gt; There was an error connecting to the server, Please verify the settings are correct.');
+		if ( is_wp_error($error) )
+			$error_string = $error-&gt;get_error_message();
+		echo '&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&lt;p&gt;' . $error_string . '&lt;/p&gt;&lt;/div&gt;';
+	}
+?&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+&lt;!--
+jQuery(function($){
+	jQuery(&quot;#ssh&quot;).click(function () {
+		jQuery(&quot;#ssh_keys&quot;).show();
+	});
+	jQuery(&quot;#ftp, #ftps&quot;).click(function () {
+		jQuery(&quot;#ssh_keys&quot;).hide();
+	});
+});
+--&gt;
+&lt;/script&gt;
+&lt;form action=&quot;&lt;?php echo $form_post ?&gt;&quot; method=&quot;post&quot;&gt;
+&lt;div class=&quot;wrap&quot;&gt;
+&lt;h2&gt;&lt;?php _e('Connection Information') ?&gt;&lt;/h2&gt;
+&lt;p&gt;&lt;?php _e('To perform the requested action, connection information is required.') ?&gt;&lt;/p&gt;
+
+&lt;table class=&quot;form-table&quot;&gt;
+&lt;tr valign=&quot;top&quot;&gt;
+&lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;hostname&quot;&gt;&lt;?php _e('Hostname') ?&gt;&lt;/label&gt;&lt;/th&gt;
+&lt;td&gt;&lt;input name=&quot;hostname&quot; type=&quot;text&quot; id=&quot;hostname&quot; value=&quot;&lt;?php echo attribute_escape($hostname); if ( !empty($port) ) echo &quot;:$port&quot;; ?&gt;&quot;&lt;?php if( defined('FTP_HOST') ) echo ' disabled=&quot;disabled&quot;' ?&gt; size=&quot;40&quot; /&gt;&lt;/td&gt;
+&lt;/tr&gt;
+
+&lt;tr valign=&quot;top&quot;&gt;
+&lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;username&quot;&gt;&lt;?php _e('Username') ?&gt;&lt;/label&gt;&lt;/th&gt;
+&lt;td&gt;&lt;input name=&quot;username&quot; type=&quot;text&quot; id=&quot;username&quot; value=&quot;&lt;?php echo attribute_escape($username) ?&gt;&quot;&lt;?php if( defined('FTP_USER') ) echo ' disabled=&quot;disabled&quot;' ?&gt; size=&quot;40&quot; /&gt;&lt;/td&gt;
+&lt;/tr&gt;
+
+&lt;tr valign=&quot;top&quot;&gt;
+&lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;password&quot;&gt;&lt;?php _e('Password') ?&gt;&lt;/label&gt;&lt;/th&gt;
+&lt;td&gt;&lt;input name=&quot;password&quot; type=&quot;password&quot; id=&quot;password&quot; value=&quot;&quot;&lt;?php if( defined('FTP_PASS') ) echo ' disabled=&quot;disabled&quot;' ?&gt; size=&quot;40&quot; /&gt;&lt;?php if( defined('FTP_PASS') &amp;&amp; !empty($password) ) echo '&lt;em&gt;'.__('(Password not shown)').'&lt;/em&gt;'; ?&gt;&lt;/td&gt;
+&lt;/tr&gt;
+
+&lt;tr id=&quot;ssh_keys&quot; valign=&quot;top&quot; style=&quot;&lt;?php if ( 'ssh' != $connection_type ) echo 'display:none' ?&gt;&quot;&gt;
+&lt;th scope=&quot;row&quot;&gt;&lt;?php _e('Authentication Keys') ?&gt;
+&lt;div class=&quot;key-labels textright&quot;&gt;
+&lt;label for=&quot;public_key&quot;&gt;&lt;?php _e('Public Key:') ?&gt;&lt;/label &gt;&lt;br /&gt;
+&lt;label for=&quot;private_key&quot;&gt;&lt;?php _e('Private Key:') ?&gt;&lt;/label&gt;
+&lt;/div&gt;&lt;/th&gt;
+&lt;td&gt;&lt;br /&gt;&lt;input name=&quot;public_key&quot; type=&quot;text&quot; id=&quot;public_key&quot; value=&quot;&quot;&lt;?php if( defined('FTP_PUBKEY') ) echo ' disabled=&quot;disabled&quot;' ?&gt; size=&quot;40&quot; /&gt;&lt;br /&gt;&lt;input name=&quot;private_key&quot; type=&quot;text&quot; id=&quot;private_key&quot; value=&quot;&quot;&lt;?php if( defined('FTP_PRIKEY') ) echo ' disabled=&quot;disabled&quot;' ?&gt; size=&quot;40&quot; /&gt;
+&lt;div&gt;&lt;?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?&gt;&lt;/div&gt;&lt;/td&gt;
+&lt;/tr&gt;
+
+&lt;tr valign=&quot;top&quot;&gt;
+&lt;th scope=&quot;row&quot;&gt;&lt;?php _e('Connection Type') ?&gt;&lt;/th&gt;
+&lt;td&gt;
+&lt;fieldset&gt;&lt;legend class=&quot;hidden&quot;&gt;&lt;?php _e('Connection Type') ?&gt;&lt;/legend&gt;
+&lt;label&gt;&lt;input id=&quot;ftp&quot; name=&quot;connection_type&quot;  type=&quot;radio&quot; value=&quot;ftp&quot; &lt;?php checked('ftp', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled=&quot;disabled&quot;'; ?&gt;/&gt; &lt;?php _e('FTP') ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;label&gt;&lt;input id=&quot;ftps&quot; name=&quot;connection_type&quot; type=&quot;radio&quot; value=&quot;ftps&quot; &lt;?php checked('ftps', $connection_type); if ( defined('FTP_SSH') || defined('FTP_SSH') ) echo ' disabled=&quot;disabled&quot;';  ?&gt;/&gt; &lt;?php _e('FTPS (SSL)') ?&gt;&lt;/label&gt;&lt;br /&gt;
+&lt;?php if ( extension_loaded('ssh2') ) { ?&gt;&lt;label&gt;&lt;input id=&quot;ssh&quot; name=&quot;connection_type&quot; type=&quot;radio&quot; value=&quot;ssh&quot; &lt;?php checked('ssh', $connection_type);  if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled=&quot;disabled&quot;'; ?&gt;/&gt; &lt;?php _e('SSH') ?&gt;&lt;/label&gt;&lt;?php } ?&gt;
+&lt;/fieldset&gt;
+&lt;/td&gt;
+&lt;/tr&gt;
+&lt;/table&gt;
+
+&lt;?php if ( isset( $_POST['version'] ) ) : ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;version&quot; value=&quot;&lt;?php echo attribute_escape($_POST['version']) ?&gt;&quot; /&gt;
+&lt;?php endif; ?&gt;
+&lt;?php if ( isset( $_POST['locale'] ) ) : ?&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;locale&quot; value=&quot;&lt;?php echo attribute_escape($_POST['locale']) ?&gt;&quot; /&gt;
+&lt;?php endif; ?&gt;
+&lt;p class=&quot;submit&quot;&gt;
+&lt;input id=&quot;upgrade&quot; name=&quot;upgrade&quot; type=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php _e('Proceed'); ?&gt;&quot; /&gt;
+&lt;/p&gt;
+&lt;/div&gt;
+&lt;/form&gt;
+&lt;?php
+	return false;
+}
+
+?&gt;</diff>
      <filename>wp-admin/includes/file.php</filename>
    </modified>
    <modified>
      <diff>@@ -3,41 +3,42 @@
  * File contains all the administration image manipulation functions.
  *
  * @package WordPress
+ * @subpackage Administration
  */
 
 /**
- * wp_create_thumbnail() - Create a thumbnail from an Image given a maximum side size.
+ * Create a thumbnail from an Image given a maximum side size.
  *
- * @package WordPress
- * @param	mixed	$file	Filename of the original image, Or attachment id
- * @param	int		$max_side	Maximum length of a single side for the thumbnail
- * @return	string			Thumbnail path on success, Error string on failure
+ * This function can handle most image file formats which PHP supports. If PHP
+ * does not have the functionality to save in a file of the same format, the
+ * thumbnail will be created as a jpeg.
+ *
+ * @since 1.2.0
  *
- * This function can handle most image file formats which PHP supports.
- * If PHP does not have the functionality to save in a file of the same format, the thumbnail will be created as a jpeg.
+ * @param mixed $file Filename of the original image, Or attachment id.
+ * @param int $max_side Maximum length of a single side for the thumbnail.
+ * @return string Thumbnail path on success, Error string on failure.
  */
 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
-	
 	$thumbpath = image_resize( $file, $max_side, $max_side );
 	return apply_filters( 'wp_create_thumbnail', $thumbpath );
 }
 
 /**
- * wp_crop_image() - Crop an Image to a given size.
+ * Crop an Image to a given size.
  *
- * @package WordPress
- * @internal Missing Long Description
- * @param	int	$src_file	The source file
- * @param	int	$src_x		The start x position to crop from
- * @param	int	$src_y		The start y position to crop from
- * @param	int	$src_w		The width to crop
- * @param	int	$src_h		The height to crop
- * @param	int	$dst_w		The destination width
- * @param	int	$dst_h		The destination height
- * @param	int	$src_abs	If the source crop points are absolute
- * @param	int	$dst_file	The destination file to write to
- * @return	string			New filepath on success, String error message on failure
+ * @since 2.1.0
  *
+ * @param string|int $src_file The source file or Attachment ID.
+ * @param int $src_x The start x position to crop from.
+ * @param int $src_y The start y position to crop from.
+ * @param int $src_w The width to crop.
+ * @param int $src_h The height to crop.
+ * @param int $dst_w The destination width.
+ * @param int $dst_h The destination height.
+ * @param int $src_abs Optional. If the source crop points are absolute.
+ * @param string $dst_file Optional. The destination file to write to.
+ * @return string New filepath on success, String error message on failure.
  */
 function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
 	if ( is_numeric( $src_file ) ) // Handle int as attachment ID
@@ -74,54 +75,62 @@ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_
 }
 
 /**
- * wp_generate_attachment_metadata() - Generate post Image attachment Metadata
+ * Generate post image attachment meta data.
  *
- * @package WordPress
- * @internal Missing Long Description
- * @param	int		$attachment_id	Attachment Id to process
- * @param	string	$file	Filepath of the Attached image
- * @return	mixed			Metadata for attachment
+ * @since 2.1.0
  *
+ * @param int $attachment_id Attachment Id to process.
+ * @param string $file Filepath of the Attached image.
+ * @return mixed Metadata for attachment.
  */
 function wp_generate_attachment_metadata( $attachment_id, $file ) {
 	$attachment = get_post( $attachment_id );
 
 	$metadata = array();
 	if ( preg_match('!^image/!', get_post_mime_type( $attachment )) &amp;&amp; file_is_displayable_image($file) ) {
-		$imagesize = getimagesize( $file );
+		$full_path_file = $file;
+		$imagesize = getimagesize( $full_path_file );
 		$metadata['width'] = $imagesize[0];
 		$metadata['height'] = $imagesize[1];
 		list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']);
 		$metadata['hwstring_small'] = &quot;height='$uheight' width='$uwidth'&quot;;
+
+		// Make the file path relative to the upload dir
+		if ( ($uploads = wp_upload_dir()) &amp;&amp; false === $uploads['error'] ) { // Get upload directory
+			if ( 0 === strpos($file, $uploads['basedir']) ) {// Check that the upload base exists in the file path
+				$file = str_replace($uploads['basedir'], '', $file); // Remove upload dir from the file path
+				$file = ltrim($file, '/');
+			}
+		}
 		$metadata['file'] = $file;
 
 		// make thumbnails and other intermediate sizes
-		$sizes = array('thumbnail', 'medium');
+		$sizes = array('thumbnail', 'medium', 'large');
 		$sizes = apply_filters('intermediate_image_sizes', $sizes);
-		
+
 		foreach ($sizes as $size) {
-			$resized = image_make_intermediate_size( $file, get_option(&quot;{$size}_size_w&quot;), get_option(&quot;{$size}_size_h&quot;), get_option(&quot;{$size}_crop&quot;) );
+			$resized = image_make_intermediate_size( $full_path_file, get_option(&quot;{$size}_size_w&quot;), get_option(&quot;{$size}_size_h&quot;), get_option(&quot;{$size}_crop&quot;) );
 			if ( $resized )
 				$metadata['sizes'][$size] = $resized;
 		}
-			
+
 		// fetch additional metadata from exif/iptc
-		$image_meta = wp_read_image_metadata( $file );
+		$image_meta = wp_read_image_metadata( $full_path_file );
 		if ($image_meta)
 			$metadata['image_meta'] = $image_meta;
 
 	}
+
 	return apply_filters( 'wp_generate_attachment_metadata', $metadata );
 }
 
 /**
- * wp_load_image() - Load an image which PHP Supports.
+ * Load an image from a string, if PHP supports it.
  *
- * @package WordPress
- * @internal Missing Long Description
- * @param	string	$file	Filename of the image to load
- * @return	resource		The resulting image resource on success, Error string on failure.
+ * @since 2.1.0
  *
+ * @param string $file Filename of the image to load.
+ * @return resource The resulting image resource on success, Error string on failure.
  */
 function wp_load_image( $file ) {
 	if ( is_numeric( $file ) )
@@ -144,36 +153,43 @@ function wp_load_image( $file ) {
 }
 
 /**
- * get_udims() - Calculated the new dimentions for downsampled images
+ * Calculated the new dimentions for a downsampled image.
  *
- * @package WordPress
- * @internal Missing Description
+ * @since 2.0.0
  * @see wp_shrink_dimensions()
- * @param	int		$width	Current width of the image
- * @param	int 	$height	Current height of the image
- * @return	mixed			Array(height,width) of shrunk dimensions.
  *
+ * @param int $width Current width of the image
+ * @param int $height Current height of the image
+ * @return mixed Array(height,width) of shrunk dimensions.
  */
 function get_udims( $width, $height) {
 	return wp_shrink_dimensions( $width, $height );
 }
+
 /**
- * wp_shrink_dimensions() - Calculates the new dimentions for a downsampled image.
+ * Calculates the new dimentions for a downsampled image.
  *
- * @package WordPress
- * @internal Missing Long Description
- * @param	int		$width	Current width of the image
- * @param	int 	$height	Current height of the image
- * @param	int		$wmax	Maximum wanted width
- * @param	int		$hmax	Maximum wanted height
- * @return	mixed			Array(height,width) of shrunk dimensions.
+ * @since 2.0.0
+ * @see wp_constrain_dimensions()
  *
+ * @param int $width Current width of the image
+ * @param int $height Current height of the image
+ * @param int $wmax Maximum wanted width
+ * @param int $hmax Maximum wanted height
+ * @return mixed Array(height,width) of shrunk dimensions.
  */
 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
 	return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
 }
 
-// convert a fraction string to a decimal
+/**
+ * Convert a fraction string to a decimal.
+ *
+ * @since 2.5.0
+ *
+ * @param string $str
+ * @return int|float
+ */
 function wp_exif_frac2dec($str) {
 	@list( $n, $d ) = explode( '/', $str );
 	if ( !empty($d) )
@@ -181,25 +197,47 @@ function wp_exif_frac2dec($str) {
 	return $str;
 }
 
-// convert the exif date format to a unix timestamp
+/**
+ * Convert the exif date format to a unix timestamp.
+ *
+ * @since 2.5.0
+ *
+ * @param string $str
+ * @return int
+ */
 function wp_exif_date2ts($str) {
-	// seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?
 	@list( $date, $time ) = explode( ' ', trim($str) );
 	@list( $y, $m, $d ) = explode( ':', $date );
 
 	return strtotime( &quot;{$y}-{$m}-{$d} {$time}&quot; );
 }
 
-// get extended image metadata, exif or iptc as available
+/**
+ * Get extended image metadata, exif or iptc as available.
+ *
+ * Retrieves the EXIF metadata aperture, credit, camera, caption, copyright, iso
+ * created_timestamp, focal_length, shutter_speed, and title.
+ *
+ * The IPTC metadata that is retrieved is APP13, credit, byline, created date
+ * and time, caption, copyright, and title. Also includes FNumber, Model,
+ * DateTimeDigitized, FocalLength, ISOSpeedRatings, and ExposureTime.
+ *
+ * @todo Try other exif libraries if available.
+ * @since 2.5.0
+ *
+ * @param string $file
+ * @return bool|array False on failure. Image metadata array on success.
+ */
 function wp_read_image_metadata( $file ) {
 	if ( !file_exists( $file ) )
 		return false;
 
 	list(,,$sourceImageType) = getimagesize( $file );
 
-	// exif contains a bunch of data we'll probably never need formatted in ways that are difficult to use.
-	// We'll normalize it and just extract the fields that are likely to be useful.  Fractions and numbers
-	// are converted to floats, dates to unix timestamps, and everything else to strings.
+	// exif contains a bunch of data we'll probably never need formatted in ways
+	// that are difficult to use. We'll normalize it and just extract the fields
+	// that are likely to be useful.  Fractions and numbers are converted to
+	// floats, dates to unix timestamps, and everything else to strings.
 	$meta = array(
 		'aperture' =&gt; 0,
 		'credit' =&gt; '',
@@ -213,7 +251,8 @@ function wp_read_image_metadata( $file ) {
 		'title' =&gt; '',
 	);
 
-	// read iptc first, since it might contain data not available in exif such as caption, description etc
+	// read iptc first, since it might contain data not available in exif such
+	// as caption, description etc
 	if ( is_callable('iptcparse') ) {
 		getimagesize($file, $info);
 		if ( !empty($info['APP13']) ) {
@@ -222,7 +261,7 @@ function wp_read_image_metadata( $file ) {
 				$meta['credit'] = utf8_encode(trim($iptc['2#110'][0]));
 			elseif ( !empty($iptc['2#080'][0]) ) // byline
 				$meta['credit'] = utf8_encode(trim($iptc['2#080'][0]));
-			if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time
+			if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created date and time
 				$meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]);
 			if ( !empty($iptc['2#120'][0]) ) // caption
 				$meta['caption'] = utf8_encode(trim($iptc['2#120'][0]));
@@ -249,33 +288,42 @@ function wp_read_image_metadata( $file ) {
 		if (!empty($exif['ExposureTime']))
 			$meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] );
 	}
-	// FIXME: try other exif libraries if available
 
 	return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType );
 
 }
 
-// is the file a real image file?
+/**
+ * Validate that file is an image.
+ *
+ * @since 2.5.0
+ *
+ * @param string $path File path to test if valid image.
+ * @return bool True if valid image, false if not valid image.
+ */
 function file_is_valid_image($path) {
 	$size = @getimagesize($path);
 	return !empty($size);
 }
 
-// is the file an image suitable for displaying within a web page?
+/**
+ * Validate that file is suitable for displaying within a web page.
+ *
+ * @since 2.5.0
+ * @uses apply_filters() Calls 'file_is_displayable_image' on $result and $path.
+ *
+ * @param string $path File path to test.
+ * @return bool True if suitable, false if not suitable.
+ */
 function file_is_displayable_image($path) {
 	$info = @getimagesize($path);
 	if ( empty($info) )
 		$result = false;
-	elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) )
-		// only gif, jpeg and png images can reliably be displayed
-		$result = false;
-	elseif ( $info['channels'] &gt; 0 &amp;&amp; $info['channels'] != 3 ) {
-		// some web browsers can't display cmyk or grayscale jpegs
+	elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) )	// only gif, jpeg and png images can reliably be displayed
 		$result = false;
-	}
 	else
 		$result = true;
-		
+
 	return apply_filters('file_is_displayable_image', $result, $path);
 }
 </diff>
      <filename>wp-admin/includes/image.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,18 @@
 &lt;?php
+/**
+ * WordPress Administration Importer API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/**
+ * Retrieve list of importers.
+ *
+ * @since 2.0.0
+ *
+ * @return array
+ */
 function get_importers() {
 	global $wp_importers;
 	if ( is_array($wp_importers) )
@@ -7,6 +20,17 @@ function get_importers() {
 	return $wp_importers;
 }
 
+/**
+ * Register importer for WordPress.
+ *
+ * @since 2.0.0
+ *
+ * @param string $id Importer tag. Used to uniquely identify importer.
+ * @param string $name Importer name and title.
+ * @param string $description Importer description.
+ * @param callback $callback Callback to run.
+ * @return WP_Error Returns WP_Error when $callback is WP_Error.
+ */
 function register_importer( $id, $name, $description, $callback ) {
 	global $wp_importers;
 	if ( is_wp_error( $callback ) )
@@ -14,10 +38,26 @@ function register_importer( $id, $name, $description, $callback ) {
 	$wp_importers[$id] = array ( $name, $description, $callback );
 }
 
+/**
+ * Cleanup importer.
+ *
+ * Removes attachment based on ID.
+ *
+ * @since 2.0.0
+ *
+ * @param string $id Importer ID.
+ */
 function wp_import_cleanup( $id ) {
 	wp_delete_attachment( $id );
 }
 
+/**
+ * Handle importer uploading and add attachment.
+ *
+ * @since 2.0.0
+ *
+ * @return array
+ */
 function wp_import_handle_upload() {
 	$overrides = array( 'test_form' =&gt; false, 'test_type' =&gt; false );
 	$_FILES['import']['name'] .= '.import';</diff>
      <filename>wp-admin/includes/import.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,64 @@
 &lt;?php
-
+/**
+ * WordPress Administration Media API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_tabs() {
 	$_default_tabs = array(
-		'type' =&gt; __('Choose File'), // handler action suffix =&gt; tab text
+		'type' =&gt; __('From Computer'), // handler action suffix =&gt; tab text
+		'type_url' =&gt; __('From URL'),
 		'gallery' =&gt; __('Gallery'),
-		'library' =&gt; __('Media Library'),
+		'library' =&gt; __('Media Library')
 	);
 
 	return apply_filters('media_upload_tabs', $_default_tabs);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $tabs
+ * @return unknown
+ */
 function update_gallery_tab($tabs) {
 	global $wpdb;
+
 	if ( !isset($_REQUEST['post_id']) ) {
 		unset($tabs['gallery']);
 		return $tabs;
 	}
+
 	if ( intval($_REQUEST['post_id']) )
 		$attachments = intval($wpdb-&gt;get_var($wpdb-&gt;prepare(&quot;SELECT count(*) FROM $wpdb-&gt;posts WHERE post_type = 'attachment' AND post_parent = %d&quot;, $_REQUEST['post_id'])));
 
+	if ( empty($attachments) ) {
+		unset($tabs['gallery']);
+		return $tabs;
+	}
+
 	$tabs['gallery'] = sprintf(__('Gallery (%s)'), &quot;&lt;span id='attachments-count'&gt;$attachments&lt;/span&gt;&quot;);
 
 	return $tabs;
 }
 add_filter('media_upload_tabs', 'update_gallery_tab');
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function the_media_upload_tabs() {
 	global $redir_tab;
 	$tabs = media_upload_tabs();
@@ -51,9 +85,25 @@ function the_media_upload_tabs() {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @param unknown_type $alt
+ * @param unknown_type $title
+ * @param unknown_type $align
+ * @param unknown_type $url
+ * @param unknown_type $rel
+ * @param unknown_type $size
+ * @return unknown
+ */
 function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {
 
-	$html = get_image_tag($id, $alt, $title, $align, $size);
+	$htmlalt = ( empty($alt) ) ? $title : $alt;
+
+	$html = get_image_tag($id, $htmlalt, $title, $align, $size);
 
 	$rel = $rel ? ' rel=&quot;attachment wp-att-'.attribute_escape($id).'&quot;' : '';
 
@@ -65,6 +115,20 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
 	return $html;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $html
+ * @param unknown_type $id
+ * @param unknown_type $alt
+ * @param unknown_type $title
+ * @param unknown_type $align
+ * @param unknown_type $url
+ * @param unknown_type $size
+ * @return unknown
+ */
 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
 
 	if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html;
@@ -77,6 +141,8 @@ function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
 	$html = preg_replace( '/align[^\s\'&quot;]+\s?/', '', $html );
 	if ( empty($align) ) $align = 'none';
 
+	$alt = ! empty($alt) ? addslashes($alt) : '';
+
 	$shcode = '[caption id=&quot;' . $id . '&quot; align=&quot;align' . $align
 	. '&quot; width=&quot;' . $width . '&quot; caption=&quot;' . $alt . '&quot;]' . $html . '[/caption]';
 
@@ -84,8 +150,15 @@ function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
 }
 add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 );
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $html
+ */
 function media_send_to_editor($html) {
-	?&gt;
+?&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 /* &lt;![CDATA[ */
 var win = window.dialogArguments || opener || parent || top;
@@ -96,10 +169,28 @@ win.send_to_editor('&lt;?php echo addslashes($html); ?&gt;');
 	exit;
 }
 
-// this handles the file upload POST itself, creating the attachment post
+/**
+ * {@internal Missing Short Description}}
+ *
+ * This handles the file upload POST itself, creating the attachment post.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file_id
+ * @param unknown_type $post_id
+ * @param unknown_type $post_data
+ * @return unknown
+ */
 function media_handle_upload($file_id, $post_id, $post_data = array()) {
 	$overrides = array('test_form'=&gt;false);
-	$file = wp_handle_upload($_FILES[$file_id], $overrides);
+
+	$time = current_time('mysql');
+	if ( $post = get_post($post_id) ) {
+		if ( substr( $post-&gt;post_date, 0, 4 ) &gt; 0 )
+			$time = $post-&gt;post_date;
+	}
+
+	$file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
 
 	if ( isset($file['error']) )
 		return new WP_Error( 'upload_error', $file['error'] );
@@ -128,7 +219,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
 	), $post_data );
 
 	// Save the data
-	$id = wp_insert_attachment($attachment, $file, $post_parent);
+	$id = wp_insert_attachment($attachment, $file, $post_id);
 	if ( !is_wp_error($id) ) {
 		wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
 	}
@@ -137,6 +228,17 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
 
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file_array
+ * @param unknown_type $post_id
+ * @param unknown_type $desc
+ * @param unknown_type $post_data
+ * @return unknown
+ */
 function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
 	$overrides = array('test_form'=&gt;false);
 	$file = wp_handle_sideload($file_array, $overrides);
@@ -170,7 +272,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
 	), $post_data );
 
 	// Save the data
-	$id = wp_insert_attachment($attachment, $file, $post_parent);
+	$id = wp_insert_attachment($attachment, $file, $post_id);
 	if ( !is_wp_error($id) ) {
 		wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
 		return $url;
@@ -178,9 +280,16 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
 	return $id;
 }
 
-
-// wrap iframe content (produced by $content_func) in a doctype, html head/body etc
-// any additional function args will be passed to content_func
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Wrap iframe content (produced by $content_func) in a doctype, html head/body
+ * etc any additional function args will be passed to content_func.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $content_func
+ */
 function wp_iframe($content_func /* ... */) {
 ?&gt;
 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
@@ -220,10 +329,15 @@ if ( is_string($content_func) )
 &lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function media_buttons() {
 	global $post_ID, $temp_ID;
 	$uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
-	$context = apply_filters('media_buttons_context', __('Add media: %s'));
+	$context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
 	$media_upload_iframe_src = &quot;media-upload.php?post_id=$uploading_iframe_ID&quot;;
 	$media_title = __('Add Media');
 	$image_upload_iframe_src = apply_filters('image_upload_iframe_src', &quot;$media_upload_iframe_src&amp;amp;type=image&quot;);
@@ -245,6 +359,13 @@ EOF;
 add_action( 'media_buttons', 'media_buttons' );
 add_action('media_upload_media', 'media_upload_handler');
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_form_handler() {
 	check_admin_referer('media-form');
 
@@ -258,6 +379,8 @@ function media_upload_form_handler() {
 			$post['post_excerpt'] = $attachment['post_excerpt'];
 		if ( isset($attachment['menu_order']) )
 			$post['menu_order'] = $attachment['menu_order'];
+		if ( isset($attachment['post_parent']) )
+			$post['post_parent'] = $attachment['post_parent'];
 
 		$post = apply_filters('attachment_fields_to_save', $post, $attachment);
 
@@ -274,8 +397,16 @@ function media_upload_form_handler() {
 				wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
 	}
 
-	if ( isset($_POST['insert-gallery']) )
-		return media_send_to_editor('[gallery]');
+	if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?&gt;
+		&lt;script type=&quot;text/javascript&quot;&gt;
+		/* &lt;![CDATA[ */
+		var win = window.dialogArguments || opener || parent || top;
+		win.tb_remove();
+		/* ]]&gt; */
+		&lt;/script&gt;
+		&lt;?php
+		exit;
+	}
 
 	if ( isset($_POST['send']) ) {
 		$keys = array_keys($_POST['send']);
@@ -294,7 +425,17 @@ function media_upload_form_handler() {
 	return $errors;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_image() {
+	$errors = array();
+	$id = 0;
+
 	if ( isset($_POST['html-upload']) &amp;&amp; !empty($_FILES) ) {
 		// Upload File button was clicked
 		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@@ -333,15 +474,34 @@ function media_upload_image() {
 		return media_upload_gallery();
 	}
 
+	if ( isset($_GET['tab']) &amp;&amp; $_GET['tab'] == 'type_url' )
+		return wp_iframe( 'media_upload_type_url_form', 'image', $errors, $id );
+
 	return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ * @param unknown_type $post_id
+ * @param unknown_type $desc
+ * @return unknown
+ */
 function media_sideload_image($file, $post_id, $desc = null) {
 	if (!empty($file) ) {
 		$file_array['name'] = basename($file);
-		$file_array['tmp_name'] = download_url($file);
+		$tmp = download_url($file);
+		$file_array['tmp_name'] = $tmp;
 		$desc = @$desc;
 
+		if ( is_wp_error($tmp) ) {
+			@unlink($file_array['tmp_name']);
+			$file_array['tmp_name'] = '';
+		}
+
 		$id = media_handle_sideload($file_array, $post_id, $desc);
 		$src = $id;
 
@@ -358,7 +518,17 @@ function media_sideload_image($file, $post_id, $desc = null) {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_audio() {
+	$errors = array();
+	$id = 0;
+
 	if ( isset($_POST['html-upload']) &amp;&amp; !empty($_FILES) ) {
 		// Upload File button was clicked
 		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@@ -395,10 +565,23 @@ function media_upload_audio() {
 		return media_upload_gallery();
 	}
 
+	if ( isset($_GET['tab']) &amp;&amp; $_GET['tab'] == 'type_url' )
+		return wp_iframe( 'media_upload_type_url_form', 'audio', $errors, $id );
+
 	return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_video() {
+	$errors = array();
+	$id = 0;
+
 	if ( isset($_POST['html-upload']) &amp;&amp; !empty($_FILES) ) {
 		// Upload File button was clicked
 		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@@ -435,10 +618,23 @@ function media_upload_video() {
 		return media_upload_gallery();
 	}
 
+	if ( isset($_GET['tab']) &amp;&amp; $_GET['tab'] == 'type_url' )
+		return wp_iframe( 'media_upload_type_url_form', 'video', $errors, $id );
+
 	return wp_iframe( 'media_upload_type_form', 'video', $errors, $id );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_file() {
+	$errors = array();
+	$id = 0;
+
 	if ( isset($_POST['html-upload']) &amp;&amp; !empty($_FILES) ) {
 		// Upload File button was clicked
 		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@@ -475,10 +671,22 @@ function media_upload_file() {
 		return media_upload_gallery();
 	}
 
+	if ( isset($_GET['tab']) &amp;&amp; $_GET['tab'] == 'type_url' )
+		return wp_iframe( 'media_upload_type_url_form', 'file', $errors, $id );
+
 	return wp_iframe( 'media_upload_type_form', 'file', $errors, $id );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_gallery() {
+	$errors = array();
+
 	if ( !empty($_POST) ) {
 		$return = media_upload_form_handler();
 
@@ -492,7 +700,15 @@ function media_upload_gallery() {
 	return wp_iframe( 'media_upload_gallery_form', $errors );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function media_upload_library() {
+	$errors = array();
 	if ( !empty($_POST) ) {
 		$return = media_upload_form_handler();
 
@@ -505,6 +721,113 @@ function media_upload_library() {
 	return wp_iframe( 'media_upload_library_form', $errors );
 }
 
+/**
+ * Retrieve HTML for the image alignment radio buttons with the specified one checked.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post
+ * @param unknown_type $checked
+ * @return unknown
+ */
+function image_align_input_fields($post, $checked='') {
+
+	$alignments = array('none' =&gt; 'None', 'left' =&gt; 'Left', 'center' =&gt; 'Center', 'right' =&gt; 'Right');
+	if ( !array_key_exists($checked, $alignments) )
+		$checked = 'none';
+
+	$out = array();
+	foreach ($alignments as $name =&gt; $label) {
+
+		$out[] = &quot;&lt;input type='radio' name='attachments[{$post-&gt;ID}][align]' id='image-align-{$name}-{$post-&gt;ID}' value='$name'&quot;.
+		 	( $checked == $name ? &quot; checked='checked'&quot; : &quot;&quot; ) .
+			&quot; /&gt;&lt;label for='image-align-{$name}-{$post-&gt;ID}' class='align image-align-{$name}-label'&gt;&quot; . __($label) . &quot;&lt;/label&gt;&quot;;
+	}
+	return join(&quot;\n&quot;, $out);
+}
+
+/**
+ * Retrieve HTML for the size radio buttons with the specified one checked.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post
+ * @param unknown_type $checked
+ * @return unknown
+ */
+function image_size_input_fields($post, $checked='') {
+
+		// get a list of the actual pixel dimensions of each possible intermediate version of this image
+		$size_names = array('thumbnail' =&gt; __('Thumbnail'), 'medium' =&gt; __('Medium'), 'large' =&gt; __('Large'), 'full' =&gt; __('Full size'));
+
+		foreach ( $size_names as $size =&gt; $name) {
+			$downsize = image_downsize($post-&gt;ID, $size);
+
+			// is this size selectable?
+			$enabled = ( $downsize[3] || 'full' == $size );
+			$css_id = &quot;image-size-{$size}-{$post-&gt;ID}&quot;;
+			// if this size is the default but that's not available, don't select it
+			if ( $checked &amp;&amp; !$enabled )
+				$checked = '';
+			// if $checked was not specified, default to the first available size that's bigger than a thumbnail
+			if ( !$checked &amp;&amp; $enabled &amp;&amp; 'thumbnail' != $size )
+				$checked = $size;
+
+			$html = &quot;&lt;div class='image-size-item'&gt;&lt;input type='radio' &quot;.( $enabled ? '' : &quot;disabled='disabled'&quot;).&quot;name='attachments[$post-&gt;ID][image-size]' id='{$css_id}' value='{$size}'&quot;.( $checked == $size ? &quot; checked='checked'&quot; : '') .&quot; /&gt;&quot;;
+
+			$html .= &quot;&lt;label for='{$css_id}'&gt;&quot; . __($name). &quot;&lt;/label&gt;&quot;;
+			// only show the dimensions if that choice is available
+			if ( $enabled )
+				$html .= &quot; &lt;label for='{$css_id}' class='help'&gt;&quot; . sprintf( __(&quot;(%d&amp;nbsp;&amp;times;&amp;nbsp;%d)&quot;), $downsize[1], $downsize[2] ). &quot;&lt;/label&gt;&quot;;
+
+			$html .= '&lt;/div&gt;';
+
+			$out[] = $html;
+		}
+
+		return array(
+			'label' =&gt; __('Size'),
+			'input' =&gt; 'html',
+			'html'  =&gt; join(&quot;\n&quot;, $out),
+		);
+}
+
+/**
+ * Retrieve HTML for the Link URL buttons with the default link type as specified.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post
+ * @param unknown_type $url_type
+ * @return unknown
+ */
+function image_link_input_fields($post, $url_type='') {
+
+	$file = wp_get_attachment_url($post-&gt;ID);
+	$link = get_attachment_link($post-&gt;ID);
+
+	$url = '';
+	if ( $url_type == 'file' )
+		$url = $file;
+	elseif ( $url_type == 'post' )
+		$url = $link;
+
+	return &quot;&lt;input type='text' class='urlfield' name='attachments[$post-&gt;ID][url]' value='&quot; . attribute_escape($url) . &quot;' /&gt;&lt;br /&gt;
+				&lt;button type='button' class='button urlnone' title=''&gt;&quot; . __('None') . &quot;&lt;/button&gt;
+				&lt;button type='button' class='button urlfile' title='&quot; . attribute_escape($file) . &quot;'&gt;&quot; . __('File URL') . &quot;&lt;/button&gt;
+				&lt;button type='button' class='button urlpost' title='&quot; . attribute_escape($link) . &quot;'&gt;&quot; . __('Post URL') . &quot;&lt;/button&gt;
+&quot;;
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $form_fields
+ * @param unknown_type $post
+ * @return unknown
+ */
 function image_attachment_fields_to_edit($form_fields, $post) {
 	if ( substr($post-&gt;post_mime_type, 0, 5) == 'image' ) {
 		$form_fields['post_title']['required'] = true;
@@ -514,43 +837,42 @@ function image_attachment_fields_to_edit($form_fields, $post) {
 
 		$form_fields['post_content']['label'] = __('Description');
 
-		$thumb = wp_get_attachment_thumb_url($post-&gt;ID);
-
 		$form_fields['align'] = array(
 			'label' =&gt; __('Alignment'),
 			'input' =&gt; 'html',
-			'html'  =&gt; &quot;
-				&lt;input type='radio' name='attachments[$post-&gt;ID][align]' id='image-align-none-$post-&gt;ID' value='none' checked='checked' /&gt;
-				&lt;label for='image-align-none-$post-&gt;ID' class='align image-align-none-label'&gt;&quot; . __('None') . &quot;&lt;/label&gt;
-				&lt;input type='radio' name='attachments[$post-&gt;ID][align]' id='image-align-left-$post-&gt;ID' value='left' /&gt;
-				&lt;label for='image-align-left-$post-&gt;ID' class='align image-align-left-label'&gt;&quot; . __('Left') . &quot;&lt;/label&gt;
-				&lt;input type='radio' name='attachments[$post-&gt;ID][align]' id='image-align-center-$post-&gt;ID' value='center' /&gt;
-				&lt;label for='image-align-center-$post-&gt;ID' class='align image-align-center-label'&gt;&quot; . __('Center') . &quot;&lt;/label&gt;
-				&lt;input type='radio' name='attachments[$post-&gt;ID][align]' id='image-align-right-$post-&gt;ID' value='right' /&gt;
-				&lt;label for='image-align-right-$post-&gt;ID' class='align image-align-right-label'&gt;&quot; . __('Right') . &quot;&lt;/label&gt;\n&quot;,
-		);
-		$form_fields['image-size'] = array(
-			'label' =&gt; __('Size'),
-			'input' =&gt; 'html',
-			'html'  =&gt; &quot;
-				&quot; . ( $thumb ? &quot;&lt;input type='radio' name='attachments[$post-&gt;ID][image-size]' id='image-size-thumb-$post-&gt;ID' value='thumbnail' /&gt;
-				&lt;label for='image-size-thumb-$post-&gt;ID'&gt;&quot; . __('Thumbnail') . &quot;&lt;/label&gt;
-				&quot; : '' ) . &quot;&lt;input type='radio' name='attachments[$post-&gt;ID][image-size]' id='image-size-medium-$post-&gt;ID' value='medium' checked='checked' /&gt;
-				&lt;label for='image-size-medium-$post-&gt;ID'&gt;&quot; . __('Medium') . &quot;&lt;/label&gt;
-				&lt;input type='radio' name='attachments[$post-&gt;ID][image-size]' id='image-size-full-$post-&gt;ID' value='full' /&gt;
-				&lt;label for='image-size-full-$post-&gt;ID'&gt;&quot; . __('Full size') . &quot;&lt;/label&gt;&quot;,
+			'html'  =&gt; image_align_input_fields($post, get_option('image_default_align')),
 		);
+
+		$form_fields['image-size'] = image_size_input_fields($post, get_option('image_default_size'));
 	}
 	return $form_fields;
 }
 
 add_filter('attachment_fields_to_edit', 'image_attachment_fields_to_edit', 10, 2);
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $form_fields
+ * @param unknown_type $post
+ * @return unknown
+ */
 function media_single_attachment_fields_to_edit( $form_fields, $post ) {
 	unset($form_fields['url'], $form_fields['align'], $form_fields['image-size']);
 	return $form_fields;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post
+ * @param unknown_type $attachment
+ * @return unknown
+ */
 function image_attachment_fields_to_save($post, $attachment) {
 	if ( substr($post['post_mime_type'], 0, 5) == 'image' ) {
 		if ( strlen(trim($post['post_title'])) == 0 ) {
@@ -564,6 +886,16 @@ function image_attachment_fields_to_save($post, $attachment) {
 
 add_filter('attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2);
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $html
+ * @param unknown_type $attachment_id
+ * @param unknown_type $attachment
+ * @return unknown
+ */
 function image_media_send_to_editor($html, $attachment_id, $attachment) {
 	$post =&amp; get_post($attachment_id);
 	if ( substr($post-&gt;post_mime_type, 0, 5) == 'image' ) {
@@ -589,6 +921,15 @@ function image_media_send_to_editor($html, $attachment_id, $attachment) {
 
 add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3);
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post
+ * @param unknown_type $errors
+ * @return unknown
+ */
 function get_attachment_fields_to_edit($post, $errors = null) {
 	if ( is_int($post) )
 		$post =&amp; get_post($post);
@@ -596,8 +937,6 @@ function get_attachment_fields_to_edit($post, $errors = null) {
 		$post = (object) $post;
 
 	$edit_post = sanitize_post($post, 'edit');
-	$file = wp_get_attachment_url($post-&gt;ID);
-	$link = get_attachment_link($post-&gt;ID);
 
 	$form_fields = array(
 		'post_title'   =&gt; array(
@@ -616,17 +955,10 @@ function get_attachment_fields_to_edit($post, $errors = null) {
 		'url'          =&gt; array(
 			'label'      =&gt; __('Link URL'),
 			'input'      =&gt; 'html',
-			'html'       =&gt; &quot;
-				&lt;input type='text' name='attachments[$post-&gt;ID][url]' value='&quot; . attribute_escape($file) . &quot;' /&gt;&lt;br /&gt;
-				&lt;button type='button' class='button url-$post-&gt;ID' title=''&gt;&quot; . __('None') . &quot;&lt;/button&gt;
-				&lt;button type='button' class='button url-$post-&gt;ID' title='&quot; . attribute_escape($file) . &quot;'&gt;&quot; . __('File URL') . &quot;&lt;/button&gt;
-				&lt;button type='button' class='button url-$post-&gt;ID' title='&quot; . attribute_escape($link) . &quot;'&gt;&quot; . __('Post URL') . &quot;&lt;/button&gt;
-				&lt;script type='text/javascript'&gt;
-				jQuery('button.url-$post-&gt;ID').bind('click', function(){jQuery(this).siblings('input').val(jQuery(this).attr('title'));});
-				&lt;/script&gt;\n&quot;,
+			'html'       =&gt; image_link_input_fields($post, get_option('image_default_link_type')),
 			'helps'      =&gt; __('Enter a link URL or click above for presets.'),
 		),
-    	'menu_order'   =&gt; array(
+		'menu_order'   =&gt; array(
 			'label'      =&gt; __('Order'),
 			'value'      =&gt; $edit_post-&gt;menu_order
 		),
@@ -661,6 +993,19 @@ function get_attachment_fields_to_edit($post, $errors = null) {
 	return $form_fields;
 }
 
+/**
+ * Retrieve HTML for media items of post gallery.
+ *
+ * The HTML markup retrieved will be created for the progress of SWF Upload
+ * component. Will also create link for showing and hiding the form to modify
+ * the image attachment.
+ *
+ * @since unknown
+ *
+ * @param int $post_id Optional. Post ID.
+ * @param array $errors Errors for attachment, if any.
+ * @return string
+ */
 function get_media_items( $post_id, $errors ) {
 	if ( $post_id ) {
 		$post = get_post($post_id);
@@ -674,20 +1019,27 @@ function get_media_items( $post_id, $errors ) {
 				$attachments[$attachment-&gt;ID] = $attachment;
 	}
 
-	if ( empty($attachments) )
-		return '';
-
-	foreach ( $attachments as $id =&gt; $attachment )
+	$output = '';
+	foreach ( (array) $attachments as $id =&gt; $attachment )
 		if ( $item = get_media_item( $id, array( 'errors' =&gt; isset($errors[$id]) ? $errors[$id] : null) ) )
 			$output .= &quot;\n&lt;div id='media-item-$id' class='media-item child-of-$attachment-&gt;post_parent preloaded'&gt;&lt;div class='progress'&gt;&lt;div class='bar'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id='media-upload-error-$id'&gt;&lt;/div&gt;&lt;div class='filename'&gt;&lt;/div&gt;$item\n&lt;/div&gt;&quot;;
 
 	return $output;
 }
 
+/**
+ * Retrieve HTML form for modifying the image attachment.
+ *
+ * @since unknown
+ *
+ * @param int $attachment_id Attachment ID for modification.
+ * @param string|array $args Optional. Override defaults.
+ * @return string HTML form for attachment.
+ */
 function get_media_item( $attachment_id, $args = null ) {
 	global $redir_tab;
 
-	$default_args = array( 'errors' =&gt; null, 'send' =&gt; true, 'delete' =&gt; true, 'toggle' =&gt; true );
+	$default_args = array( 'errors' =&gt; null, 'send' =&gt; true, 'delete' =&gt; true, 'toggle' =&gt; true, 'show_title' =&gt; true );
 	$args = wp_parse_args( $args, $default_args );
 	extract( $args, EXTR_SKIP );
 
@@ -697,10 +1049,6 @@ function get_media_item( $attachment_id, $args = null ) {
 	else
 		return false;
 
-	$title_label = __('Title');
-	$description_label = __('Description');
-	$tags_label = __('Tags');
-
 	$toggle_on = __('Show');
 	$toggle_off = __('Hide');
 
@@ -708,13 +1056,14 @@ function get_media_item( $attachment_id, $args = null ) {
 
 	$filename = basename($post-&gt;guid);
 	$title = attribute_escape($post-&gt;post_title);
-	$description = attribute_escape($post-&gt;post_content);
+
 	if ( $_tags = get_the_tags($attachment_id) ) {
 		foreach ( $_tags as $tag )
 			$tags[] = $tag-&gt;name;
 		$tags = attribute_escape(join(', ', $tags));
 	}
 
+	$type = '';
 	if ( isset($post_mime_types) ) {
 		$keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post-&gt;post_mime_type));
 		$type = array_shift($keys);
@@ -734,7 +1083,7 @@ function get_media_item( $attachment_id, $args = null ) {
 	}
 
 	$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
-	$display_title = wp_html_excerpt($display_title, 60);
+	$display_title = $show_title ? &quot;&lt;div class='filename new'&gt;&quot; . wp_html_excerpt($display_title, 60) . &quot;&lt;/div&gt;&quot; : '';
 
 	$gallery = ( (isset($_REQUEST['tab']) &amp;&amp; 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) &amp;&amp; 'gallery' == $redir_tab) ) ? true : false;
 	$order = '';
@@ -755,7 +1104,7 @@ function get_media_item( $attachment_id, $args = null ) {
 	$type
 	$toggle_links
 	$order
-	&lt;div class='filename new'&gt;$display_title&lt;/div&gt;
+	$display_title
 	&lt;table class='slidetoggle describe $class'&gt;
 		&lt;thead class='media-item-info'&gt;
 		&lt;tr&gt;
@@ -845,9 +1194,21 @@ function get_media_item( $attachment_id, $args = null ) {
 	foreach ( $hidden_fields as $name =&gt; $value )
 		$item .= &quot;\t&lt;input type='hidden' name='$name' id='$name' value='&quot; . attribute_escape( $value ) . &quot;' /&gt;\n&quot;;
 
+	if ( $post-&gt;post_parent &lt; 1 &amp;&amp; (int) $_REQUEST['post_id'] ) {
+		$parent = (int) $_REQUEST['post_id'];
+		$parent_name = &quot;attachments[$attachment_id][post_parent]&quot;;
+
+		$item .= &quot;\t&lt;input type='hidden' name='$parent_name' id='$parent_name' value='&quot; . $parent . &quot;' /&gt;\n&quot;;
+	}
+
 	return $item;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function media_upload_header() {
 	?&gt;
 	&lt;script type=&quot;text/javascript&quot;&gt;post_id = &lt;?php echo intval($_REQUEST['post_id']); ?&gt;;&lt;/script&gt;
@@ -857,6 +1218,13 @@ function media_upload_header() {
 	&lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $errors
+ */
 function media_upload_form( $errors = null ) {
 	global $type, $tab;
 
@@ -868,7 +1236,7 @@ function media_upload_form( $errors = null ) {
 		$flash = false;
 
 	$flash = apply_filters('flash_uploader', $flash);
-	$post_id = intval($_REQUEST['post_id']);
+	$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
 
 ?&gt;
 &lt;div id=&quot;media-upload-notice&quot;&gt;
@@ -887,10 +1255,16 @@ function media_upload_form( $errors = null ) {
 &lt;?php if ( $flash ) : ?&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 &lt;!--
-jQuery(function($){
+SWFUpload.onload = function() {
 	swfu = new SWFUpload({
+			button_text: '&lt;span class=&quot;button&quot;&gt;&lt;?php _e('Select Files'); ?&gt;&lt;/span&gt;',
+			button_text_style: '.button { text-align: center; font-weight: bold; font-family:&quot;Lucida Grande&quot;,&quot;Lucida Sans Unicode&quot;,Tahoma,Verdana,sans-serif; }',
+			button_height: &quot;24&quot;,
+			button_width: &quot;132&quot;,
+			button_image_url: '&lt;?php echo includes_url('images/upload.png'); ?&gt;',
+			button_placeholder_id: &quot;flash-browse-button&quot;,
 			upload_url : &quot;&lt;?php echo attribute_escape( $flash_action_url ); ?&gt;&quot;,
-			flash_url : &quot;&lt;?php echo includes_url('js/swfupload/swfupload_f9.swf'); ?&gt;&quot;,
+			flash_url : &quot;&lt;?php echo includes_url('js/swfupload/swfupload.swf'); ?&gt;&quot;,
 			file_post_name: &quot;async-upload&quot;,
 			file_types: &quot;&lt;?php echo apply_filters('upload_file_glob', '*.*'); ?&gt;&quot;,
 			post_params : {
@@ -902,8 +1276,6 @@ jQuery(function($){
 				&quot;short&quot; : &quot;1&quot;
 			},
 			file_size_limit : &quot;&lt;?php echo wp_max_upload_size(); ?&gt;b&quot;,
-			swfupload_element_id : &quot;flash-upload-ui&quot;, // id of the element displayed when swfupload is available
-			degraded_element_id : &quot;html-upload-ui&quot;,   // when swfupload is unavailable
 			file_dialog_start_handler : fileDialogStart,
 			file_queued_handler : fileQueued,
 			upload_start_handler : uploadStart,
@@ -913,17 +1285,22 @@ jQuery(function($){
 			upload_complete_handler : uploadComplete,
 			file_queue_error_handler : fileQueueError,
 			file_dialog_complete_handler : fileDialogComplete,
-
+			swfupload_pre_load_handler: swfuploadPreLoad,
+			swfupload_load_failed_handler: swfuploadLoadFailed,
+			custom_settings : {
+				degraded_element_id : &quot;html-upload-ui&quot;, // id of the element displayed when swfupload is unavailable
+				swfupload_element_id : &quot;flash-upload-ui&quot; // id of the element displayed when swfupload is available
+			},
 			debug: false
 		});
-	$(&quot;#flash-browse-button&quot;).bind( &quot;click&quot;, function(){swfu.selectFiles();});
-});
+};
 //--&gt;
 &lt;/script&gt;
 
 &lt;div id=&quot;flash-upload-ui&quot;&gt;
 &lt;?php do_action('pre-flash-upload-ui'); ?&gt;
-	&lt;p&gt;&lt;input id=&quot;flash-browse-button&quot; type=&quot;button&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Choose files to upload' ) ); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;/p&gt;
+
+	&lt;div&gt;&lt;?php _e( 'Choose files to upload' ); ?&gt; &lt;div id=&quot;flash-browse-button&quot;&gt;&lt;/div&gt;&lt;/div&gt;
 &lt;?php do_action('post-flash-upload-ui'); ?&gt;
 	&lt;p class=&quot;howto&quot;&gt;&lt;?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?&gt;&lt;/p&gt;
 &lt;/div&gt;
@@ -932,9 +1309,10 @@ jQuery(function($){
 
 &lt;div id=&quot;html-upload-ui&quot;&gt;
 &lt;?php do_action('pre-html-upload-ui'); ?&gt;
-	&lt;p&gt;
+	&lt;p id=&quot;async-upload-wrap&quot;&gt;
 	&lt;input type=&quot;file&quot; name=&quot;async-upload&quot; id=&quot;async-upload&quot; /&gt; &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;html-upload&quot; value=&quot;&lt;?php echo attribute_escape(__('Upload')); ?&gt;&quot; /&gt; &lt;a href=&quot;#&quot; onclick=&quot;return top.tb_remove();&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
 	&lt;/p&gt;
+
 	&lt;br class=&quot;clear&quot; /&gt;
 	&lt;?php if ( is_lighttpd_before_150() ): ?&gt;
 	&lt;p&gt;&lt;?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?&gt;&lt;/p&gt;
@@ -945,6 +1323,15 @@ jQuery(function($){
 &lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $type
+ * @param unknown_type $errors
+ * @param unknown_type $id
+ */
 function media_upload_type_form($type = 'file', $errors = null, $id = null) {
 	media_upload_header();
 
@@ -952,14 +1339,14 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
 
 	$form_action_url = admin_url(&quot;media-upload.php?type=$type&amp;tab=type&amp;post_id=$post_id&quot;);
 	$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
-
-	$callback = &quot;type_form_$type&quot;;
 ?&gt;
 
 &lt;form enctype=&quot;multipart/form-data&quot; method=&quot;post&quot; action=&quot;&lt;?php echo attribute_escape($form_action_url); ?&gt;&quot; class=&quot;media-upload-form type-form validate&quot; id=&quot;&lt;?php echo $type; ?&gt;-form&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; id=&quot;post_id&quot; value=&quot;&lt;?php echo (int) $post_id; ?&gt;&quot; /&gt;
 &lt;?php wp_nonce_field('media-form'); ?&gt;
-&lt;h3&gt;&lt;?php _e('From Computer'); ?&gt;&lt;/h3&gt;
+
+&lt;h3 class=&quot;media-title&quot;&gt;&lt;?php _e('Add media files from your computer'); ?&gt;&lt;/h3&gt;
+
 &lt;?php media_upload_form( $errors ); ?&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;
@@ -973,18 +1360,49 @@ jQuery(function($){
 });
 --&gt;
 &lt;/script&gt;
-&lt;?php if ( $id &amp;&amp; !is_wp_error($id) ) : ?&gt;
 &lt;div id=&quot;media-items&quot;&gt;
-&lt;?php echo get_media_items( $id, $errors ); ?&gt;
+&lt;?php
+if ( $id ) {
+	if ( !is_wp_error($id) ) {
+		echo get_media_items( $id, $errors );
+	} else {
+		echo '&lt;div id=&quot;media-upload-error&quot;&gt;'.wp_specialchars($id-&gt;get_error_message()).'&lt;/div&gt;';
+		exit;
+	}
+}
+?&gt;
 &lt;/div&gt;
 &lt;input type=&quot;submit&quot; class=&quot;button savebutton&quot; name=&quot;save&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Save all changes' ) ); ?&gt;&quot; /&gt;
+&lt;?php
+}
 
-&lt;?php elseif ( is_callable($callback) ) : ?&gt;
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $type
+ * @param unknown_type $errors
+ * @param unknown_type $id
+ */
+function media_upload_type_url_form($type = 'file', $errors = null, $id = null) {
+	media_upload_header();
 
-&lt;div class=&quot;media-blank&quot;&gt;
-&lt;p style=&quot;text-align:center&quot;&gt;&lt;?php _e('&amp;mdash; OR &amp;mdash;'); ?&gt;&lt;/p&gt;
-&lt;h3&gt;&lt;?php _e('From URL'); ?&gt;&lt;/h3&gt;
-&lt;/div&gt;
+	$post_id = intval($_REQUEST['post_id']);
+
+	$form_action_url = admin_url(&quot;media-upload.php?type=$type&amp;tab=type&amp;post_id=$post_id&quot;);
+	$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
+
+	$callback = &quot;type_url_form_$type&quot;;
+?&gt;
+
+&lt;form enctype=&quot;multipart/form-data&quot; method=&quot;post&quot; action=&quot;&lt;?php echo attribute_escape($form_action_url); ?&gt;&quot; class=&quot;media-upload-form type-form validate&quot; id=&quot;&lt;?php echo $type; ?&gt;-form&quot;&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; id=&quot;post_id&quot; value=&quot;&lt;?php echo (int) $post_id; ?&gt;&quot; /&gt;
+&lt;?php wp_nonce_field('media-form'); ?&gt;
+
+&lt;?php if ( is_callable($callback) ) { ?&gt;
+
+&lt;h3 class=&quot;media-title&quot;&gt;&lt;?php _e('Add media file from URL'); ?&gt;&lt;/h3&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;
 //&lt;![CDATA[
@@ -1066,12 +1484,20 @@ var addExtImage = {
 &lt;?php echo call_user_func($callback); ?&gt;
 &lt;/div&gt;
 &lt;/div&gt;
-&lt;input type=&quot;submit&quot; class=&quot;button savebutton&quot; name=&quot;save&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Save all changes' ) ); ?&gt;&quot; /&gt;
 &lt;/form&gt;
 &lt;?php
-	endif;
+	} else {
+		wp_die( __('Unknown action.') );
+	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $errors
+ */
 function media_upload_gallery_form($errors) {
 	global $redir_tab;
 
@@ -1097,7 +1523,7 @@ jQuery(function($){
 &lt;form enctype=&quot;multipart/form-data&quot; method=&quot;post&quot; action=&quot;&lt;?php echo attribute_escape($form_action_url); ?&gt;&quot; class=&quot;media-upload-form validate&quot; id=&quot;gallery-form&quot;&gt;
 &lt;?php wp_nonce_field('media-form'); ?&gt;
 &lt;?php //media_upload_form( $errors ); ?&gt;
-&lt;table class=&quot;widefat&quot;&gt;
+&lt;table class=&quot;widefat&quot; cellspacing=&quot;0&quot;&gt;
 &lt;thead&gt;&lt;tr&gt;
 &lt;th&gt;&lt;?php _e('Media'); ?&gt;&lt;/th&gt;
 &lt;th class=&quot;order-head&quot;&gt;&lt;?php _e('Order'); ?&gt;&lt;/th&gt;
@@ -1106,17 +1532,99 @@ jQuery(function($){
 &lt;div id=&quot;media-items&quot;&gt;
 &lt;?php echo get_media_items($post_id, $errors); ?&gt;
 &lt;/div&gt;
+
 &lt;p class=&quot;ml-submit&quot;&gt;
-&lt;input type=&quot;submit&quot; class=&quot;button savebutton&quot; name=&quot;save&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Save all changes' ) ); ?&gt;&quot; /&gt;
-&lt;input type=&quot;submit&quot; class=&quot;button insert-gallery&quot; name=&quot;insert-gallery&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?&gt;&quot; /&gt;
+&lt;input type=&quot;submit&quot; class=&quot;button savebutton&quot; style=&quot;display:none;&quot; name=&quot;save&quot; id=&quot;save-all&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Save all changes' ) ); ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; id=&quot;post_id&quot; value=&quot;&lt;?php echo (int) $post_id; ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;type&quot; value=&quot;&lt;?php echo attribute_escape( $GLOBALS['type'] ); ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;tab&quot; value=&quot;&lt;?php echo attribute_escape( $GLOBALS['tab'] ); ?&gt;&quot; /&gt;
 &lt;/p&gt;
+
+&lt;div id=&quot;gallery-settings&quot; style=&quot;display:none;&quot;&gt;
+&lt;div class=&quot;title&quot;&gt;&lt;?php _e('Gallery Settings'); ?&gt;&lt;/div&gt;
+&lt;table id=&quot;basic&quot; class=&quot;describe&quot;&gt;&lt;tbody&gt;
+	&lt;tr&gt;
+	&lt;th scope=&quot;row&quot; class=&quot;label&quot;&gt;
+		&lt;label&gt;
+		&lt;span class=&quot;alignleft&quot;&gt;&lt;?php _e('Link thumbnails to:'); ?&gt;&lt;/span&gt;
+		&lt;/label&gt;
+	&lt;/th&gt;
+	&lt;td class=&quot;field&quot;&gt;
+		&lt;input type=&quot;radio&quot; name=&quot;linkto&quot; id=&quot;linkto-file&quot; value=&quot;file&quot; /&gt;
+		&lt;label for=&quot;linkto-file&quot; class=&quot;radio&quot;&gt;&lt;?php _e('Image File'); ?&gt;&lt;/label&gt;
+
+		&lt;input type=&quot;radio&quot; checked=&quot;checked&quot; name=&quot;linkto&quot; id=&quot;linkto-post&quot; value=&quot;post&quot; /&gt;
+		&lt;label for=&quot;linkto-post&quot; class=&quot;radio&quot;&gt;&lt;?php _e('Attachment Page'); ?&gt;&lt;/label&gt;
+	&lt;/td&gt;
+	&lt;/tr&gt;
+
+	&lt;tr&gt;
+	&lt;th scope=&quot;row&quot; class=&quot;label&quot;&gt;
+		&lt;label&gt;
+		&lt;span class=&quot;alignleft&quot;&gt;&lt;?php _e('Order images by:'); ?&gt;&lt;/span&gt;
+		&lt;/label&gt;
+	&lt;/th&gt;
+	&lt;td class=&quot;field&quot;&gt;
+		&lt;select id=&quot;orderby&quot; name=&quot;orderby&quot;&gt;
+			&lt;option value=&quot;menu_order&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Menu order'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;post_name&quot;&gt;&lt;?php _e('Name'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;ID&quot;&gt;&lt;?php _e('Date/Time'); ?&gt;&lt;/option&gt;
+		&lt;/select&gt;
+	&lt;/td&gt;
+	&lt;/tr&gt;
+
+	&lt;tr&gt;
+	&lt;th scope=&quot;row&quot; class=&quot;label&quot;&gt;
+		&lt;label&gt;
+		&lt;span class=&quot;alignleft&quot;&gt;&lt;?php _e('Order:'); ?&gt;&lt;/span&gt;
+		&lt;/label&gt;
+	&lt;/th&gt;
+	&lt;td class=&quot;field&quot;&gt;
+		&lt;input type=&quot;radio&quot; checked=&quot;checked&quot; name=&quot;order&quot; id=&quot;order-asc&quot; value=&quot;asc&quot; /&gt;
+		&lt;label for=&quot;order-asc&quot; class=&quot;radio&quot;&gt;&lt;?php _e('Ascending'); ?&gt;&lt;/label&gt;
+
+		&lt;input type=&quot;radio&quot; name=&quot;order&quot; id=&quot;order-desc&quot; value=&quot;desc&quot; /&gt;
+		&lt;label for=&quot;order-desc&quot; class=&quot;radio&quot;&gt;&lt;?php _e('Descending'); ?&gt;&lt;/label&gt;
+	&lt;/td&gt;
+	&lt;/tr&gt;
+
+	&lt;tr&gt;
+	&lt;th scope=&quot;row&quot; class=&quot;label&quot;&gt;
+		&lt;label&gt;
+		&lt;span class=&quot;alignleft&quot;&gt;&lt;?php _e('Gallery columns:'); ?&gt;&lt;/span&gt;
+		&lt;/label&gt;
+	&lt;/th&gt;
+	&lt;td class=&quot;field&quot;&gt;
+		&lt;select id=&quot;columns&quot; name=&quot;columns&quot;&gt;
+			&lt;option value=&quot;2&quot;&gt;&lt;?php _e('2'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;3&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('3'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;4&quot;&gt;&lt;?php _e('4'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;5&quot;&gt;&lt;?php _e('5'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;6&quot;&gt;&lt;?php _e('6'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;7&quot;&gt;&lt;?php _e('7'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;8&quot;&gt;&lt;?php _e('8'); ?&gt;&lt;/option&gt;
+			&lt;option value=&quot;9&quot;&gt;&lt;?php _e('9'); ?&gt;&lt;/option&gt;
+		&lt;/select&gt;
+	&lt;/td&gt;
+	&lt;/tr&gt;
+&lt;/tbody&gt;&lt;/table&gt;
+
+&lt;p class=&quot;ml-submit&quot;&gt;
+&lt;input type=&quot;button&quot; class=&quot;button&quot; style=&quot;display:none;&quot; onmousedown=&quot;wpgallery.update();&quot; name=&quot;insert-gallery&quot; id=&quot;insert-gallery&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Insert gallery' ) ); ?&gt;&quot; /&gt;
+&lt;input type=&quot;button&quot; class=&quot;button&quot; style=&quot;display:none;&quot; onmousedown=&quot;wpgallery.update();&quot; name=&quot;update-gallery&quot; id=&quot;update-gallery&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Update gallery settings' ) ); ?&gt;&quot; /&gt;
+&lt;/p&gt;
+&lt;/div&gt;
 &lt;/form&gt;
 &lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $errors
+ */
 function media_upload_library_form($errors) {
 	global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
 
@@ -1126,7 +1634,7 @@ function media_upload_library_form($errors) {
 
 	$form_action_url = admin_url(&quot;media-upload.php?type={$GLOBALS['type']}&amp;tab=library&amp;post_id=$post_id&quot;);
 
-	$_GET['paged'] = intval($_GET['paged']);
+	$_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
 	if ( $_GET['paged'] &lt; 1 )
 		$_GET['paged'] = 1;
 	$start = ( $_GET['paged'] - 1 ) * 10;
@@ -1144,11 +1652,11 @@ function media_upload_library_form($errors) {
 &lt;input type=&quot;hidden&quot; name=&quot;post_id&quot; value=&quot;&lt;?php echo (int) $post_id; ?&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;post_mime_type&quot; value=&quot;&lt;?php echo attribute_escape( $_GET['post_mime_type'] ); ?&gt;&quot; /&gt;
 
-&lt;div id=&quot;search-filter&quot;&gt;
-	&lt;label class=&quot;hidden&quot; for=&quot;post-search-input&quot;&gt;&lt;?php _e('Search Media');?&gt;:&lt;/label&gt;
-	&lt;input type=&quot;text&quot; id=&quot;post-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; /&gt;
+&lt;p id=&quot;media-search&quot; class=&quot;search-box&quot;&gt;
+	&lt;label class=&quot;hidden&quot; for=&quot;media-search-input&quot;&gt;&lt;?php _e('Search Media');?&gt;:&lt;/label&gt;
+	&lt;input type=&quot;text&quot; id=&quot;media-search-input&quot; class=&quot;search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; /&gt;
 	&lt;input type=&quot;submit&quot; value=&quot;&lt;?php echo attribute_escape( __( 'Search Media' ) ); ?&gt;&quot; class=&quot;button&quot; /&gt;
-&lt;/div&gt;
+&lt;/p&gt;
 
 &lt;ul class=&quot;subsubsub&quot;&gt;
 &lt;?php
@@ -1188,6 +1696,8 @@ unset($type_links);
 $page_links = paginate_links( array(
 	'base' =&gt; add_query_arg( 'paged', '%#%' ),
 	'format' =&gt; '',
+	'prev_text' =&gt; __('&amp;laquo;'),
+	'next_text' =&gt; __('&amp;raquo;'),
 	'total' =&gt; ceil($wp_query-&gt;found_posts / 10),
 	'current' =&gt; $_GET['paged']
 ));
@@ -1196,7 +1706,7 @@ if ( $page_links )
 	echo &quot;&lt;div class='tablenav-pages'&gt;$page_links&lt;/div&gt;&quot;;
 ?&gt;
 
-&lt;div class=&quot;alignleft&quot;&gt;
+&lt;div class=&quot;alignleft actions&quot;&gt;
 &lt;?php
 
 $arc_query = &quot;SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb-&gt;posts WHERE post_type = 'attachment' ORDER BY post_date DESC&quot;;
@@ -1263,7 +1773,14 @@ jQuery(function($){
 &lt;?php
 }
 
-function type_form_image() {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
+function type_url_form_image() {
 
 	if ( apply_filters( 'disable_captions', '' ) ) {
 		$alt = __('Alternate Text');
@@ -1273,11 +1790,15 @@ function type_form_image() {
 		$alt_help = __('Also used as alternate text for the image');
 	}
 
+	$default_align = get_option('image_default_align');
+	if ( empty($default_align) )
+		$default_align = 'none';
+
 	return '
 	&lt;table class=&quot;describe&quot;&gt;&lt;tbody&gt;
 		&lt;tr&gt;
 			&lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot; style=&quot;width:120px;&quot;&gt;
-				&lt;span class=&quot;alignleft&quot;&gt;&lt;label for=&quot;src&quot;&gt;' . __('Source') . '&lt;/label&gt;&lt;/span&gt;
+				&lt;span class=&quot;alignleft&quot;&gt;&lt;label for=&quot;src&quot;&gt;' . __('Image URL') . '&lt;/label&gt;&lt;/span&gt;
 				&lt;span class=&quot;alignright&quot;&gt;&lt;img id=&quot;status_img&quot; src=&quot;images/required.gif&quot; title=&quot;required&quot; alt=&quot;required&quot; /&gt;&lt;/span&gt;
 			&lt;/th&gt;
 			&lt;td class=&quot;field&quot;&gt;&lt;input id=&quot;src&quot; name=&quot;src&quot; value=&quot;&quot; type=&quot;text&quot; aria-required=&quot;true&quot; onblur=&quot;addExtImage.getImageData()&quot; /&gt;&lt;/td&gt;
@@ -1302,20 +1823,20 @@ function type_form_image() {
 		&lt;tr class=&quot;align&quot;&gt;
 			&lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;&lt;p&gt;&lt;label for=&quot;align&quot;&gt;' . __('Alignment') . '&lt;/label&gt;&lt;/p&gt;&lt;/th&gt;
 			&lt;td class=&quot;field&quot;&gt;
-				&lt;input name=&quot;align&quot; id=&quot;align-none&quot; value=&quot;alignnone&quot; onclick=&quot;addExtImage.align=this.value&quot; type=&quot;radio&quot; checked=&quot;checked&quot; /&gt;
+				&lt;input name=&quot;align&quot; id=&quot;align-none&quot; value=&quot;none&quot; onclick=&quot;addExtImage.align=\'align\'+this.value&quot; type=&quot;radio&quot;' . ($default_align == 'none' ? ' checked=&quot;checked&quot;' : '').' /&gt;
 				&lt;label for=&quot;align-none&quot; class=&quot;align image-align-none-label&quot;&gt;' . __('None') . '&lt;/label&gt;
-				&lt;input name=&quot;align&quot; id=&quot;align-left&quot; value=&quot;alignleft&quot; onclick=&quot;addExtImage.align=this.value&quot; type=&quot;radio&quot; /&gt;
+				&lt;input name=&quot;align&quot; id=&quot;align-left&quot; value=&quot;left&quot; onclick=&quot;addExtImage.align=\'align\'+this.value&quot; type=&quot;radio&quot;' . ($default_align == 'left' ? ' checked=&quot;checked&quot;' : '').' /&gt;
 				&lt;label for=&quot;align-left&quot; class=&quot;align image-align-left-label&quot;&gt;' . __('Left') . '&lt;/label&gt;
-				&lt;input name=&quot;align&quot; id=&quot;align-center&quot; value=&quot;aligncenter&quot; onclick=&quot;addExtImage.align=this.value&quot; type=&quot;radio&quot; /&gt;
+				&lt;input name=&quot;align&quot; id=&quot;align-center&quot; value=&quot;center&quot; onclick=&quot;addExtImage.align=\'align\'+this.value&quot; type=&quot;radio&quot;' . ($default_align == 'center' ? ' checked=&quot;checked&quot;' : '').' /&gt;
 				&lt;label for=&quot;align-center&quot; class=&quot;align image-align-center-label&quot;&gt;' . __('Center') . '&lt;/label&gt;
-				&lt;input name=&quot;align&quot; id=&quot;align-right&quot; value=&quot;alignright&quot; onclick=&quot;addExtImage.align=this.value&quot; type=&quot;radio&quot; /&gt;
+				&lt;input name=&quot;align&quot; id=&quot;align-right&quot; value=&quot;right&quot; onclick=&quot;addExtImage.align=\'align\'+this.value&quot; type=&quot;radio&quot;' . ($default_align == 'right' ? ' checked=&quot;checked&quot;' : '').' /&gt;
 				&lt;label for=&quot;align-right&quot; class=&quot;align image-align-right-label&quot;&gt;' . __('Right') . '&lt;/label&gt;
 			&lt;/td&gt;
 		&lt;/tr&gt;
 
 		&lt;tr&gt;
 			&lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;
-				&lt;span class=&quot;alignleft&quot;&gt;&lt;label for=&quot;url&quot;&gt;' . __('Link URL') . '&lt;/label&gt;&lt;/span&gt;
+				&lt;span class=&quot;alignleft&quot;&gt;&lt;label for=&quot;url&quot;&gt;' . __('Link Image To:') . '&lt;/label&gt;&lt;/span&gt;
 			&lt;/th&gt;
 			&lt;td class=&quot;field&quot;&gt;&lt;input id=&quot;url&quot; name=&quot;url&quot; value=&quot;&quot; type=&quot;text&quot; /&gt;&lt;br /&gt;
 
@@ -1335,7 +1856,14 @@ function type_form_image() {
 
 }
 
-function type_form_audio() {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
+function type_url_form_audio() {
 	return '
 	&lt;table class=&quot;describe&quot;&gt;&lt;tbody&gt;
 		&lt;tr&gt;
@@ -1363,7 +1891,14 @@ function type_form_audio() {
 ';
 }
 
-function type_form_video() {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
+function type_url_form_video() {
 	return '
 	&lt;table class=&quot;describe&quot;&gt;&lt;tbody&gt;
 		&lt;tr&gt;
@@ -1391,7 +1926,14 @@ function type_form_video() {
 ';
 }
 
-function type_form_file() {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
+function type_url_form_file() {
 	return '
 	&lt;table class=&quot;describe&quot;&gt;&lt;tbody&gt;
 		&lt;tr&gt;
@@ -1419,43 +1961,69 @@ function type_form_file() {
 ';
 }
 
-// support a GET parameter for disabling the flash uploader
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Support a GET parameter for disabling the flash uploader.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $flash
+ * @return unknown
+ */
 function media_upload_use_flash($flash) {
-        if ( array_key_exists('flash', $_REQUEST) )
-                $flash = !empty($_REQUEST['flash']);
-        return $flash;
+	if ( array_key_exists('flash', $_REQUEST) )
+		$flash = !empty($_REQUEST['flash']);
+	return $flash;
 }
 
 add_filter('flash_uploader', 'media_upload_use_flash');
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function media_upload_flash_bypass() {
-        echo '&lt;p class=&quot;upload-flash-bypass&quot;&gt;';
-        printf( __('You are using the Flash uploader.  Problems?  Try the &lt;a href=&quot;%s&quot;&gt;Browser uploader&lt;/a&gt; instead.'), clean_url(add_query_arg('flash', 0)) );
-        echo '&lt;/p&gt;';
+	echo '&lt;p class=&quot;upload-flash-bypass&quot;&gt;';
+	printf( __('You are using the Flash uploader.  Problems?  Try the &lt;a href=&quot;%s&quot;&gt;Browser uploader&lt;/a&gt; instead.'), clean_url(add_query_arg('flash', 0)) );
+	echo '&lt;/p&gt;';
 }
 
-add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
-
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function media_upload_html_bypass() {
-        echo '&lt;p class=&quot;upload-html-bypass&quot;&gt;';
-        if ( array_key_exists('flash', $_REQUEST) )
-                // the user manually selected the browser uploader, so let them switch back to Flash
-                printf( __('You are using the Browser uploader.  Try the &lt;a href=&quot;%s&quot;&gt;Flash uploader&lt;/a&gt; instead.'), clean_url(add_query_arg('flash', 1)) );
-        else
-                // the user probably doesn't have Flash
-                printf( __('You are using the Browser uploader.') );
-
-        echo '&lt;/p&gt;';
+	echo '&lt;p class=&quot;upload-html-bypass&quot;&gt;';
+	if ( array_key_exists('flash', $_REQUEST) )
+		// the user manually selected the browser uploader, so let them switch back to Flash
+		printf( __('You are using the Browser uploader.  Try the &lt;a href=&quot;%s&quot;&gt;Flash uploader&lt;/a&gt; instead.'), clean_url(add_query_arg('flash', 1)) );
+	else
+		// the user probably doesn't have Flash
+		printf( __('You are using the Browser uploader.') );
+
+	echo '&lt;/p&gt;';
 }
 
 add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
 add_action('post-html-upload-ui', 'media_upload_html_bypass');
 
-// make sure the GET parameter sticks when we submit a form
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Make sure the GET parameter sticks when we submit a form.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $url
+ * @return unknown
+ */
 function media_upload_bypass_url($url) {
-        if ( array_key_exists('flash', $_REQUEST) )
-                $url = add_query_arg('flash', intval($_REQUEST['flash']));
-        return $url;
+	if ( array_key_exists('flash', $_REQUEST) )
+		$url = add_query_arg('flash', intval($_REQUEST['flash']));
+	return $url;
 }
 
 add_filter('media_upload_form_url', 'media_upload_bypass_url');</diff>
      <filename>wp-admin/includes/media.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,32 @@
 &lt;?php
+/**
+ * Misc WordPress Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function got_mod_rewrite() {
 	$got_rewrite = apache_mod_loaded('mod_rewrite', true);
 	return apply_filters('got_rewrite', $got_rewrite);
 }
 
-// Returns an array of strings from a file (.htaccess ) from between BEGIN
-// and END markers.
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $filename
+ * @param unknown_type $marker
+ * @return array An array of strings from a file (.htaccess ) from between BEGIN and END markers.
+ */
 function extract_from_markers( $filename, $marker ) {
 	$result = array ();
 
@@ -30,10 +50,20 @@ function extract_from_markers( $filename, $marker ) {
 	return $result;
 }
 
-// Inserts an array of strings into a file (.htaccess ), placing it between
-// BEGIN and END markers.  Replaces existing marked info.  Retains surrounding
-// data.  Creates file if none exists.
-// Returns true on write success, false on failure.
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Inserts an array of strings into a file (.htaccess ), placing it between
+ * BEGIN and END markers. Replaces existing marked info. Retains surrounding
+ * data. Creates file if none exists.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $filename
+ * @param unknown_type $marker
+ * @param unknown_type $insertion
+ * @return bool True on write success, false on failure.
+ */
 function insert_with_markers( $filename, $marker, $insertion ) {
 	if (!file_exists( $filename ) || is_writeable( $filename ) ) {
 		if (!file_exists( $filename ) ) {
@@ -82,9 +112,11 @@ function insert_with_markers( $filename, $marker, $insertion ) {
 /**
  * Updates the htaccess file with the current rules if it is writable.
  *
- * Always writes to the file if it exists and is writable to ensure that we blank out old rules.
+ * Always writes to the file if it exists and is writable to ensure that we
+ * blank out old rules.
+ *
+ * @since unknown
  */
-
 function save_mod_rewrite_rules() {
 	global $wp_rewrite;
 
@@ -103,6 +135,13 @@ function save_mod_rewrite_rules() {
 	return false;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $file
+ */
 function update_recently_edited( $file ) {
 	$oldfiles = (array ) get_option( 'recently_edited' );
 	if ( $oldfiles ) {
@@ -118,7 +157,14 @@ function update_recently_edited( $file ) {
 	update_option( 'recently_edited', $oldfiles );
 }
 
-// If siteurl or home changed, flush rewrite rules.
+/**
+ * If siteurl or home changed, flush rewrite rules.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $old_value
+ * @param unknown_type $value
+ */
 function update_home_siteurl( $old_value, $value ) {
 	global $wp_rewrite;
 
@@ -132,6 +178,14 @@ function update_home_siteurl( $old_value, $value ) {
 add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
 add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $url
+ * @return unknown
+ */
 function url_shorten( $url ) {
 	$short_url = str_replace( 'http://', '', stripslashes( $url ));
 	$short_url = str_replace( 'www.', '', $short_url );
@@ -142,6 +196,13 @@ function url_shorten( $url ) {
 	return $short_url;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $vars
+ */
 function wp_reset_vars( $vars ) {
 	for ( $i=0; $i&lt;count( $vars ); $i += 1 ) {
 		$var = $vars[$i];
@@ -160,4 +221,21 @@ function wp_reset_vars( $vars ) {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $message
+ */
+function show_message($message) {
+	if( is_wp_error($message) ){
+		if( $message-&gt;get_error_data() )
+			$message = $message-&gt;get_error_message() . ': ' . $message-&gt;get_error_data();
+		else
+			$message = $message-&gt;get_error_message();
+	}
+	echo &quot;&lt;p&gt;$message&lt;/p&gt;\n&quot;;
+}
+
 ?&gt;</diff>
      <filename>wp-admin/includes/misc.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,44 +1,173 @@
 &lt;?php
-
-function get_plugin_data( $plugin_file ) {
-	$plugin_data = implode( '', file( $plugin_file ));
-	preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
-	preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
+/**
+ * WordPress Plugin Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Parse the plugin contents to retrieve plugin's metadata.
+ *
+ * The metadata of the plugin's data searches for the following in the plugin's
+ * header. All plugin data must be on its own line. For plugin description, it
+ * must not have any newlines or only parts of the description will be displayed
+ * and the same goes for the plugin data. The below is formatted for printing.
+ *
+ * &lt;code&gt;
+ * /*
+ * Plugin Name: Name of Plugin
+ * Plugin URI: Link to plugin information
+ * Description: Plugin Description
+ * Author: Plugin author's name
+ * Author URI: Link to the author's web site
+ * Version: Must be set in the plugin for WordPress 2.3+
+ * Text Domain: Optional. Unique identifier, should be same as the one used in
+ *		plugin_text_domain()
+ * Domain Path: Optional. Only useful if the translations are located in a
+ *		folder above the plugin's base path. For example, if .mo files are
+ *		located in the locale folder then Domain Path will be &quot;/locale/&quot; and
+ *		must have the first slash. Defaults to the base folder the plugin is
+ *		located in.
+ *  * / # Remove the space to close comment
+ * &lt;/code&gt;
+ *
+ * Plugin data returned array contains the following:
+ *		'Name' - Name of the plugin, must be unique.
+ *		'Title' - Title of the plugin and the link to the plugin's web site.
+ *		'Description' - Description of what the plugin does and/or notes
+ *		from the author.
+ *		'Author' - The author's name
+ *		'AuthorURI' - The authors web site address.
+ *		'Version' - The plugin version number.
+ *		'PluginURI' - Plugin web site address.
+ *		'TextDomain' - Plugin's text domain for localization.
+ *		'DomainPath' - Plugin's relative directory path to .mo files.
+ *
+ * Some users have issues with opening large files and manipulating the contents
+ * for want is usually the first 1kiB or 2kiB. This function stops pulling in
+ * the plugin contents when it has all of the required plugin data.
+ *
+ * The first 8kiB of the file will be pulled in and if the plugin data is not
+ * within that first 8kiB, then the plugin author should correct their plugin
+ * and move the plugin data headers to the top.
+ *
+ * The plugin file is assumed to have permissions to allow for scripts to read
+ * the file. This is not checked however and the file is only opened for
+ * reading.
+ *
+ * @link http://trac.wordpress.org/ticket/5651 Previous Optimizations.
+ * @link http://trac.wordpress.org/ticket/7372 Further and better Optimizations.
+ * @since 1.5.0
+ *
+ * @param string $plugin_file Path to the plugin file
+ * @param bool $markup If the returned data should have HTML markup applied
+ * @param bool $translate If the returned data should be translated
+ * @return array See above for description.
+ */
+function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
+	// We don't need to write to the file, so just open for reading.
+	$fp = fopen($plugin_file, 'r');
+
+	// Pull only the first 8kiB of the file in.
+	$plugin_data = fread( $fp, 8192 );
+
+	// PHP will close file handle, but we are good citizens.
+	fclose($fp);
+
+	preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
+	preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri );
+	preg_match( '|Version:(.*)|i', $plugin_data, $version );
 	preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
 	preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
 	preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
+	preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain );
+	preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path );
 
-	if ( preg_match( &quot;|Version:(.*)|i&quot;, $plugin_data, $version ))
-		$version = trim( $version[1] );
-	else
-		$version = '';
+	foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) {
+		if ( !empty( ${$field} ) )
+			${$field} = trim(${$field}[1]);
+		else
+			${$field} = '';
+	}
 
-	$description = wptexturize( trim( $description[1] ));
+	$plugin_data = array(
+				'Name' =&gt; $name, 'Title' =&gt; $name, 'PluginURI' =&gt; $uri, 'Description' =&gt; $description,
+				'Author' =&gt; $author_name, 'AuthorURI' =&gt; $author_uri, 'Version' =&gt; $version,
+				'TextDomain' =&gt; $text_domain, 'DomainPath' =&gt; $domain_path
+				);
+	if ( $markup || $translate )
+		$plugin_data = _get_plugin_data_markup_translate($plugin_data, $markup, $translate);
+	return $plugin_data;
+}
+
+function _get_plugin_data_markup_translate($plugin_data, $markup = true, $translate = true) {
+
+	//Translate fields
+	if( $translate &amp;&amp; ! empty($plugin_data['TextDomain']) ) {
+		if( ! empty( $plugin_data['DomainPath'] ) )
+			load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file). $plugin_data['DomainPath']);
+		else
+			load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file));
 
-	$name = $plugin_name[1];
-	$name = trim( $name );
-	$plugin = $name;
-	if ('' != trim($plugin_uri[1]) &amp;&amp; '' != $name ) {
-		$plugin = '&lt;a href=&quot;' . trim( $plugin_uri[1] ) . '&quot; title=&quot;'.__( 'Visit plugin homepage' ).'&quot;&gt;'.$plugin.'&lt;/a&gt;';
+		foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field )
+			$plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);
 	}
 
-	if ('' == $author_uri[1] ) {
-		$author = trim( $author_name[1] );
-	} else {
-		$author = '&lt;a href=&quot;' . trim( $author_uri[1] ) . '&quot; title=&quot;'.__( 'Visit author homepage' ).'&quot;&gt;' . trim( $author_name[1] ) . '&lt;/a&gt;';
+	//Apply Markup
+	if ( $markup ) {
+		if ( ! empty($plugin_data['PluginURI']) &amp;&amp; ! empty($plugin_data['Name']) )
+			$plugin_data['Title'] = '&lt;a href=&quot;' . $plugin_data['PluginURI'] . '&quot; title=&quot;' . __( 'Visit plugin homepage' ) . '&quot;&gt;' . $plugin_data['Name'] . '&lt;/a&gt;';
+		else
+			$plugin_data['Title'] = $plugin_data['Name'];
+
+		if ( ! empty($plugin_data['AuthorURI']) )
+			$plugin_data['Author'] = '&lt;a href=&quot;' . $plugin_data['AuthorURI'] . '&quot; title=&quot;' . __( 'Visit author homepage' ) . '&quot;&gt;' . $plugin_data['Author'] . '&lt;/a&gt;';
+
+		$plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
+		if( ! empty($plugin_data['Author']) )
+			$plugin_data['Description'] .= ' &lt;cite&gt;' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.&lt;/cite&gt;';
 	}
 
-	return array('Name' =&gt; $name, 'Title' =&gt; $plugin, 'Description' =&gt; $description, 'Author' =&gt; $author, 'Version' =&gt; $version);
+	$plugins_allowedtags = array('a' =&gt; array('href' =&gt; array(),'title' =&gt; array()),'abbr' =&gt; array('title' =&gt; array()),'acronym' =&gt; array('title' =&gt; array()),'code' =&gt; array(),'em' =&gt; array(),'strong' =&gt; array());
+
+	// Sanitize all displayed data
+	$plugin_data['Title']       = wp_kses($plugin_data['Title'], $plugins_allowedtags);
+	$plugin_data['Version']     = wp_kses($plugin_data['Version'], $plugins_allowedtags);
+	$plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
+	$plugin_data['Author']      = wp_kses($plugin_data['Author'], $plugins_allowedtags);
+
+	return $plugin_data;
 }
 
+/**
+ * Check the plugins directory and retrieve all plugin files with plugin data.
+ *
+ * WordPress only supports plugin files in the base plugins directory
+ * (wp-content/plugins) and in one directory above the plugins directory
+ * (wp-content/plugins/my-plugin). The file it looks for has the plugin data and
+ * must be found in those two locations. It is recommended that do keep your
+ * plugin files in directories.
+ *
+ * The file with the plugin data is the file that will be included and therefore
+ * needs to have the main execution for the plugin. This does not mean
+ * everything must be contained in the file and it is recommended that the file
+ * be split for maintainability. Keep everything in one file for extreme
+ * optimization purposes.
+ *
+ * @since unknown
+ *
+ * @param string $plugin_folder Optional. Relative path to single plugin folder.
+ * @return array Key is the plugin file path and the value is an array of the plugin data.
+ */
 function get_plugins($plugin_folder = '') {
-	
+
 	if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') )
 		$cache_plugins = array();
-	
+
 	if ( isset($cache_plugins[ $plugin_folder ]) )
 		return $cache_plugins[ $plugin_folder ];
-	
+
 	$wp_plugins = array ();
 	$plugin_root = WP_PLUGIN_DIR;
 	if( !empty($plugin_folder) )
@@ -76,7 +205,7 @@ function get_plugins($plugin_folder = '') {
 		if ( !is_readable( &quot;$plugin_root/$plugin_file&quot; ) )
 			continue;
 
-		$plugin_data = get_plugin_data( &quot;$plugin_root/$plugin_file&quot; );
+		$plugin_data = get_plugin_data( &quot;$plugin_root/$plugin_file&quot;, false, false ); //Do not apply markup/translate as it'll be cached.
 
 		if ( empty ( $plugin_data['Name'] ) )
 			continue;
@@ -86,39 +215,82 @@ function get_plugins($plugin_folder = '') {
 
 	uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a[&quot;Name&quot;], $b[&quot;Name&quot;] );' ));
 
-	$cache_plugins[ $plugin_folder ] = $wp_plugins; 
-	wp_cache_set('plugins', $cache_plugins, 'plugins'); 
+	$cache_plugins[ $plugin_folder ] = $wp_plugins;
+	wp_cache_set('plugins', $cache_plugins, 'plugins');
 
 	return $wp_plugins;
 }
 
-function is_plugin_active($plugin){
+/**
+ * Check whether the plugin is active by checking the active_plugins list.
+ *
+ * @since 2.5.0
+ *
+ * @param string $plugin Base plugin path from plugins directory.
+ * @return bool True, if in the active plugins list. False, not in the list.
+ */
+function is_plugin_active($plugin) {
 	return in_array($plugin, get_option('active_plugins'));
 }
 
+/**
+ * Attempts activation of plugin in a &quot;sandbox&quot; and redirects on success.
+ *
+ * A plugin that is already activated will not attempt to be activated again.
+ *
+ * The way it works is by setting the redirection to the error before trying to
+ * include the plugin file. If the plugin fails, then the redirection will not
+ * be overwritten with the success message. Also, the options will not be
+ * updated and the activation hook will not be called on plugin error.
+ *
+ * It should be noted that in no way the below code will actually prevent errors
+ * within the file. The code should not be used elsewhere to replicate the
+ * &quot;sandbox&quot;, which uses redirection to work.
+ * {@source 13 1}
+ *
+ * If any errors are found or text is outputted, then it will be captured to
+ * ensure that the success redirection will update the error redirection.
+ *
+ * @since unknown
+ *
+ * @param string $plugin Plugin path to main plugin file with plugin data.
+ * @param string $redirect Optional. URL to redirect to.
+ * @return WP_Error|null WP_Error on invalid file or null on success.
+ */
 function activate_plugin($plugin, $redirect = '') {
-		$current = get_option('active_plugins');
-		$plugin = trim($plugin);
-
-		$valid = validate_plugin($plugin);
-		if ( is_wp_error($valid) )
-			return $valid;
-
-		if ( !in_array($plugin, $current) ) {
-			if ( !empty($redirect) )
-				wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
-			ob_start();
-			@include(WP_PLUGIN_DIR . '/' . $plugin);
-			$current[] = $plugin;
-			sort($current);
-			update_option('active_plugins', $current);
-			do_action('activate_' . $plugin);
-			ob_end_clean();
-		}
+	$current = get_option('active_plugins');
+	$plugin = plugin_basename(trim($plugin));
 
-		return null;
+	$valid = validate_plugin($plugin);
+	if ( is_wp_error($valid) )
+		return $valid;
+
+	if ( !in_array($plugin, $current) ) {
+		if ( !empty($redirect) )
+			wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
+		ob_start();
+		@include(WP_PLUGIN_DIR . '/' . $plugin);
+		$current[] = $plugin;
+		sort($current);
+		update_option('active_plugins', $current);
+		do_action('activate_' . $plugin);
+		ob_end_clean();
+	}
+
+	return null;
 }
 
+/**
+ * Deactivate a single plugin or multiple plugins.
+ *
+ * The deactivation hook is disabled by the plugin upgrader by using the $silent
+ * parameter.
+ *
+ * @since unknown
+ *
+ * @param string|array $plugins Single plugin or list of plugins to deactivate.
+ * @param bool $silent Optional, default is false. Prevent calling deactivate hook.
+ */
 function deactivate_plugins($plugins, $silent= false) {
 	$current = get_option('active_plugins');
 
@@ -126,6 +298,7 @@ function deactivate_plugins($plugins, $silent= false) {
 		$plugins = array($plugins);
 
 	foreach ( $plugins as $plugin ) {
+		$plugin = plugin_basename($plugin);
 		if( ! is_plugin_active($plugin) )
 			continue;
 		array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu!
@@ -136,6 +309,20 @@ function deactivate_plugins($plugins, $silent= false) {
 	update_option('active_plugins', $current);
 }
 
+/**
+ * Activate multiple plugins.
+ *
+ * When WP_Error is returned, it does not mean that one of the plugins had
+ * errors. It means that one or more of the plugins file path was invalid.
+ *
+ * The execution will be halted as soon as one of the plugins has an error.
+ *
+ * @since unknown
+ *
+ * @param string|array $plugins
+ * @param string $redirect Redirect to page after successful activation.
+ * @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
+ */
 function activate_plugins($plugins, $redirect = '') {
 	if ( !is_array($plugins) )
 		$plugins = array($plugins);
@@ -155,6 +342,18 @@ function activate_plugins($plugins, $redirect = '') {
 	return true;
 }
 
+/**
+ * Remove directory and files of a plugin for a single or list of plugin(s).
+ *
+ * If the plugins parameter list is empty, false will be returned. True when
+ * completed.
+ *
+ * @since unknown
+ *
+ * @param array $plugins List of plugin
+ * @param string $redirect Redirect to page when complete.
+ * @return mixed
+ */
 function delete_plugins($plugins, $redirect = '' ) {
 	global $wp_filesystem;
 
@@ -206,26 +405,33 @@ function delete_plugins($plugins, $redirect = '' ) {
 	$plugins_dir = $wp_filesystem-&gt;wp_plugins_dir();
 	if ( empty($plugins_dir) )
 		return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
-	
+
 	$plugins_dir = trailingslashit( $plugins_dir );
 
 	$errors = array();
 
 	foreach( $plugins as $plugin_file ) {
+		// Run Uninstall hook
+		if ( is_uninstallable_plugin( $plugin_file ) )
+			uninstall_plugin($plugin_file);
+
 		$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
 		// If plugin is in its own directory, recursively delete the directory.
 		if ( strpos($plugin_file, '/') &amp;&amp; $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
 			$deleted = $wp_filesystem-&gt;delete($this_plugin_dir, true);
 		else
 			$deleted = $wp_filesystem-&gt;delete($plugins_dir . $plugin_file);
-	
+
 		if ( ! $deleted )
 			$errors[] = $plugin_file;
 	}
-	
-	if( ! empty($errors) )
+
+	if ( ! empty($errors) )
 		return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
-	
+
+	// Force refresh of plugin update information
+	delete_option('update_plugins');
+
 	return true;
 }
 
@@ -240,7 +446,7 @@ function validate_active_plugins() {
 	}
 
 	//Invalid is any plugin that is deactivated due to error.
-	$invalid = array(); 
+	$invalid = array();
 
 	// If a plugin file does not exist, remove it from the list of active
 	// plugins.
@@ -254,25 +460,109 @@ function validate_active_plugins() {
 	return $invalid;
 }
 
+/**
+ * Validate the plugin path.
+ *
+ * Checks that the file exists and {@link validate_file() is valid file}.
+ *
+ * @since unknown
+ *
+ * @param string $plugin Plugin Path
+ * @return WP_Error|int 0 on success, WP_Error on failure.
+ */
 function validate_plugin($plugin) {
 	if ( validate_file($plugin) )
-		return new WP_Error('plugin_invalid', __('Invalid plugin.'));
+		return new WP_Error('plugin_invalid', __('Invalid plugin path.'));
 	if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
 		return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));
 
 	return 0;
 }
 
+/**
+ * Whether the plugin can be uninstalled.
+ *
+ * @since 2.7.0
+ *
+ * @param string $plugin Plugin path to check.
+ * @return bool Whether plugin can be uninstalled.
+ */
+function is_uninstallable_plugin($plugin) {
+	$file = plugin_basename($plugin);
+
+	$uninstallable_plugins = (array) get_option('uninstall_plugins');
+	if ( isset( $uninstallable_plugins[$file] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Uninstall a single plugin.
+ *
+ * Calls the uninstall hook, if it is available.
+ *
+ * @since 2.7.0
+ *
+ * @param string $plugin Relative plugin path from Plugin Directory.
+ */
+function uninstall_plugin($plugin) {
+	$file = plugin_basename($plugin);
+
+	$uninstallable_plugins = (array) get_option('uninstall_plugins');
+	if ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) {
+		if ( isset( $uninstallable_plugins[$file] ) ) {
+			unset($uninstallable_plugins[$file]);
+			update_option('uninstall_plugins', $uninstallable_plugins);
+		}
+		unset($uninstallable_plugins);
+
+		define('WP_UNINSTALL_PLUGIN', $file);
+		include WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php';
+
+		return true;
+	}
+
+	if ( isset( $uninstallable_plugins[$file] ) ) {
+		$callable = $uninstallable_plugins[$file];
+		unset($uninstallable_plugins[$file]);
+		update_option('uninstall_plugins', $uninstallable_plugins);
+		unset($uninstallable_plugins);
+
+		include WP_PLUGIN_DIR . '/' . $file;
+
+		add_action( 'uninstall_' . $file, $callable );
+		do_action( 'uninstall_' . $file );
+	}
+}
+
 //
 // Menu
 //
 
-function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
 	global $menu, $admin_page_hooks;
 
 	$file = plugin_basename( $file );
 
-	$menu[] = array ( $menu_title, $access_level, $file, $page_title );
+	$admin_page_hooks[$file] = sanitize_title( $menu_title );
+
+	$hookname = get_plugin_page_hookname( $file, '' );
+	if (!empty ( $function ) &amp;&amp; !empty ( $hookname ))
+		add_action( $hookname, $function );
+
+	if ( empty($icon_url) )
+		$icon_url = 'images/generic.png';
+
+	$menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
+
+	return $hookname;
+}
+
+function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
+	global $menu, $admin_page_hooks, $_wp_last_object_menu;
+
+	$file = plugin_basename( $file );
 
 	$admin_page_hooks[$file] = sanitize_title( $menu_title );
 
@@ -280,6 +570,34 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
 	if (!empty ( $function ) &amp;&amp; !empty ( $hookname ))
 		add_action( $hookname, $function );
 
+	if ( empty($icon_url) )
+		$icon_url = 'images/generic.png';
+
+	$_wp_last_object_menu++;
+
+	$menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
+
+	return $hookname;
+}
+
+function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
+	global $menu, $admin_page_hooks, $_wp_last_utility_menu;
+
+	$file = plugin_basename( $file );
+
+	$admin_page_hooks[$file] = sanitize_title( $menu_title );
+
+	$hookname = get_plugin_page_hookname( $file, '' );
+	if (!empty ( $function ) &amp;&amp; !empty ( $hookname ))
+		add_action( $hookname, $function );
+
+	if ( empty($icon_url) )
+		$icon_url = 'images/generic.png';
+
+	$_wp_last_utility_menu++;
+
+	$menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
+
 	return $hookname;
 }
 
@@ -320,8 +638,18 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
 	return $hookname;
 }
 
+/**
+ * Add sub menu page to the tools main menu.
+ *
+ * @param string $page_title
+ * @param unknown_type $menu_title
+ * @param unknown_type $access_level
+ * @param unknown_type $file
+ * @param unknown_type $function
+ * @return unknown
+ */
 function add_management_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
-	return add_submenu_page( 'edit.php', $page_title, $menu_title, $access_level, $file, $function );
+	return add_submenu_page( 'tools.php', $page_title, $menu_title, $access_level, $file, $function );
 }
 
 function add_options_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
@@ -340,11 +668,35 @@ function add_users_page( $page_title, $menu_title, $access_level, $file, $functi
 	return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function );
 }
 
+function add_dashboard_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+	return add_submenu_page( 'index.php', $page_title, $menu_title, $access_level, $file, $function );
+}
+
+function add_posts_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+	return add_submenu_page( 'edit.php', $page_title, $menu_title, $access_level, $file, $function );
+}
+
+function add_media_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+	return add_submenu_page( 'upload.php', $page_title, $menu_title, $access_level, $file, $function );
+}
+
+function add_links_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+	return add_submenu_page( 'link-manager.php', $page_title, $menu_title, $access_level, $file, $function );
+}
+
+function add_pages_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+	return add_submenu_page( 'edit-pages.php', $page_title, $menu_title, $access_level, $file, $function );
+}
+
+function add_comments_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
+	return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $access_level, $file, $function );
+}
+
 //
 // Pluggable Menu Support -- Private
 //
 
-function get_admin_page_parent() {
+function get_admin_page_parent( $parent = '' ) {
 	global $parent_file;
 	global $menu;
 	global $submenu;
@@ -354,12 +706,19 @@ function get_admin_page_parent() {
 	global $_wp_menu_nopriv;
 	global $_wp_submenu_nopriv;
 
+	if ( !empty ( $parent ) &amp;&amp; 'admin.php' != $parent ) {
+		if ( isset( $_wp_real_parent_file[$parent] ) )
+			$parent = $_wp_real_parent_file[$parent];
+		return $parent;
+	}
+/*
 	if ( !empty ( $parent_file ) ) {
 		if ( isset( $_wp_real_parent_file[$parent_file] ) )
 			$parent_file = $_wp_real_parent_file[$parent_file];
 
 		return $parent_file;
 	}
+*/
 
 	if ( $pagenow == 'admin.php' &amp;&amp; isset( $plugin_page ) ) {
 		foreach ( $menu as $parent_menu ) {
@@ -400,7 +759,8 @@ function get_admin_page_parent() {
 		}
 	}
 
-	$parent_file = '';
+	if ( empty($parent_file) )
+		$parent_file = '';
 	return '';
 }
 
@@ -418,6 +778,7 @@ function get_admin_page_title() {
 	$hook = get_plugin_page_hook( $plugin_page, $pagenow );
 
 	$parent = $parent1 = get_admin_page_parent();
+
 	if ( empty ( $parent) ) {
 		foreach ( $menu as $menu_array ) {
 			if ( isset( $menu_array[3] ) ) {
@@ -473,17 +834,17 @@ function get_plugin_page_hook( $plugin_page, $parent_page ) {
 function get_plugin_page_hookname( $plugin_page, $parent_page ) {
 	global $admin_page_hooks;
 
-	$parent = get_admin_page_parent();
+	$parent = get_admin_page_parent( $parent_page );
 
 	$page_type = 'admin';
-	if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) {
-		if ( isset( $admin_page_hooks[$plugin_page] ))
+	if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {
+		if ( isset( $admin_page_hooks[$plugin_page] ) )
 			$page_type = 'toplevel';
 		else
 			if ( isset( $admin_page_hooks[$parent] ))
 				$page_type = $admin_page_hooks[$parent];
-	} else if ( isset( $admin_page_hooks[$parent_page] ) ) {
-		$page_type = $admin_page_hooks[$parent_page];
+	} else if ( isset( $admin_page_hooks[$parent] ) ) {
+		$page_type = $admin_page_hooks[$parent];
 	}
 
 	$plugin_name = preg_replace( '!\.php!', '', $plugin_page );
@@ -551,4 +912,154 @@ function user_can_access_admin_page() {
 	return true;
 }
 
+/* Whitelist functions */
+
+/**
+ * Register a setting and its sanitization callback
+ *
+ * @since 2.7.0
+ *
+ * @param string $option_group A settings group name.  Can be anything.
+ * @param string $option_name The name of an option to sanitize and save.
+ * @param unknown_type $sanitize_callback A callback function that sanitizes the option's value.
+ * @return unknown
+ */
+function register_setting($option_group, $option_name, $sanitize_callback = '') {
+	return add_option_update_handler($option_group, $option_name, $sanitize_callback);
+}
+
+/**
+ * Unregister a setting
+ *
+ * @since 2.7.0
+ *
+ * @param unknown_type $option_group
+ * @param unknown_type $option_name
+ * @param unknown_type $sanitize_callback
+ * @return unknown
+ */
+function unregister_setting($option_group, $option_name, $sanitize_callback = '') {
+	return remove_option_update_handler($option_group, $option_name, $sanitize_callback);
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $option_group
+ * @param unknown_type $option_name
+ * @param unknown_type $sanitize_callback
+ */
+function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
+	global $new_whitelist_options;
+	$new_whitelist_options[ $option_group ][] = $option_name;
+	if ( $sanitize_callback != '' )
+		add_filter( &quot;sanitize_option_{$option_name}&quot;, $sanitize_callback );
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $option_group
+ * @param unknown_type $option_name
+ * @param unknown_type $sanitize_callback
+ */
+function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') {
+	global $new_whitelist_options;
+	$pos = array_search( $option_name, $new_whitelist_options );
+	if ( $pos !== false )
+		unset( $new_whitelist_options[ $option_group ][ $pos ] );
+	if ( $sanitize_callback != '' )
+		remove_filter( &quot;sanitize_option_{$option_name}&quot;, $sanitize_callback );
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $options
+ * @return unknown
+ */
+function option_update_filter( $options ) {
+	global $new_whitelist_options;
+
+	if ( is_array( $new_whitelist_options ) )
+		$options = add_option_whitelist( $new_whitelist_options, $options );
+
+	return $options;
+}
+add_filter( 'whitelist_options', 'option_update_filter' );
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $new_options
+ * @param unknown_type $options
+ * @return unknown
+ */
+function add_option_whitelist( $new_options, $options = '' ) {
+	if( $options == '' ) {
+		global $whitelist_options;
+	} else {
+		$whitelist_options = $options;
+	}
+	foreach( $new_options as $page =&gt; $keys ) {
+		foreach( $keys as $key ) {
+			if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) {
+				$whitelist_options[ $page ] = array();
+				$whitelist_options[ $page ][] = $key;
+			} else {
+				$pos = array_search( $key, $whitelist_options[ $page ] );
+				if ( $pos === false )
+					$whitelist_options[ $page ][] = $key;
+			}
+		}
+	}
+	return $whitelist_options;
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $del_options
+ * @param unknown_type $options
+ * @return unknown
+ */
+function remove_option_whitelist( $del_options, $options = '' ) {
+	if( $options == '' ) {
+		global $whitelist_options;
+	} else {
+		$whitelist_options = $options;
+	}
+	foreach( $del_options as $page =&gt; $keys ) {
+		foreach( $keys as $key ) {
+			$pos = array_search( $key, $whitelist_options[ $page ] );
+			if( $pos !== false )
+				unset( $whitelist_options[ $page ][ $pos ] );
+		}
+	}
+	return $whitelist_options;
+}
+
+/**
+ * Output nonce, action, and option_page fields for a settings page.
+ *
+ * @since 2.7.0
+ *
+ * @param string $option_group A settings group name.  This should match the group name used in register_setting().
+ */
+function settings_fields($option_group) {
+	echo &quot;&lt;input type='hidden' name='option_page' value='$option_group' /&gt;&quot;;
+	echo '&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;update&quot; /&gt;';
+	wp_nonce_field(&quot;$option_group-options&quot;);
+}
+
 ?&gt;</diff>
      <filename>wp-admin/includes/plugin.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,48 @@
 &lt;?php
+/**
+ * WordPress Post Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
 /**
- * _wp_translate_postdata() - Rename $_POST data from form names to DB post columns.
+ * Rename $_POST data from form names to DB post columns.
  *
  * Manipulates $_POST directly.
  *
  * @package WordPress
- * @since 2.6
+ * @since 2.6.0
  *
  * @param bool $update Are we updating a pre-existing post?
+ * @param post_data array Array of post data. Defaults to the contents of $_POST.
  * @return object|bool WP_Error on failure, true on success.
  */
-function _wp_translate_postdata( $update = false ) {
+function _wp_translate_postdata( $update = false, $post_data = null ) {
+
+	if ( empty($post_data) )
+		$post_data = &amp;$_POST;
+
 	if ( $update )
-		$_POST['ID'] = (int) $_POST['post_ID'];
-	$_POST['post_content'] = $_POST['content'];
-	$_POST['post_excerpt'] = $_POST['excerpt'];
-	$_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
-	$_POST['to_ping'] = $_POST['trackback_url'];
-
-	if (!empty ( $_POST['post_author_override'] ) ) {
-		$_POST['post_author'] = (int) $_POST['post_author_override'];
+		$post_data['ID'] = (int) $post_data['post_ID'];
+	$post_data['post_content'] = isset($post_data['content']) ? $post_data['content'] : '';
+	$post_data['post_excerpt'] = isset($post_data['excerpt']) ? $post_data['excerpt'] : '';
+	$post_data['post_parent'] = isset($post_data['parent_id'])? $post_data['parent_id'] : '';
+	if ( isset($post_data['trackback_url']) )
+		$post_data['to_ping'] = $post_data['trackback_url'];
+
+	if (!empty ( $post_data['post_author_override'] ) ) {
+		$post_data['post_author'] = (int) $post_data['post_author_override'];
 	} else {
-		if (!empty ( $_POST['post_author'] ) ) {
-			$_POST['post_author'] = (int) $_POST['post_author'];
+		if (!empty ( $post_data['post_author'] ) ) {
+			$post_data['post_author'] = (int) $post_data['post_author'];
 		} else {
-			$_POST['post_author'] = (int) $_POST['user_ID'];
+			$post_data['post_author'] = (int) $post_data['user_ID'];
 		}
 	}
 
-	if ( $_POST['post_author'] != $_POST['user_ID'] ) {
-		if ( 'page' == $_POST['post_type'] ) {
+	if ( isset($post_data['user_ID']) &amp;&amp; ($post_data['post_author'] != $post_data['user_ID']) ) {
+		if ( 'page' == $post_data['post_type'] ) {
 			if ( !current_user_can( 'edit_others_pages' ) ) {
 				return new WP_Error( 'edit_others_pages', $update ?
 					__( 'You are not allowed to edit pages as this user.' ) :
@@ -48,51 +60,55 @@ function _wp_translate_postdata( $update = false ) {
 	}
 
 	// What to do based on which button they pressed
-	if ( isset($_POST['saveasdraft']) &amp;&amp; '' != $_POST['saveasdraft'] )
-		$_POST['post_status'] = 'draft';
-	if ( isset($_POST['saveasprivate']) &amp;&amp; '' != $_POST['saveasprivate'] )
-		$_POST['post_status'] = 'private';
-	if ( isset($_POST['publish']) &amp;&amp; ( '' != $_POST['publish'] ) &amp;&amp; ( $_POST['post_status'] != 'private' ) )
-		$_POST['post_status'] = 'publish';
-	if ( isset($_POST['advanced']) &amp;&amp; '' != $_POST['advanced'] )
-		$_POST['post_status'] = 'draft';
-
-	$previous_status = get_post_field('post_status',  $_POST['ID']);
-
-	// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. 
+	if ( isset($post_data['saveasdraft']) &amp;&amp; '' != $post_data['saveasdraft'] )
+		$post_data['post_status'] = 'draft';
+	if ( isset($post_data['saveasprivate']) &amp;&amp; '' != $post_data['saveasprivate'] )
+		$post_data['post_status'] = 'private';
+	if ( isset($post_data['publish']) &amp;&amp; ( '' != $post_data['publish'] ) &amp;&amp; ( $post_data['post_status'] != 'private' ) )
+		$post_data['post_status'] = 'publish';
+	if ( isset($post_data['advanced']) &amp;&amp; '' != $post_data['advanced'] )
+		$post_data['post_status'] = 'draft';
+	if ( isset($post_data['pending']) &amp;&amp; '' != $post_data['pending'] )
+		$post_data['post_status'] = 'pending';
+
+	$previous_status = get_post_field('post_status',  isset($post_data['ID']) ? $post_data['ID'] : $post_data['temp_ID']);
+
+	// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
 	// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
-	if ( 'page' == $_POST['post_type'] ) {
-		if ( 'publish' == $_POST['post_status'] &amp;&amp; !current_user_can( 'publish_pages' ) )
-			if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') )
-				$_POST['post_status'] = 'pending';
+	if ( 'page' == $post_data['post_type'] ) {
+		$publish_cap = 'publish_pages';
+		$edit_cap = 'edit_published_pages';
 	} else {
-		if ( 'publish' == $_POST['post_status'] &amp;&amp; !current_user_can( 'publish_posts' ) ) :
-			// Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.
-			if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') )
-				$_POST['post_status'] = 'pending';
-		endif;
+		$publish_cap = 'publish_posts';
+		$edit_cap = 'edit_published_posts';
 	}
+	if ( isset($post_data['post_status']) &amp;&amp; ('publish' == $post_data['post_status'] &amp;&amp; !current_user_can( $publish_cap )) )
+		if ( $previous_status != 'publish' || !current_user_can( $edit_cap ) )
+			$post_data['post_status'] = 'pending';
+
+	if ( ! isset($post_data['post_status']) )
+		$post_data['post_status'] = $previous_status;
 
-	if (!isset( $_POST['comment_status'] ))
-		$_POST['comment_status'] = 'closed';
+	if (!isset( $post_data['comment_status'] ))
+		$post_data['comment_status'] = 'closed';
 
-	if (!isset( $_POST['ping_status'] ))
-		$_POST['ping_status'] = 'closed';
+	if (!isset( $post_data['ping_status'] ))
+		$post_data['ping_status'] = 'closed';
 
 	foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
-		if ( !empty( $_POST['hidden_' . $timeunit] ) &amp;&amp; $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
-			$_POST['edit_date'] = '1';
+		if ( !empty( $post_data['hidden_' . $timeunit] ) &amp;&amp; $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) {
+			$post_data['edit_date'] = '1';
 			break;
 		}
 	}
 
-	if ( !empty( $_POST['edit_date'] ) ) {
-		$aa = $_POST['aa'];
-		$mm = $_POST['mm'];
-		$jj = $_POST['jj'];
-		$hh = $_POST['hh'];
-		$mn = $_POST['mn'];
-		$ss = $_POST['ss'];
+	if ( !empty( $post_data['edit_date'] ) ) {
+		$aa = $post_data['aa'];
+		$mm = $post_data['mm'];
+		$jj = $post_data['jj'];
+		$hh = $post_data['hh'];
+		$mn = $post_data['mn'];
+		$ss = $post_data['ss'];
 		$aa = ($aa &lt;= 0 ) ? date('Y') : $aa;
 		$mm = ($mm &lt;= 0 ) ? date('n') : $mm;
 		$jj = ($jj &gt; 31 ) ? 31 : $jj;
@@ -100,20 +116,29 @@ function _wp_translate_postdata( $update = false ) {
 		$hh = ($hh &gt; 23 ) ? $hh -24 : $hh;
 		$mn = ($mn &gt; 59 ) ? $mn -60 : $mn;
 		$ss = ($ss &gt; 59 ) ? $ss -60 : $ss;
-		$_POST['post_date'] = sprintf( &quot;%04d-%02d-%02d %02d:%02d:%02d&quot;, $aa, $mm, $jj, $hh, $mn, $ss );
-		$_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
+		$post_data['post_date'] = sprintf( &quot;%04d-%02d-%02d %02d:%02d:%02d&quot;, $aa, $mm, $jj, $hh, $mn, $ss );
+		$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
 	}
 
-	return true;
+	return $post_data;
 }
 
+/**
+ * Update an existing post with values provided in $_POST.
+ *
+ * @since unknown
+ *
+ * @param array $post_data Optional.
+ * @return int Post ID.
+ */
+function edit_post( $post_data = null ) {
 
-// Update an existing post with values provided in $_POST.
-function edit_post() {
+	if ( empty($post_data) )
+		$post_data = &amp;$_POST;
 
-	$post_ID = (int) $_POST['post_ID'];
+	$post_ID = (int) $post_data['post_ID'];
 
-	if ( 'page' == $_POST['post_type'] ) {
+	if ( 'page' == $post_data['post_type'] ) {
 		if ( !current_user_can( 'edit_page', $post_ID ) )
 			wp_die( __('You are not allowed to edit this page.' ));
 	} else {
@@ -122,7 +147,7 @@ function edit_post() {
 	}
 
 	// Autosave shouldn't save too soon after a real save
-	if ( 'autosave' == $_POST['action'] ) {
+	if ( 'autosave' == $post_data['action'] ) {
 		$post =&amp; get_post( $post_ID );
 		$now = time();
 		$then = strtotime($post-&gt;post_date_gmt . ' +0000');
@@ -131,24 +156,40 @@ function edit_post() {
 			return $post_ID;
 	}
 
-	$translated = _wp_translate_postdata( true );
-	if ( is_wp_error($translated) )
-		wp_die( $translated-&gt;get_error_message() );
+	$post_data = _wp_translate_postdata( true, $post_data );
+	if ( is_wp_error($post_data) )
+		wp_die( $post_data-&gt;get_error_message() );
+
+	if ( isset($post_data['visibility']) ) {
+		switch ( $post_data['visibility'] ) {
+			case 'public' :
+				$post_data['post_password'] = '';
+				break;
+			case 'password' :
+				unset( $post_data['sticky'] );
+				break;
+			case 'private' :
+				$post_data['post_status'] = 'private';
+				$post_data['post_password'] = '';
+				unset( $post_data['sticky'] );
+				break;
+		}
+	}
 
 	// Meta Stuff
-	if ( isset($_POST['meta']) &amp;&amp; $_POST['meta'] ) {
-		foreach ( $_POST['meta'] as $key =&gt; $value )
+	if ( isset($post_data['meta']) &amp;&amp; $post_data['meta'] ) {
+		foreach ( $post_data['meta'] as $key =&gt; $value )
 			update_meta( $key, $value['key'], $value['value'] );
 	}
 
-	if ( isset($_POST['deletemeta']) &amp;&amp; $_POST['deletemeta'] ) {
-		foreach ( $_POST['deletemeta'] as $key =&gt; $value )
+	if ( isset($post_data['deletemeta']) &amp;&amp; $post_data['deletemeta'] ) {
+		foreach ( $post_data['deletemeta'] as $key =&gt; $value )
 			delete_meta( $key );
 	}
 
 	add_meta( $post_ID );
 
-	wp_update_post( $_POST );
+	wp_update_post( $post_data );
 
 	// Reunite any orphaned attachments with their parent
 	if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
@@ -161,10 +202,121 @@ function edit_post() {
 
 	wp_set_post_lock( $post_ID, $GLOBALS['current_user']-&gt;ID );
 
+	if ( current_user_can( 'edit_others_posts' ) ) {
+		if ( !empty($post_data['sticky']) )
+			stick_post($post_ID);
+		else
+			unstick_post($post_ID);
+	}
+
 	return $post_ID;
 }
 
-// Default post information to use when populating the &quot;Write Post&quot; form.
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Updates all bulk edited posts/pages, adding (but not removing) tags and
+ * categories. Skips pages when they would be their own parent or child.
+ *
+ * @since unknown
+ *
+ * @return array
+ */
+function bulk_edit_posts( $post_data = null ) {
+	global $wpdb;
+
+	if ( empty($post_data) )
+		$post_data = &amp;$_POST;
+
+	if ( 'page' == $post_data['post_type'] ) {
+		if ( ! current_user_can( 'edit_pages' ) )
+			wp_die( __('You are not allowed to edit pages.') );
+	} else {
+		if ( ! current_user_can( 'edit_posts' ) )
+			wp_die( __('You are not allowed to edit posts.') );
+	}
+
+	$post_IDs = array_map( intval, (array) $post_data['post'] );
+
+	$reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' );
+	foreach ( $reset as $field ) {
+		if ( isset($post_data[$field]) &amp;&amp; ( '' == $post_data[$field] || -1 == $post_data[$field] ) )
+			unset($post_data[$field]);
+	}
+
+	if ( isset($post_data['post_category']) ) {
+		if ( is_array($post_data['post_category']) &amp;&amp; ! empty($post_data['post_category']) )
+			$new_cats = array_map( absint, $post_data['post_category'] );
+		else
+			unset($post_data['post_category']);
+	}
+
+	if ( isset($post_data['tags_input']) ) {
+		$new_tags = preg_replace( '/\s*,\s*/', ',', rtrim( trim($post_data['tags_input']), ' ,' ) );
+		$new_tags = explode(',', $new_tags);
+	}
+
+	if ( isset($post_data['post_parent']) &amp;&amp; ($parent = (int) $post_data['post_parent']) ) {
+		$pages = $wpdb-&gt;get_results(&quot;SELECT ID, post_parent FROM $wpdb-&gt;posts WHERE post_type = 'page'&quot;);
+		$children = array();
+
+		for ( $i = 0; $i &lt; 50 &amp;&amp; $parent &gt; 0; $i++ ) {
+			$children[] = $parent;
+
+			foreach ( $pages as $page ) {
+				if ( $page-&gt;ID == $parent ) {
+					$parent = $page-&gt;post_parent;
+					break;
+				}
+			}
+		}
+	}
+
+	$updated = $skipped = $locked = array();
+	foreach ( $post_IDs as $post_ID ) {
+
+		if ( isset($children) &amp;&amp; in_array($post_ID, $children) ) {
+			$skipped[] = $post_ID;
+			continue;
+		}
+
+		if ( wp_check_post_lock( $post_ID ) ) {
+			$locked[] = $post_ID;
+			continue;
+		}
+
+		if ( isset($new_cats) ) {
+			$cats = (array) wp_get_post_categories($post_ID);
+			$post_data['post_category'] = array_unique( array_merge($cats, $new_cats) );
+		}
+
+		if ( isset($new_tags) ) {
+			$tags = wp_get_post_tags($post_ID, array('fields' =&gt; 'names'));
+			$post_data['tags_input'] = array_unique( array_merge($tags, $new_tags) );
+		}
+
+		$post_data['ID'] = $post_ID;
+		$updated[] = wp_update_post( $post_data );
+
+		if ( current_user_can( 'edit_others_posts' ) &amp;&amp; isset( $post_data['sticky'] ) ) {
+			if ( 'sticky' == $post_data['sticky'] )
+				stick_post( $post_ID );
+			else
+				unstick_post( $post_ID );
+		}
+
+	}
+
+	return array( 'updated' =&gt; $updated, 'skipped' =&gt; $skipped, 'locked' =&gt; $locked );
+}
+
+/**
+ * Default post information to use when populating the &quot;Write Post&quot; form.
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_default_post_to_edit() {
 	if ( !empty( $_REQUEST['post_title'] ) )
 		$post_title = wp_specialchars( stripslashes( $_REQUEST['post_title'] ));
@@ -182,8 +334,8 @@ function get_default_post_to_edit() {
 		$text       = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) );
 		$text       = funky_javascript_fix( $text);
 		$popupurl   = clean_url($_REQUEST['popupurl']);
-        $post_content = '&lt;a href=&quot;'.$popupurl.'&quot;&gt;'.$post_title.'&lt;/a&gt;'.&quot;\n$text&quot;;
-    }
+		$post_content = '&lt;a href=&quot;'.$popupurl.'&quot;&gt;'.$post_title.'&lt;/a&gt;'.&quot;\n$text&quot;;
+	}
 
 	if ( !empty( $_REQUEST['excerpt'] ) )
 		$post_excerpt = wp_specialchars( stripslashes( $_REQUEST['excerpt'] ));
@@ -194,6 +346,7 @@ function get_default_post_to_edit() {
 	$post-&gt;post_name = '';
 	$post-&gt;post_author = '';
 	$post-&gt;post_date = '';
+	$post-&gt;post_password = '';
 	$post-&gt;post_status = 'draft';
 	$post-&gt;post_type = 'post';
 	$post-&gt;to_ping = '';
@@ -212,13 +365,27 @@ function get_default_post_to_edit() {
 	return $post;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_default_page_to_edit() {
- 	$page = get_default_post_to_edit();
- 	$page-&gt;post_type = 'page';
- 	return $page;
+	$page = get_default_post_to_edit();
+	$page-&gt;post_type = 'page';
+	return $page;
 }
 
-// Get an existing post and format it for editing.
+/**
+ * Get an existing post and format it for editing.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @return unknown
+ */
 function get_post_to_edit( $id ) {
 
 	$post = get_post( $id, OBJECT, 'edit' );
@@ -229,9 +396,23 @@ function get_post_to_edit( $id ) {
 	return $post;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $title
+ * @param unknown_type $content
+ * @param unknown_type $post_date
+ * @return unknown
+ */
 function post_exists($title, $content = '', $post_date = '') {
 	global $wpdb;
 
+	$title = stripslashes($title);
+	$content = stripslashes($content);
+	$post_date = stripslashes($post_date);
+
 	if (!empty ($post_date))
 		$post_date = $wpdb-&gt;prepare(&quot;AND post_date = %s&quot;, $post_date);
 
@@ -244,7 +425,13 @@ function post_exists($title, $content = '', $post_date = '') {
 	return 0;
 }
 
-// Creates a new post from the &quot;Write Post&quot; form using $_POST information.
+/**
+ * Creates a new post from the &quot;Write Post&quot; form using $_POST information.
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function wp_write_post() {
 	global $user_ID;
 
@@ -279,6 +466,22 @@ function wp_write_post() {
 	if ( is_wp_error($translated) )
 		return $translated;
 
+	if ( isset($_POST['visibility']) ) {
+		switch ( $_POST['visibility'] ) {
+			case 'public' :
+				$_POST['post_password'] = '';
+				break;
+			case 'password' :
+				unset( $_POST['sticky'] );
+				break;
+			case 'private' :
+				$_POST['post_status'] = 'private';
+				$_POST['post_password'] = '';
+				unset( $_POST['sticky'] );
+				break;
+		}
+	}
+
 	// Create the post.
 	$post_ID = wp_insert_post( $_POST );
 	if ( is_wp_error( $post_ID ) )
@@ -311,6 +514,13 @@ function wp_write_post() {
 	return $post_ID;
 }
 
+/**
+ * Calls wp_write_post() and handles the errors.
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function write_post() {
 	$result = wp_write_post();
 	if( is_wp_error( $result ) )
@@ -323,16 +533,23 @@ function write_post() {
 // Post Meta
 //
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post_ID
+ * @return unknown
+ */
 function add_meta( $post_ID ) {
 	global $wpdb;
 	$post_ID = (int) $post_ID;
 
 	$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
 
-	$metakeyselect = $wpdb-&gt;escape( stripslashes( trim( $_POST['metakeyselect'] ) ) );
-	$metakeyinput = $wpdb-&gt;escape( stripslashes( trim( $_POST['metakeyinput'] ) ) );
-	$metavalue = maybe_serialize( stripslashes( (trim( $_POST['metavalue'] ) ) ));
-	$metavalue = $wpdb-&gt;escape( $metavalue );
+	$metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : '';
+	$metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : '';
+	$metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ) : '';
 
 	if ( ('0' === $metavalue || !empty ( $metavalue ) ) &amp;&amp; ((('#NONE#' != $metakeyselect) &amp;&amp; !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) {
 		// We have a key/value pair. If both the select and the
@@ -349,14 +566,20 @@ function add_meta( $post_ID ) {
 
 		wp_cache_delete($post_ID, 'post_meta');
 
-		$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;INSERT INTO $wpdb-&gt;postmeta 
-			(post_id,meta_key,meta_value ) VALUES (%s, %s, %s)&quot;,
-			$post_ID, $metakey, $metavalue) );
+		$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;INSERT INTO $wpdb-&gt;postmeta (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)&quot;, $post_ID, $metakey, $metavalue) );
 		return $wpdb-&gt;insert_id;
 	}
 	return false;
 } // add_meta
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $mid
+ * @return unknown
+ */
 function delete_meta( $mid ) {
 	global $wpdb;
 	$mid = (int) $mid;
@@ -367,7 +590,13 @@ function delete_meta( $mid ) {
 	return $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM $wpdb-&gt;postmeta WHERE meta_id = %d&quot;, $mid) );
 }
 
-// Get a list of previously defined keys
+/**
+ * Get a list of previously defined keys.
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_meta_keys() {
 	global $wpdb;
 
@@ -380,6 +609,14 @@ function get_meta_keys() {
 	return $keys;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $mid
+ * @return unknown
+ */
 function get_post_meta_by_id( $mid ) {
 	global $wpdb;
 	$mid = (int) $mid;
@@ -390,7 +627,16 @@ function get_post_meta_by_id( $mid ) {
 	return $meta;
 }
 
-// Some postmeta stuff
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Some postmeta stuff.
+ *
+ * @since unknown
+ *
+ * @param unknown_type $postid
+ * @return unknown
+ */
 function has_meta( $postid ) {
 	global $wpdb;
 
@@ -400,6 +646,16 @@ function has_meta( $postid ) {
 
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $meta_id
+ * @param unknown_type $meta_key
+ * @param unknown_type $meta_value
+ * @return unknown
+ */
 function update_meta( $meta_id, $meta_key, $meta_value ) {
 	global $wpdb;
 
@@ -413,7 +669,7 @@ function update_meta( $meta_id, $meta_key, $meta_value ) {
 
 	$meta_value = maybe_serialize( stripslashes( $meta_value ));
 	$meta_id = (int) $meta_id;
-	
+
 	$data  = compact( 'meta_key', 'meta_value' );
 	$where = compact( 'meta_id' );
 
@@ -424,7 +680,15 @@ function update_meta( $meta_id, $meta_key, $meta_value ) {
 // Private
 //
 
-// Replace hrefs of attachment anchors with up-to-date permalinks.
+/**
+ * Replace hrefs of attachment anchors with up-to-date permalinks.
+ *
+ * @since unknown
+ * @access private
+ *
+ * @param unknown_type $post_ID
+ * @return unknown
+ */
 function _fix_attachment_links( $post_ID ) {
 
 	$post = &amp; get_post( $post_ID, ARRAY_A );
@@ -465,7 +729,16 @@ function _fix_attachment_links( $post_ID ) {
 	return wp_update_post( $post);
 }
 
-// Move child posts to a new parent
+/**
+ * Move child posts to a new parent.
+ *
+ * @since unknown
+ * @access private
+ *
+ * @param unknown_type $old_ID
+ * @param unknown_type $new_ID
+ * @return unknown
+ */
 function _relocate_children( $old_ID, $new_ID ) {
 	global $wpdb;
 	$old_ID = (int) $old_ID;
@@ -473,24 +746,39 @@ function _relocate_children( $old_ID, $new_ID ) {
 	return $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;UPDATE $wpdb-&gt;posts SET post_parent = %d WHERE post_parent = %d&quot;, $new_ID, $old_ID) );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $type
+ * @return unknown
+ */
 function get_available_post_statuses($type = 'post') {
 	$stati = wp_count_posts($type);
 
 	return array_keys(get_object_vars($stati));
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $q
+ * @return unknown
+ */
 function wp_edit_posts_query( $q = false ) {
-	global $wpdb;
 	if ( false === $q )
 		$q = $_GET;
-	$q['m']   = (int) $q['m'];
-	$q['cat'] = (int) $q['cat'];
+	$q['m']   = isset($q['m']) ? (int) $q['m'] : 0;
+	$q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
 	$post_stati  = array(	//	array( adj, noun )
-				'publish' =&gt; array(__('Published'), __('Published posts'), __ngettext_noop('Published (%s)', 'Published (%s)')),
-				'future' =&gt; array(__('Scheduled'), __('Scheduled posts'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')),
-				'pending' =&gt; array(__('Pending Review'), __('Pending posts'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')),
-				'draft' =&gt; array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')),
-				'private' =&gt; array(__('Private'), __('Private posts'), __ngettext_noop('Private (%s)', 'Private (%s)')),
+				'publish' =&gt; array(__('Published'), __('Published posts'), __ngettext_noop('Published &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Published &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+				'future' =&gt; array(__('Scheduled'), __('Scheduled posts'), __ngettext_noop('Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+				'pending' =&gt; array(__('Pending Review'), __('Pending posts'), __ngettext_noop('Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+				'draft' =&gt; array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Drafts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+				'private' =&gt; array(__('Private'), __('Private posts'), __ngettext_noop('Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
 			);
 
 	$post_stati = apply_filters('post_stati', $post_stati);
@@ -503,10 +791,10 @@ function wp_edit_posts_query( $q = false ) {
 		$post_status_q .= '&amp;perm=readable';
 	}
 
-	if ( 'pending' === $q['post_status'] ) {
+	if ( isset($q['post_status']) &amp;&amp; 'pending' === $q['post_status'] ) {
 		$order = 'ASC';
 		$orderby = 'modified';
-	} elseif ( 'draft' === $q['post_status'] ) {
+	} elseif ( isset($q['post_status']) &amp;&amp; 'draft' === $q['post_status'] ) {
 		$order = 'DESC';
 		$orderby = 'modified';
 	} else {
@@ -519,6 +807,14 @@ function wp_edit_posts_query( $q = false ) {
 	return array($post_stati, $avail_post_stati);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $type
+ * @return unknown
+ */
 function get_available_post_mime_types($type = 'attachment') {
 	global $wpdb;
 
@@ -526,19 +822,27 @@ function get_available_post_mime_types($type = 'attachment') {
 	return $types;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $q
+ * @return unknown
+ */
 function wp_edit_attachments_query( $q = false ) {
-	global $wpdb;
 	if ( false === $q )
 		$q = $_GET;
-	$q['m']   = (int) $q['m'];
-	$q['cat'] = (int) $q['cat'];
+
+	$q['m']   = isset( $q['m'] ) ? (int) $q['m'] : 0;
+	$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
 	$q['post_type'] = 'attachment';
 	$q['post_status'] = 'any';
 	$q['posts_per_page'] = 15;
 	$post_mime_types = array(	//	array( adj, noun )
-				'image' =&gt; array(__('Images'), __('Manage Images'), __ngettext_noop('Image (%s)', 'Images (%s)')),
-				'audio' =&gt; array(__('Audio'), __('Manage Audio'), __ngettext_noop('Audio (%s)', 'Audio (%s)')),
-				'video' =&gt; array(__('Video'), __('Manage Video'), __ngettext_noop('Video (%s)', 'Video (%s)')),
+				'image' =&gt; array(__('Images'), __('Manage Images'), __ngettext_noop('Image &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Images &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+				'audio' =&gt; array(__('Audio'), __('Manage Audio'), __ngettext_noop('Audio &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Audio &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
+				'video' =&gt; array(__('Video'), __('Manage Video'), __ngettext_noop('Video &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Video &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;')),
 			);
 	$post_mime_types = apply_filters('post_mime_types', $post_mime_types);
 
@@ -552,17 +856,37 @@ function wp_edit_attachments_query( $q = false ) {
 	return array($post_mime_types, $avail_post_mime_types);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @param unknown_type $page
+ * @return unknown
+ */
 function postbox_classes( $id, $page ) {
+	if ( isset( $_GET['edit'] ) &amp;&amp; $_GET['edit'] == $id )
+		return '';
 	$current_user = wp_get_current_user();
-	if ( $closed = get_usermeta( $current_user-&gt;ID, 'closedpostboxes_'.$page ) ) {
+	if ( $closed = get_user_option('closedpostboxes_'.$page, 0, false ) ) {
 		if ( !is_array( $closed ) ) return '';
 		return in_array( $id, $closed )? 'if-js-closed' : '';
 	} else {
-		if ( 'tagsdiv' == $id || 'categorydiv' == $id ) return '';
-		else return 'if-js-closed';
+		return '';
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @param unknown_type $title
+ * @param unknown_type $name
+ * @return unknown
+ */
 function get_sample_permalink($id, $title=null, $name = null) {
 	$post = &amp;get_post($id);
 	if (!$post-&gt;ID) {
@@ -576,8 +900,7 @@ function get_sample_permalink($id, $title=null, $name = null) {
 	// drafts, so we will fake, that our post is published
 	if (in_array($post-&gt;post_status, array('draft', 'pending'))) {
 		$post-&gt;post_status = 'publish';
-		$post-&gt;post_date = date('Y-m-d H:i:s');
-		$post-&gt;post_name = sanitize_title($post-&gt;post_name? $post-&gt;post_name : $post-&gt;post_title, $post-&gt;ID); 
+		$post-&gt;post_name = sanitize_title($post-&gt;post_name? $post-&gt;post_name : $post-&gt;post_title, $post-&gt;ID);
 	}
 
 	// If the user wants to set a new name -- override the current one
@@ -606,6 +929,16 @@ function get_sample_permalink($id, $title=null, $name = null) {
 	return $permalink;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @param unknown_type $new_title
+ * @param unknown_type $new_slug
+ * @return unknown
+ */
 function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
 	$post = &amp;get_post($id);
 	list($permalink, $post_name) = get_sample_permalink($post-&gt;ID, $new_title, $new_slug);
@@ -613,20 +946,34 @@ function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
 		return '';
 	}
 	$title = __('Click to edit this part of the permalink');
-	if (strlen($post_name) &gt; 30) {
-		$post_name_abridged = substr($post_name, 0, 14). '&amp;hellip;' . substr($post_name, -14);
+	if (function_exists('mb_strlen')) {
+		if (mb_strlen($post_name) &gt; 30) {
+			$post_name_abridged = mb_substr($post_name, 0, 14). '&amp;hellip;' . mb_substr($post_name, -14);
+		} else {
+			$post_name_abridged = $post_name;
+		}
 	} else {
-		$post_name_abridged = $post_name;
+		if (strlen($post_name) &gt; 30) {
+			$post_name_abridged = substr($post_name, 0, 14). '&amp;hellip;' . substr($post_name, -14);
+		} else {
+			$post_name_abridged = $post_name;
+		}
 	}
 	$post_name_html = '&lt;span id=&quot;editable-post-name&quot; title=&quot;'.$title.'&quot;&gt;'.$post_name_abridged.'&lt;/span&gt;&lt;span id=&quot;editable-post-name-full&quot;&gt;'.$post_name.'&lt;/span&gt;';
 	$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
 	$return = '&lt;strong&gt;' . __('Permalink:') . &quot;&lt;/strong&gt;\n&quot; . '&lt;span id=&quot;sample-permalink&quot;&gt;' . $display_link . &quot;&lt;/span&gt;\n&quot;;
-	$return .= '&lt;span id=&quot;edit-slug-buttons&quot;&gt;&lt;a href=&quot;#post_name&quot; class=&quot;edit-slug&quot; onclick=&quot;edit_permalink(' . $id . '); return false;&quot;&gt;' . __('Edit') . &quot;&lt;/a&gt;&lt;/span&gt;\n&quot;;
+	$return .= '&lt;span id=&quot;edit-slug-buttons&quot;&gt;&lt;a href=&quot;#post_name&quot; class=&quot;edit-slug button&quot; onclick=&quot;edit_permalink(' . $id . '); return false;&quot;&gt;' . __('Edit') . &quot;&lt;/a&gt;&lt;/span&gt;\n&quot;;
 	return $return;
 }
 
-// false: not locked or locked by current user
-// int: user ID of user with lock
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post_id
+ * @return bool|int False: not locked or locked by current user. Int: user ID of user with lock.
+ */
 function wp_check_post_lock( $post_id ) {
 	global $current_user;
 
@@ -643,6 +990,14 @@ function wp_check_post_lock( $post_id ) {
 	return false;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post_id
+ * @return unknown
+ */
 function wp_set_post_lock( $post_id ) {
 	global $current_user;
 	if ( !$post = get_post( $post_id ) )
@@ -659,11 +1014,11 @@ function wp_set_post_lock( $post_id ) {
 }
 
 /**
- * wp_create_post_autosave() - creates autosave data for the specified post from $_POST data
+ * Creates autosave data for the specified post from $_POST data.
  *
  * @package WordPress
- * @subpackage Post Revisions
- * @since 2.6
+ * @subpackage Post_Revisions
+ * @since 2.6.0
  *
  * @uses _wp_translate_postdata()
  * @uses _wp_post_revision_fields()
@@ -683,3 +1038,312 @@ function wp_create_post_autosave( $post_id ) {
 	// Otherwise create the new autosave as a special post revision
 	return _wp_put_post_revision( $_POST, true );
 }
+
+/**
+ * Save draft or manually autosave for showing preview.
+ *
+ * @package WordPress
+ * @since 2.7
+ *
+ * @uses wp_write_post()
+ * @uses edit_post()
+ * @uses get_post()
+ * @uses current_user_can()
+ * @uses wp_create_post_autosave()
+ *
+ * @return str URL to redirect to show the preview
+ */
+function post_preview() {
+
+	$post_ID = (int) $_POST['post_ID'];
+	if ( $post_ID &lt; 1 )
+		wp_die( __('Preview not available. Please save as a draft first.') );
+
+	if ( isset($_POST['catslist']) )
+		$_POST['post_category'] = explode(&quot;,&quot;, $_POST['catslist']);
+
+	if ( isset($_POST['tags_input']) )
+		$_POST['tags_input'] = explode(&quot;,&quot;, $_POST['tags_input']);
+
+	if ( $_POST['post_type'] == 'page' || empty($_POST['post_category']) )
+		unset($_POST['post_category']);
+
+	$_POST['ID'] = $post_ID;
+	$post = get_post($post_ID);
+
+	if ( 'page' == $post-&gt;post_type ) {
+		if ( !current_user_can('edit_page', $post_ID) )
+			wp_die(__('You are not allowed to edit this page.'));
+	} else {
+		if ( !current_user_can('edit_post', $post_ID) )
+			wp_die(__('You are not allowed to edit this post.'));
+	}
+
+	if ( 'draft' == $post-&gt;post_status ) {
+		$id = edit_post();
+	} else { // Non drafts are not overwritten.  The autosave is stored in a special post revision.
+		$id = wp_create_post_autosave( $post-&gt;ID );
+		if ( ! is_wp_error($id) )
+			$id = $post-&gt;ID;
+	}
+
+	if ( is_wp_error($id) )
+		wp_die( $id-&gt;get_error_message() );
+
+	if ( $_POST['post_status'] == 'draft'  ) {
+		$url = add_query_arg( 'preview', 'true', get_permalink($id) );
+	} else {
+		$nonce = wp_create_nonce('post_preview_' . $id);
+		$url = add_query_arg( array( 'preview' =&gt; 'true', 'preview_id' =&gt; $id, 'preview_nonce' =&gt; $nonce ), get_permalink($id) );
+	}
+
+	return $url;
+}
+
+/**
+ * Adds the TinyMCE editor used on the Write and Edit screens.
+ *
+ * Has option to output a trimmed down version used in Press This.
+ *
+ * @package WordPress
+ * @since 2.7
+ */
+function wp_tiny_mce( $teeny = false ) {
+	if ( ! user_can_richedit() )
+		return;
+
+	$baseurl = includes_url('js/tinymce');
+
+	$mce_css = $baseurl . '/wordpress.css';
+	$mce_css = apply_filters('mce_css', $mce_css);
+
+	$mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
+
+	/*
+	The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
+	By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
+	The + sign marks the default language. More information:
+	http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
+	*/
+	$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
+
+	if ( $teeny ) {
+		$plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'autosave', 'fullscreen') );
+		$ext_plugins = '';
+	} else {
+		$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery' );
+
+		/*
+		The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' =&gt; 'url'.
+		It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin.
+		The url should be absolute and should include the js file name to be loaded. Example:
+		array( 'myplugin' =&gt; 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js' )
+		If the plugin uses a button, it should be added with one of the &quot;$mce_buttons&quot; filters.
+		*/
+		$mce_external_plugins = apply_filters('mce_external_plugins', array());
+
+		$ext_plugins = &quot;\n&quot;;
+		if ( ! empty($mce_external_plugins) ) {
+
+			/*
+			The following filter loads external language files for TinyMCE plugins.
+			It takes an associative array 'plugin_name' =&gt; 'path', where path is the
+			include path to the file. The language file should follow the same format as
+			/tinymce/langs/wp-langs.php and should define a variable $strings that
+			holds all translated strings.
+			When this filter is not used, the function will try to load {mce_locale}.js.
+			If that is not found, en.js will be tried next.
+			*/
+			$mce_external_languages = apply_filters('mce_external_languages', array());
+
+			$loaded_langs = array();
+			$strings = '';
+
+			if ( ! empty($mce_external_languages) ) {
+				foreach ( $mce_external_languages as $name =&gt; $path ) {
+					if ( is_file($path) &amp;&amp; is_readable($path) ) {
+						include_once($path);
+						$ext_plugins .= $strings;
+						$loaded_langs[] = $name;
+					}
+				}
+			}
+
+			foreach ( $mce_external_plugins as $name =&gt; $url ) {
+
+				if ( is_ssl() ) $url = str_replace('http://', 'https://', $url);
+
+				$plugins[] = '-' . $name;
+
+				$plugurl = dirname($url);
+				$strings = $str1 = $str2 = '';
+				if ( ! in_array($name, $loaded_langs) ) {
+					$path = str_replace( WP_PLUGIN_URL, '', $plugurl );
+					$path = WP_PLUGIN_DIR . $path . '/langs/';
+
+					if ( function_exists('realpath') )
+						$path = trailingslashit( realpath($path) );
+
+					if ( is_file($path . $mce_locale . '.js') )
+						$strings .= @file_get_contents($path . $mce_locale . '.js');
+
+					if ( is_file($path . $mce_locale . '_dlg.js') )
+						$strings .= @file_get_contents($path . $mce_locale . '_dlg.js');
+
+					if ( 'en' != $mce_locale &amp;&amp; empty($strings) ) {
+						if ( is_file($path . 'en.js') ) {
+							$str1 = @file_get_contents($path . 'en.js');
+							$strings .= preg_replace( '/([\'&quot;])en\./', '$1' . $mce_locale . '.', $str1, 1 );
+						}
+
+						if ( is_file($path . 'en_dlg.js') ) {
+							$str2 = @file_get_contents($path . 'en_dlg.js');
+							$strings .= preg_replace( '/([\'&quot;])en\./', '$1' . $mce_locale . '.', $str2, 1 );
+						}
+					}
+
+					if ( ! empty($strings) )
+						$ext_plugins .= &quot;\n&quot; . $strings . &quot;\n&quot;;
+				}
+
+				$ext_plugins .= 'tinyMCEPreInit.load_ext(&quot;' . $plugurl . '&quot;, &quot;' . $mce_locale . '&quot;);' . &quot;\n&quot;;
+				$ext_plugins .= 'tinymce.PluginManager.load(&quot;' . $name . '&quot;, &quot;' . $url . '&quot;);' . &quot;\n&quot;;
+			}
+		}
+	}
+
+	$plugins = implode($plugins, ',');
+
+	if ( $teeny ) {
+		$mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen') );
+		$mce_buttons = implode($mce_buttons, ',');
+		$mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = '';
+	} else {
+		$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
+		$mce_buttons = implode($mce_buttons, ',');
+
+		$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ));
+		$mce_buttons_2 = implode($mce_buttons_2, ',');
+
+		$mce_buttons_3 = apply_filters('mce_buttons_3', array());
+		$mce_buttons_3 = implode($mce_buttons_3, ',');
+
+		$mce_buttons_4 = apply_filters('mce_buttons_4', array());
+		$mce_buttons_4 = implode($mce_buttons_4, ',');
+	}
+	$no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false;
+
+	// TinyMCE init settings
+	$initArray = array (
+		'mode' =&gt; 'none',
+		'onpageload' =&gt; 'switchEditors.edInit',
+		'width' =&gt; '100%',
+		'theme' =&gt; 'advanced',
+		'skin' =&gt; 'wp_theme',
+		'theme_advanced_buttons1' =&gt; &quot;$mce_buttons&quot;,
+		'theme_advanced_buttons2' =&gt; &quot;$mce_buttons_2&quot;,
+		'theme_advanced_buttons3' =&gt; &quot;$mce_buttons_3&quot;,
+		'theme_advanced_buttons4' =&gt; &quot;$mce_buttons_4&quot;,
+		'language' =&gt; &quot;$mce_locale&quot;,
+		'spellchecker_languages' =&gt; &quot;$mce_spellchecker_languages&quot;,
+		'theme_advanced_toolbar_location' =&gt; 'top',
+		'theme_advanced_toolbar_align' =&gt; 'left',
+		'theme_advanced_statusbar_location' =&gt; 'bottom',
+		'theme_advanced_resizing' =&gt; true,
+		'theme_advanced_resize_horizontal' =&gt; false,
+		'dialog_type' =&gt; 'modal',
+		'relative_urls' =&gt; false,
+		'remove_script_host' =&gt; false,
+		'convert_urls' =&gt; false,
+		'apply_source_formatting' =&gt; false,
+		'remove_linebreaks' =&gt; true,
+		'paste_convert_middot_lists' =&gt; true,
+		'paste_remove_spans' =&gt; true,
+		'paste_remove_styles' =&gt; true,
+		'gecko_spellcheck' =&gt; true,
+		'entities' =&gt; '38,amp,60,lt,62,gt',
+		'accessibility_focus' =&gt; true,
+		'tab_focus' =&gt; ':prev,:next',
+		'content_css' =&gt; &quot;$mce_css&quot;,
+		'save_callback' =&gt; 'switchEditors.saveCallback',
+		'wpeditimage_disable_captions' =&gt; $no_captions,
+		'plugins' =&gt; &quot;$plugins&quot;
+	);
+
+	// For people who really REALLY know what they're doing with TinyMCE
+	// You can modify initArray to add, remove, change elements of the config before tinyMCE.init
+	// Setting &quot;valid_elements&quot;, &quot;invalid_elements&quot; and &quot;extended_valid_elements&quot; can be done through &quot;tiny_mce_before_init&quot;.
+	// Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
+	if ( $teeny ) {
+		$initArray = apply_filters('teeny_mce_before_init', $initArray);
+	} else {
+		$initArray = apply_filters('tiny_mce_before_init', $initArray);
+	}
+
+	$language = $initArray['language'];
+
+	$ver = apply_filters('tiny_mce_version', '3101');
+
+	if ( 'en' != $language )
+		include_once(ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php');
+
+	$mce_options = '';
+	foreach ( $initArray as $k =&gt; $v )
+	    $mce_options .= $k . ':&quot;' . $v . '&quot;, ';
+
+	$mce_options = rtrim( trim($mce_options), '\n\r,' ); ?&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+/* &lt;![CDATA[ */
+tinyMCEPreInit = {
+	base : &quot;&lt;?php echo $baseurl; ?&gt;&quot;,
+	suffix : &quot;&quot;,
+	query : &quot;ver=&lt;?php echo $ver; ?&gt;&quot;,
+	mceInit : {&lt;?php echo $mce_options; ?&gt;},
+
+	go : function() {
+		var t = this, sl = tinymce.ScriptLoader, ln = t.mceInit.language, th = t.mceInit.theme, pl = t.mceInit.plugins;
+
+		sl.markDone(t.base + '/langs/' + ln + '.js');
+
+		sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '.js');
+		sl.markDone(t.base + '/themes/' + th + '/langs/' + ln + '_dlg.js');
+
+		tinymce.each(pl.split(','), function(n) {
+			if (n &amp;&amp; n.charAt(0) != '-') {
+				sl.markDone(t.base + '/plugins/' + n + '/langs/' + ln + '.js');
+				sl.markDone(t.base + '/plugins/' + n + '/langs/' + ln + '_dlg.js');
+			}
+		});
+	},
+
+	load_ext : function(url,lang) {
+		var sl = tinymce.ScriptLoader;
+
+		sl.markDone(url + '/langs/' + lang + '.js');
+		sl.markDone(url + '/langs/' + lang + '_dlg.js');
+	}
+};
+/* ]]&gt; */
+&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo $baseurl; ?&gt;/tiny_mce.js?ver=&lt;?php echo $ver; ?&gt;&quot;&gt;&lt;/script&gt;
+&lt;?php if ( 'en' != $language &amp;&amp; isset($lang) ) { ?&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+&lt;?php echo $lang; ?&gt;
+&lt;/script&gt;
+&lt;?php } else { ?&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo $baseurl; ?&gt;/langs/wp-langs-en.js?ver=&lt;?php echo $ver; ?&gt;&quot;&gt;&lt;/script&gt;
+&lt;?php } ?&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+&lt;?php if ( $ext_plugins ) echo $ext_plugins; ?&gt;
+
+// Mark translations as done
+tinyMCEPreInit.go();
+
+// Init
+tinyMCE.init(tinyMCEPreInit.mceInit);
+&lt;/script&gt;
+
+&lt;?php
+}
+?&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/includes/post.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,33 @@
 &lt;?php
-// Here we keep the DB structure and option values
-
+/**
+ * WordPress Administration Scheme API
+ *
+ * Here we keep the DB structure and option values.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * The database character collate.
+ * @var string
+ * @global string
+ * @name $charset_collate
+ */
 $charset_collate = '';
 
 // Declare these as global in case schema.php is included from a function.
 global $wpdb, $wp_queries;
 
-if ( $wpdb-&gt;supports_collation() ) {
+if ( $wpdb-&gt;has_cap( 'collation' ) ) {
 	if ( ! empty($wpdb-&gt;charset) )
 		$charset_collate = &quot;DEFAULT CHARACTER SET $wpdb-&gt;charset&quot;;
 	if ( ! empty($wpdb-&gt;collate) )
 		$charset_collate .= &quot; COLLATE $wpdb-&gt;collate&quot;;
 }
 
-$wp_queries=&quot;CREATE TABLE $wpdb-&gt;terms (
+/** Create WordPress database tables SQL */
+$wp_queries = &quot;CREATE TABLE $wpdb-&gt;terms (
  term_id bigint(20) NOT NULL auto_increment,
  name varchar(200) NOT NULL default '',
  slug varchar(200) NOT NULL default '',
@@ -125,7 +139,8 @@ CREATE TABLE $wpdb-&gt;posts (
   comment_count bigint(20) NOT NULL default '0',
   PRIMARY KEY  (ID),
   KEY post_name (post_name),
-  KEY type_status_date (post_type,post_status,post_date,ID)
+  KEY type_status_date (post_type,post_status,post_date,ID),
+  KEY post_parent (post_parent)
 ) $charset_collate;
 CREATE TABLE $wpdb-&gt;users (
   ID bigint(20) unsigned NOT NULL auto_increment,
@@ -152,13 +167,20 @@ CREATE TABLE $wpdb-&gt;usermeta (
   KEY meta_key (meta_key)
 ) $charset_collate;&quot;;
 
+/**
+ * Create WordPress options and set the default values.
+ *
+ * @since 1.5.0
+ * @uses $wpdb
+ * @uses $wp_db_version
+ */
 function populate_options() {
 	global $wpdb, $wp_db_version;
-	
+
 	$guessurl = wp_guess_url();
-	
+
 	do_action('populate_options');
-	
+
 	add_option('siteurl', $guessurl);
 	add_option('blogname', __('My Blog'));
 	add_option('blogdescription', __('Just another WordPress weblog'));
@@ -257,7 +279,29 @@ function populate_options() {
 	add_option('avatar_default', 'mystery');
 	add_option('enable_app', 0);
 	add_option('enable_xmlrpc', 0);
-	
+
+	// 2.7
+	add_option('large_size_w', 1024);
+	add_option('large_size_h', 1024);
+	add_option('image_default_link_type', 'file');
+	add_option('image_default_size', '');
+	add_option('image_default_align', '');
+	add_option('close_comments_for_old_posts', 0);
+	add_option('close_comments_days_old', 14);
+	add_option('thread_comments', 0);
+	add_option('thread_comments_depth', 5);
+	add_option('page_comments', 1);
+	add_option('comments_per_page', 50);
+	add_option('default_comments_page', 'newest');
+	add_option('comment_order', 'asc');
+	add_option('use_ssl', 0);
+	add_option('sticky_posts', array());
+	add_option('widget_categories', array());
+	add_option('widget_text', array());
+	add_option('widget_rss', array());
+	add_option('update_core', array());
+	add_option('dismissed_update_core', array());
+
 	// Delete unused options
 	$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins');
 	foreach ($unusedoptions as $option) :
@@ -271,14 +315,25 @@ function populate_options() {
 	endforeach;
 }
 
+/**
+ * Execute WordPress role creation for the various WordPress versions.
+ *
+ * @since 2.0.0
+ */
 function populate_roles() {
 	populate_roles_160();
 	populate_roles_210();
 	populate_roles_230();
 	populate_roles_250();
 	populate_roles_260();
+	populate_roles_270();
 }
 
+/**
+ * Create the roles for WordPress 2.0
+ *
+ * @since 2.0.0
+ */
 function populate_roles_160() {
 	// Add roles
 
@@ -374,6 +429,11 @@ function populate_roles_160() {
 	$role-&gt;add_cap('level_0');
 }
 
+/**
+ * Create and modify WordPress roles for WordPress 2.1.
+ *
+ * @since 2.1.0
+ */
 function populate_roles_210() {
 	$roles = array('administrator', 'editor');
 	foreach ($roles as $role) {
@@ -416,6 +476,11 @@ function populate_roles_210() {
 	}
 }
 
+/**
+ * Create and modify WordPress roles for WordPress 2.3.
+ *
+ * @since 2.3.0
+ */
 function populate_roles_230() {
 	$role = get_role( 'administrator' );
 
@@ -424,6 +489,11 @@ function populate_roles_230() {
 	}
 }
 
+/**
+ * Create and modify WordPress roles for WordPress 2.5.
+ *
+ * @since 2.5.0
+ */
 function populate_roles_250() {
 	$role = get_role( 'administrator' );
 
@@ -432,6 +502,11 @@ function populate_roles_250() {
 	}
 }
 
+/**
+ * Create and modify WordPress roles for WordPress 2.6.
+ *
+ * @since 2.6.0
+ */
 function populate_roles_260() {
 	$role = get_role( 'administrator' );
 
@@ -441,4 +516,18 @@ function populate_roles_260() {
 	}
 }
 
+/**
+ * Create and modify WordPress roles for WordPress 2.7.
+ *
+ * @since 2.7.0
+ */
+function populate_roles_270() {
+	$role = get_role( 'administrator' );
+
+	if ( !empty( $role ) ) {
+		$role-&gt;add_cap( 'install_plugins' );
+		$role-&gt;add_cap( 'update_themes' );
+	}
+}
+
 ?&gt;</diff>
      <filename>wp-admin/includes/schema.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,23 @@
 &lt;?php
+/**
+ * WordPress Taxonomy Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
 //
 // Category
 //
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $cat_name
+ * @return unknown
+ */
 function category_exists($cat_name) {
 	$id = is_term($cat_name, 'category');
 	if ( is_array($id) )
@@ -11,11 +25,28 @@ function category_exists($cat_name) {
 	return $id;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @return unknown
+ */
 function get_category_to_edit( $id ) {
 	$category = get_category( $id, OBJECT, 'edit' );
 	return $category;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $cat_name
+ * @param unknown_type $parent
+ * @return unknown
+ */
 function wp_create_category( $cat_name, $parent = 0 ) {
 	if ( $id = category_exists($cat_name) )
 		return $id;
@@ -23,6 +54,15 @@ function wp_create_category( $cat_name, $parent = 0 ) {
 	return wp_insert_category( array('cat_name' =&gt; $cat_name, 'category_parent' =&gt; $parent) );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $categories
+ * @param unknown_type $post_id
+ * @return unknown
+ */
 function wp_create_categories($categories, $post_id = '') {
 	$cat_ids = array ();
 	foreach ($categories as $category) {
@@ -39,6 +79,14 @@ function wp_create_categories($categories, $post_id = '') {
 	return $cat_ids;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $cat_ID
+ * @return unknown
+ */
 function wp_delete_category($cat_ID) {
 	$cat_ID = (int) $cat_ID;
 	$default = get_option('default_category');
@@ -50,9 +98,18 @@ function wp_delete_category($cat_ID) {
 	return wp_delete_term($cat_ID, 'category', array('default' =&gt; $default));
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $catarr
+ * @param unknown_type $wp_error
+ * @return unknown
+ */
 function wp_insert_category($catarr, $wp_error = false) {
 	$cat_defaults = array('cat_ID' =&gt; 0, 'cat_name' =&gt; '', 'category_description' =&gt; '', 'category_nicename' =&gt; '', 'category_parent' =&gt; '');
-	$cat_arr = wp_parse_args($cat_arr, $cat_defaults);
+	$catarr = wp_parse_args($catarr, $cat_defaults);
 	extract($catarr, EXTR_SKIP);
 
 	if ( trim( $cat_name ) == '' ) {
@@ -99,10 +156,18 @@ function wp_insert_category($catarr, $wp_error = false) {
 	return $cat_ID['term_id'];
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $catarr
+ * @return unknown
+ */
 function wp_update_category($catarr) {
 	$cat_ID = (int) $catarr['cat_ID'];
 
-	if ( $cat_ID == $catarr['category_parent'] )
+	if ( isset($catarr['category_parent']) &amp;&amp; ($cat_ID == $catarr['category_parent']) )
 		return false;
 
 	// First, get all of the original fields
@@ -121,6 +186,14 @@ function wp_update_category($catarr) {
 // Tags
 //
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post_id
+ * @return unknown
+ */
 function get_tags_to_edit( $post_id ) {
 	$post_id = (int) $post_id;
 	if ( !$post_id )
@@ -139,10 +212,26 @@ function get_tags_to_edit( $post_id ) {
 	return $tags_to_edit;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $tag_name
+ * @return unknown
+ */
 function tag_exists($tag_name) {
 	return is_term($tag_name, 'post_tag');
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $tag_name
+ * @return unknown
+ */
 function wp_create_tag($tag_name) {
 	if ( $id = tag_exists($tag_name) )
 		return $id;</diff>
      <filename>wp-admin/includes/taxonomy.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,43 @@
 &lt;?php
-
-//
-// Big Mess
-//
+/**
+ * Template WordPress Administration API.
+ *
+ * A Big Mess. Also some neat functions that are nicely written.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
 // Ugly recursive category stuff.
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $categories
+ * @param unknown_type $page
+ * @param unknown_type $per_page
+ */
 function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
 	$count = 0;
 	_cat_rows($categories, $count, $parent, $level, $page, $per_page);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $categories
+ * @param unknown_type $count
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $page
+ * @param unknown_type $per_page
+ * @return unknown
+ */
 function _cat_rows( $categories, &amp;$count, $parent = 0, $level = 0, $page = 1, $per_page = 20 ) {
 	if ( empty($categories) ) {
 		$args = array('hide_empty' =&gt; 0);
@@ -39,7 +67,6 @@ function _cat_rows( $categories, &amp;$count, $parent = 0, $level = 0, $page = 1, $p
 		// If the page starts in a subtree, print the parents.
 		if ( $count == $start &amp;&amp; $category-&gt;parent &gt; 0 ) {
 			$my_parents = array();
-			$my_parent = $category-&gt;parent;
 			while ( $my_parent) {
 				$my_parent = get_category($my_parent);
 				$my_parents[] = $my_parent;
@@ -57,7 +84,7 @@ function _cat_rows( $categories, &amp;$count, $parent = 0, $level = 0, $page = 1, $p
 		if ( $count &gt;= $start )
 			echo &quot;\t&quot; . _cat_row( $category, $level );
 
-		unset($categories[$i]); // Prune the working set		
+		unset($categories[$i]); // Prune the working set
 		$count++;
 
 		if ( isset($children[$category-&gt;term_id]) )
@@ -68,83 +95,284 @@ function _cat_rows( $categories, &amp;$count, $parent = 0, $level = 0, $page = 1, $p
 	$output = ob_get_contents();
 	ob_end_clean();
 
-	$output = apply_filters('cat_rows', $output);
-
 	echo $output;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $category
+ * @param unknown_type $level
+ * @param unknown_type $name_override
+ * @return unknown
+ */
 function _cat_row( $category, $level, $name_override = false ) {
-	global $class;
+	static $row_class = '';
 
-	$category = get_category( $category );
+	$category = get_category( $category, OBJECT, 'display' );
 
+	$default_cat_id = (int) get_option( 'default_category' );
 	$pad = str_repeat( '&amp;#8212; ', $level );
 	$name = ( $name_override ? $name_override : $pad . ' ' . $category-&gt;name );
+	$edit_link = &quot;categories.php?action=edit&amp;amp;cat_ID=$category-&gt;term_id&quot;;
 	if ( current_user_can( 'manage_categories' ) ) {
-		$edit = &quot;&lt;a class='row-title' href='categories.php?action=edit&amp;amp;cat_ID=$category-&gt;term_id' title='&quot; . attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $category-&gt;name)) . &quot;'&gt;$name&lt;/a&gt;&quot;;
+		$edit = &quot;&lt;a class='row-title' href='$edit_link' title='&quot; . attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $category-&gt;name)) . &quot;'&gt;&quot; . attribute_escape( $name ) . '&lt;/a&gt;&lt;br /&gt;';
+		$actions = array();
+		$actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+		$actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+		if ( $default_cat_id != $category-&gt;term_id )
+			$actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;categories.php?action=delete&amp;amp;cat_ID=$category-&gt;term_id&quot;, 'delete-category_' . $category-&gt;term_id) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf(__(&quot;You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $name )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+		$action_count = count($actions);
+		$i = 0;
+		$edit .= '&lt;div class=&quot;row-actions&quot;&gt;';
+		foreach ( $actions as $action =&gt; $link ) {
+			++$i;
+			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+			$edit .= &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+		}
+		$edit .= '&lt;/div&gt;';
 	} else {
 		$edit = $name;
 	}
 
-	$class = &quot; class='alternate'&quot; == $class ? '' : &quot; class='alternate'&quot;;
+	$row_class = 'alternate' == $row_class ? '' : 'alternate';
+	$qe_data = get_category_to_edit($category-&gt;term_id);
 
 	$category-&gt;count = number_format_i18n( $category-&gt;count );
 	$posts_count = ( $category-&gt;count &gt; 0 ) ? &quot;&lt;a href='edit.php?cat=$category-&gt;term_id'&gt;$category-&gt;count&lt;/a&gt;&quot; : $category-&gt;count;
-	$output = &quot;&lt;tr id='cat-$category-&gt;term_id'$class&gt;
-			   &lt;th scope='row' class='check-column'&gt;&quot;;
-	if ( absint(get_option( 'default_category' ) ) != $category-&gt;term_id ) {
-		$output .= &quot;&lt;input type='checkbox' name='delete[]' value='$category-&gt;term_id' /&gt;&quot;;
-	} else {
-		$output .= &quot;&amp;nbsp;&quot;;
+	$output = &quot;&lt;tr id='cat-$category-&gt;term_id' class='iedit $row_class'&gt;&quot;;
+
+	$columns = get_column_headers('categories');
+	$hidden = get_hidden_columns('categories');
+	foreach ( $columns as $column_name =&gt; $column_display_name ) {
+		$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
+
+		$style = '';
+		if ( in_array($column_name, $hidden) )
+			$style = ' style=&quot;display:none;&quot;';
+
+		$attributes = &quot;$class$style&quot;;
+
+		switch ($column_name) {
+			case 'cb':
+				$output .= &quot;&lt;th scope='row' class='check-column'&gt;&quot;;
+				if ( $default_cat_id != $category-&gt;term_id ) {
+					$output .= &quot;&lt;input type='checkbox' name='delete[]' value='$category-&gt;term_id' /&gt;&quot;;
+				} else {
+					$output .= &quot;&amp;nbsp;&quot;;
+				}
+				$output .= '&lt;/th&gt;';
+				break;
+			case 'name':
+				$output .= &quot;&lt;td $attributes&gt;$edit&quot;;
+				$output .= '&lt;div class=&quot;hidden&quot; id=&quot;inline_' . $qe_data-&gt;term_id . '&quot;&gt;';
+				$output .= '&lt;div class=&quot;name&quot;&gt;' . $qe_data-&gt;name . '&lt;/div&gt;';
+				$output .= '&lt;div class=&quot;slug&quot;&gt;' . $qe_data-&gt;slug . '&lt;/div&gt;';
+				$output .= '&lt;div class=&quot;cat_parent&quot;&gt;' . $qe_data-&gt;parent . '&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;';
+				break;
+			case 'description':
+				$output .= &quot;&lt;td $attributes&gt;$category-&gt;description&lt;/td&gt;&quot;;
+				break;
+			case 'slug':
+				$output .= &quot;&lt;td $attributes&gt;$category-&gt;slug&lt;/td&gt;&quot;;
+				break;
+			case 'posts':
+				$attributes = 'class=&quot;posts column-posts num&quot;' . $style;
+				$output .= &quot;&lt;td $attributes&gt;$posts_count&lt;/td&gt;\n&quot;;
+		}
 	}
-	$output .= &quot;&lt;/th&gt;
-				&lt;td&gt;$edit&lt;/td&gt;
-				&lt;td&gt;$category-&gt;description&lt;/td&gt;
-				&lt;td class='num'&gt;$posts_count&lt;/td&gt;\n\t&lt;/tr&gt;\n&quot;;
+	$output .= '&lt;/tr&gt;';
 
-	return apply_filters('cat_row', $output);
+	return $output;
 }
 
-function link_cat_row( $category ) {
-	global $class;
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since 2.7
+ *
+ * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit.
+ *
+ * @param string $type &quot;tag&quot;, &quot;category&quot; or &quot;link-category&quot;
+ * @return
+ */
+function inline_edit_term_row($type) {
+
+	if ( ! current_user_can( 'manage_categories' ) )
+		return;
+
+	$is_tag = $type == 'edit-tags';
+	$columns = get_column_headers($type);
+	$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($type) ) );
+	$col_count = count($columns) - count($hidden);
+	?&gt;
+
+&lt;form method=&quot;get&quot; action=&quot;&quot;&gt;&lt;table style=&quot;display: none&quot;&gt;&lt;tbody id=&quot;inlineedit&quot;&gt;
+	&lt;tr id=&quot;inline-edit&quot; class=&quot;inline-edit-row&quot; style=&quot;display: none&quot;&gt;&lt;td colspan=&quot;&lt;?php echo $col_count; ?&gt;&quot;&gt;
+
+		&lt;fieldset&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
+			&lt;h4&gt;&lt;?php _e( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
+
+			&lt;label&gt;
+				&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Name' ); ?&gt;&lt;/span&gt;
+				&lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;name&quot; class=&quot;ptitle&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
+			&lt;/label&gt;
+
+			&lt;label&gt;
+				&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Slug' ); ?&gt;&lt;/span&gt;
+				&lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;slug&quot; class=&quot;ptitle&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
+			&lt;/label&gt;
+
+&lt;?php if ( 'category' == $type ) : ?&gt;
+
+			&lt;label&gt;
+				&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Parent' ); ?&gt;&lt;/span&gt;
+				&lt;?php wp_dropdown_categories(array('hide_empty' =&gt; 0, 'name' =&gt; 'parent', 'orderby' =&gt; 'name', 'hierarchical' =&gt; 1, 'show_option_none' =&gt; __('None'))); ?&gt;
+			&lt;/label&gt;
+
+&lt;?php endif; // $type ?&gt;
+
+		&lt;/div&gt;&lt;/fieldset&gt;
 
-	if ( !$category = get_term( $category, 'link_category' ) )
+&lt;?php
+
+	$core_columns = array( 'cb' =&gt; true, 'description' =&gt; true, 'name' =&gt; true, 'slug' =&gt; true, 'posts' =&gt; true );
+
+	foreach ( $columns as $column_name =&gt; $column_display_name ) {
+		if ( isset( $core_columns[$column_name] ) )
+			continue;
+		do_action( 'quick_edit_custom_box', $column_name, $type );
+	}
+
+?&gt;
+
+	&lt;p class=&quot;inline-edit-save submit&quot;&gt;
+		&lt;a accesskey=&quot;c&quot; href=&quot;#inline-edit&quot; title=&quot;&lt;?php _e('Cancel'); ?&gt;&quot; class=&quot;cancel button-secondary alignleft&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+		&lt;?php $update_text = ( $is_tag ) ? __( 'Update Tag' ) : __( 'Update Category' ); ?&gt;
+		&lt;a accesskey=&quot;s&quot; href=&quot;#inline-edit&quot; title=&quot;&lt;?php echo attribute_escape( $update_text ); ?&gt;&quot; class=&quot;save button-primary alignright&quot;&gt;&lt;?php echo $update_text; ?&gt;&lt;/a&gt;
+		&lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;images/loading.gif&quot; alt=&quot;&quot; /&gt;
+		&lt;span class=&quot;error&quot; style=&quot;display:none;&quot;&gt;&lt;/span&gt;
+		&lt;?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?&gt;
+		&lt;br class=&quot;clear&quot; /&gt;
+	&lt;/p&gt;
+	&lt;/td&gt;&lt;/tr&gt;
+	&lt;/tbody&gt;&lt;/table&gt;&lt;/form&gt;
+&lt;?php
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $category
+ * @param unknown_type $name_override
+ * @return unknown
+ */
+function link_cat_row( $category, $name_override = false ) {
+	static $row_class = '';
+
+	if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) )
 		return false;
 	if ( is_wp_error( $category ) )
 		return $category;
 
+	$default_cat_id = (int) get_option( 'default_link_category' );
 	$name = ( $name_override ? $name_override : $category-&gt;name );
+	$edit_link = &quot;link-category.php?action=edit&amp;amp;cat_ID=$category-&gt;term_id&quot;;
 	if ( current_user_can( 'manage_categories' ) ) {
-		$edit = &quot;&lt;a class='row-title' href='link-category.php?action=edit&amp;amp;cat_ID=$category-&gt;term_id' title='&quot; . attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $category-&gt;name)) . &quot;' class='edit'&gt;$name&lt;/a&gt;&quot;;
-		$default_cat_id = (int) get_option( 'default_link_category' );
+		$edit = &quot;&lt;a class='row-title' href='$edit_link' title='&quot; . attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $category-&gt;name)) . &quot;'&gt;$name&lt;/a&gt;&lt;br /&gt;&quot;;
+		$actions = array();
+		$actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+		$actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+		if ( $default_cat_id != $category-&gt;term_id )
+			$actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;link-category.php?action=delete&amp;amp;cat_ID=$category-&gt;term_id&quot;, 'delete-link-category_' . $category-&gt;term_id) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf(__(&quot;You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $name )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+		$action_count = count($actions);
+		$i = 0;
+		$edit .= '&lt;div class=&quot;row-actions&quot;&gt;';
+		foreach ( $actions as $action =&gt; $link ) {
+			++$i;
+			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+			$edit .= &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+		}
+		$edit .= '&lt;/div&gt;';
 	} else {
 		$edit = $name;
 	}
 
-	$class = &quot; class='alternate'&quot; == $class ? '' : &quot; class='alternate'&quot;;
+	$row_class = 'alternate' == $row_class ? '' : 'alternate';
+	$qe_data = get_term_to_edit($category-&gt;term_id, 'link_category');
 
 	$category-&gt;count = number_format_i18n( $category-&gt;count );
 	$count = ( $category-&gt;count &gt; 0 ) ? &quot;&lt;a href='link-manager.php?cat_id=$category-&gt;term_id'&gt;$category-&gt;count&lt;/a&gt;&quot; : $category-&gt;count;
-	$output = &quot;&lt;tr id='link-cat-$category-&gt;term_id'$class&gt;
-			   &lt;th scope='row' class='check-column'&gt;&quot;;
-	if ( absint( get_option( 'default_link_category' ) ) != $category-&gt;term_id ) {
-		$output .= &quot;&lt;input type='checkbox' name='delete[]' value='$category-&gt;term_id' /&gt;&quot;;
-	} else {
-		$output .= &quot;&amp;nbsp;&quot;;
+	$output = &quot;&lt;tr id='link-cat-$category-&gt;term_id' class='iedit $row_class'&gt;&quot;;
+	$columns = get_column_headers('edit-link-categories');
+	$hidden = get_hidden_columns('edit-link-categories');
+	foreach ( $columns as $column_name =&gt; $column_display_name ) {
+		$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
+
+		$style = '';
+		if ( in_array($column_name, $hidden) )
+			$style = ' style=&quot;display:none;&quot;';
+
+		$attributes = &quot;$class$style&quot;;
+
+		switch ($column_name) {
+			case 'cb':
+				$output .= &quot;&lt;th scope='row' class='check-column'&gt;&quot;;
+				if ( absint( get_option( 'default_link_category' ) ) != $category-&gt;term_id ) {
+					$output .= &quot;&lt;input type='checkbox' name='delete[]' value='$category-&gt;term_id' /&gt;&quot;;
+				} else {
+					$output .= &quot;&amp;nbsp;&quot;;
+				}
+				$output .= &quot;&lt;/th&gt;&quot;;
+				break;
+			case 'name':
+				$output .= &quot;&lt;td $attributes&gt;$edit&quot;;
+				$output .= '&lt;div class=&quot;hidden&quot; id=&quot;inline_' . $qe_data-&gt;term_id . '&quot;&gt;';
+				$output .= '&lt;div class=&quot;name&quot;&gt;' . $qe_data-&gt;name . '&lt;/div&gt;';
+				$output .= '&lt;div class=&quot;slug&quot;&gt;' . $qe_data-&gt;slug . '&lt;/div&gt;';
+				$output .= '&lt;div class=&quot;cat_parent&quot;&gt;' . $qe_data-&gt;parent . '&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;';
+				break;
+			case 'description':
+				$output .= &quot;&lt;td $attributes&gt;$category-&gt;description&lt;/td&gt;&quot;;
+				break;
+			case 'slug':
+				$output .= &quot;&lt;td $attributes&gt;$category-&gt;slug&lt;/td&gt;&quot;;
+				break;
+			case 'links':
+				$attributes = 'class=&quot;links column-links num&quot;' . $style;
+				$output .= &quot;&lt;td $attributes&gt;$count&lt;/td&gt;&quot;;
+		}
 	}
-	$output .= &quot;&lt;/th&gt;
-				&lt;td&gt;$edit&lt;/td&gt;
-				&lt;td&gt;$category-&gt;description&lt;/td&gt;
-				&lt;td class='num'&gt;$count&lt;/td&gt;&lt;/tr&gt;&quot;;
+	$output .= '&lt;/tr&gt;';
 
-	return apply_filters( 'link_cat_row', $output );
+	return $output;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $checked
+ * @param unknown_type $current
+ */
 function checked( $checked, $current) {
 	if ( $checked == $current)
 		echo ' checked=&quot;checked&quot;';
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $selected
+ * @param unknown_type $current
+ */
 function selected( $selected, $current) {
 	if ( $selected == $current)
 		echo ' selected=&quot;selected&quot;';
@@ -154,12 +382,27 @@ function selected( $selected, $current) {
 // Category Checklists
 //
 
-// Deprecated. Use wp_link_category_checklist
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ * @deprecated Use {@link wp_link_category_checklist()}
+ * @see wp_link_category_checklist()
+ *
+ * @param unknown_type $default
+ * @param unknown_type $parent
+ * @param unknown_type $popular_ids
+ */
 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
 	global $post_ID;
 	wp_category_checklist($post_ID);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 class Walker_Category_Checklist extends Walker {
 	var $tree_type = 'category';
 	var $db_fields = array ('parent' =&gt; 'parent', 'id' =&gt; 'term_id'); //TODO: decouple this
@@ -178,7 +421,7 @@ class Walker_Category_Checklist extends Walker {
 		extract($args);
 
 		$class = in_array( $category-&gt;term_id, $popular_cats ) ? ' class=&quot;popular-category&quot;' : '';
-		$output .= &quot;\n&lt;li id='category-$category-&gt;term_id'$class&gt;&quot; . '&lt;label for=&quot;in-category-' . $category-&gt;term_id . '&quot; class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;post_category[]&quot; id=&quot;in-category-' . $category-&gt;term_id . '&quot;' . (in_array( $category-&gt;term_id, $selected_cats ) ? ' checked=&quot;checked&quot;' : &quot;&quot; ) . '/&gt; ' . wp_specialchars( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
+		$output .= &quot;\n&lt;li id='category-$category-&gt;term_id'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;post_category[]&quot; id=&quot;in-category-' . $category-&gt;term_id . '&quot;' . (in_array( $category-&gt;term_id, $selected_cats ) ? ' checked=&quot;checked&quot;' : &quot;&quot; ) . '/&gt; ' . wp_specialchars( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
 	}
 
 	function end_el(&amp;$output, $category, $depth, $args) {
@@ -186,12 +429,22 @@ class Walker_Category_Checklist extends Walker {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post_id
+ * @param unknown_type $descendants_and_self
+ * @param unknown_type $selected_cats
+ * @param unknown_type $popular_cats
+ */
 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) {
 	$walker = new Walker_Category_Checklist;
 	$descendants_and_self = (int) $descendants_and_self;
 
 	$args = array();
-	
+
 	if ( is_array( $selected_cats ) )
 		$args['selected_cats'] = $selected_cats;
 	elseif ( $post_id )
@@ -227,6 +480,17 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
 	echo call_user_func_array(array(&amp;$walker, 'walk'), array($categories, 0, $args));
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $taxonomy
+ * @param unknown_type $default
+ * @param unknown_type $number
+ * @param unknown_type $echo
+ * @return unknown
+ */
 function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
 	global $post_ID;
 	if ( $post_ID )
@@ -244,7 +508,7 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
 		?&gt;
 
 		&lt;li id=&quot;&lt;?php echo $id; ?&gt;&quot; class=&quot;popular-category&quot;&gt;
-			&lt;label class=&quot;selectit&quot; for=&quot;in-&lt;?php echo $id; ?&gt;&quot;&gt;
+			&lt;label class=&quot;selectit&quot;&gt;
 			&lt;input id=&quot;in-&lt;?php echo $id; ?&gt;&quot; type=&quot;checkbox&quot; value=&quot;&lt;?php echo (int) $category-&gt;term_id; ?&gt;&quot; /&gt;
 				&lt;?php echo wp_specialchars( apply_filters( 'the_category', $category-&gt;name ) ); ?&gt;
 			&lt;/label&gt;
@@ -255,14 +519,31 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
 	return $popular_ids;
 }
 
-// Deprecated. Use wp_link_category_checklist
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ * @deprecated Use {@link wp_link_category_checklist()}
+ * @see wp_link_category_checklist()
+ *
+ * @param unknown_type $default
+ */
 function dropdown_link_categories( $default = 0 ) {
 	global $link_id;
 
 	wp_link_category_checklist($link_id);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $link_id
+ */
 function wp_link_category_checklist( $link_id = 0 ) {
+	$default = 1;
+
 	if ( $link_id ) {
 		$checked_categories = wp_get_link_cats($link_id);
 
@@ -291,18 +572,68 @@ function wp_link_category_checklist( $link_id = 0 ) {
 
 // Returns a single tag row (see tag_rows below)
 // Note: this is also used in admin-ajax.php!
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $tag
+ * @param unknown_type $class
+ * @return unknown
+ */
 function _tag_row( $tag, $class = '' ) {
 		$count = number_format_i18n( $tag-&gt;count );
 		$count = ( $count &gt; 0 ) ? &quot;&lt;a href='edit.php?tag=$tag-&gt;slug'&gt;$count&lt;/a&gt;&quot; : $count;
 
 		$name = apply_filters( 'term_name', $tag-&gt;name );
+		$qe_data = get_term($tag-&gt;term_id, 'post_tag', object, 'edit');
+		$edit_link = &quot;edit-tags.php?action=edit&amp;amp;tag_ID=$tag-&gt;term_id&quot;;
 		$out = '';
 		$out .= '&lt;tr id=&quot;tag-' . $tag-&gt;term_id . '&quot;' . $class . '&gt;';
-		$out .= '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt; &lt;input type=&quot;checkbox&quot; name=&quot;delete_tags[]&quot; value=&quot;' . $tag-&gt;term_id . '&quot; /&gt;&lt;/th&gt;';
-		$out .= '&lt;td&gt;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;edit-tags.php?action=edit&amp;amp;tag_ID=' . $tag-&gt;term_id . '&quot; title=&quot;' . attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $name)) . '&quot;&gt;' .
-			$name . '&lt;/a&gt;&lt;/td&gt;';
+		$columns = get_column_headers('edit-tags');
+		$hidden = get_hidden_columns('edit-tags');
+		foreach ( $columns as $column_name =&gt; $column_display_name ) {
+			$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
+
+			$style = '';
+			if ( in_array($column_name, $hidden) )
+				$style = ' style=&quot;display:none;&quot;';
+
+			$attributes = &quot;$class$style&quot;;
+
+			switch ($column_name) {
+				case 'cb':
+					$out .= '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt; &lt;input type=&quot;checkbox&quot; name=&quot;delete_tags[]&quot; value=&quot;' . $tag-&gt;term_id . '&quot; /&gt;&lt;/th&gt;';
+					break;
+				case 'name':
+					$out .= '&lt;td ' . $attributes . '&gt;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;' . $edit_link . '&quot; title=&quot;' . attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $name)) . '&quot;&gt;' . $name . '&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;';
+					$actions = array();
+					$actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+					$actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+					$actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;edit-tags.php?action=delete&amp;amp;tag_ID=$tag-&gt;term_id&quot;, 'delete-tag_' . $tag-&gt;term_id) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf(__(&quot;You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $name )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+					$action_count = count($actions);
+					$i = 0;
+					$out .= '&lt;div class=&quot;row-actions&quot;&gt;';
+					foreach ( $actions as $action =&gt; $link ) {
+						++$i;
+						( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+						$out .= &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+					}
+					$out .= '&lt;/div&gt;';
+					$out .= '&lt;div class=&quot;hidden&quot; id=&quot;inline_' . $qe_data-&gt;term_id . '&quot;&gt;';
+					$out .= '&lt;div class=&quot;name&quot;&gt;' . $qe_data-&gt;name . '&lt;/div&gt;';
+					$out .= '&lt;div class=&quot;slug&quot;&gt;' . $qe_data-&gt;slug . '&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;';
+					break;
+				case 'slug':
+					$out .= &quot;&lt;td $attributes&gt;$tag-&gt;slug&lt;/td&gt;&quot;;
+					break;
+				case 'posts':
+					$attributes = 'class=&quot;posts column-posts num&quot;' . $style;
+					$out .= &quot;&lt;td $attributes&gt;$count&lt;/td&gt;&quot;;
+					break;
+			}
+		}
 
-		$out .= &quot;&lt;td class='num'&gt;$count&lt;/td&gt;&quot;;
 		$out .= '&lt;/tr&gt;';
 
 		return $out;
@@ -311,6 +642,16 @@ function _tag_row( $tag, $class = '' ) {
 // Outputs appropriate rows for the Nth page of the Tag Management screen,
 // assuming M tags displayed at a time on the page
 // Returns the number of tags displayed
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ * @param unknown_type $pagesize
+ * @param unknown_type $searchterms
+ * @return unknown
+ */
 function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
 
 	// Get a page worth of tags
@@ -326,81 +667,846 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
 
 	// convert it to table rows
 	$out = '';
-	$class = '';
 	$count = 0;
 	foreach( $tags as $tag )
-		$out .= _tag_row( $tag, ++$count % 2 ? ' class=&quot;alternate&quot;' : '' );
+		$out .= _tag_row( $tag, ++$count % 2 ? ' class=&quot;iedit alternate&quot;' : ' class=&quot;iedit&quot;' );
 
 	// filter and send to screen
-	$out = apply_filters('tag_rows', $out);
 	echo $out;
 	return $count;
 }
 
 // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function wp_manage_posts_columns() {
 	$posts_columns = array();
 	$posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
-	if ( 'draft' === $_GET['post_status'] )
-		$posts_columns['modified'] = __('Modified');
-	elseif ( 'pending' === $_GET['post_status'] )
-		$posts_columns['modified'] = __('Submitted');
-	else
-		$posts_columns['date'] = __('Date');
-	$posts_columns['title'] = __('Title');
+	$posts_columns['title'] = _c('Post|noun');
 	$posts_columns['author'] = __('Author');
 	$posts_columns['categories'] = __('Categories');
 	$posts_columns['tags'] = __('Tags');
-	if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
+	if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
 		$posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;Comments&quot; src=&quot;images/comment-grey-bubble.png&quot; /&gt;&lt;/div&gt;';
-	$posts_columns['status'] = __('Status');
+	$posts_columns['date'] = __('Date');
 	$posts_columns = apply_filters('manage_posts_columns', $posts_columns);
 
 	return $posts_columns;
 }
 
 // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function wp_manage_media_columns() {
 	$posts_columns = array();
 	$posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
 	$posts_columns['icon'] = '';
-	$posts_columns['media'] = _c('Media|media column header');
-	$posts_columns['desc'] = _c('Description|media column header');
-	$posts_columns['date'] = _c('Date Added|media column header');
-	$posts_columns['parent'] = _c('Appears with|media column header');
+	$posts_columns['media'] = _c('File|media column header');
+	$posts_columns['author'] = __('Author');
+	//$posts_columns['tags'] = _c('Tags|media column header');
+	$posts_columns['parent'] = _c('Attached to|media column header');
 	$posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;Comments&quot; src=&quot;images/comment-grey-bubble.png&quot; /&gt;&lt;/div&gt;';
-	$posts_columns['location'] = _c('Location|media column header');
+	//$posts_columns['comments'] = __('Comments');
+	$posts_columns['date'] = _c('Date|media column header');
 	$posts_columns = apply_filters('manage_media_columns', $posts_columns);
 
 	return $posts_columns;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function wp_manage_pages_columns() {
 	$posts_columns = array();
 	$posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
-	if ( 'draft' === $_GET['post_status'] )
-		$posts_columns['modified'] = __('Modified');
-	elseif ( 'pending' === $_GET['post_status'] )
-		$posts_columns['modified'] = __('Submitted');
-	else
-		$posts_columns['date'] = __('Date');
 	$posts_columns['title'] = __('Title');
 	$posts_columns['author'] = __('Author');
-	if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
+	$post_status = 'all';
+	if ( !empty($_GET['post_status']) )
+		$post_status = $_GET['post_status'];
+	if ( !in_array($post_status, array('pending', 'draft', 'future')) )
 		$posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;images/comment-grey-bubble.png&quot; /&gt;&lt;/div&gt;';
-	$posts_columns['status'] = __('Status');
+	$posts_columns['date'] = __('Date');
 	$posts_columns = apply_filters('manage_pages_columns', $posts_columns);
 
 	return $posts_columns;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ * @return unknown
+ */
+function get_column_headers($page) {
+	global $_wp_column_headers;
+
+	if ( !isset($_wp_column_headers) )
+		$_wp_column_headers = array();
+
+	// Store in static to avoid running filters on each call
+	if ( isset($_wp_column_headers[$page]) )
+		return $_wp_column_headers[$page];
+
+	switch ($page) {
+		case 'edit':
+			 $_wp_column_headers[$page] = wp_manage_posts_columns();
+			 break;
+		case 'edit-pages':
+			$_wp_column_headers[$page] = wp_manage_pages_columns();
+			break;
+		case 'edit-comments':
+			$_wp_column_headers[$page] = array(
+				'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
+				'author' =&gt; __('Author'),
+				'comment' =&gt; _c('Comment|noun'),
+				//'date' =&gt; __('Submitted'),
+				'response' =&gt; __('In Response To')
+			);
+
+			break;
+		case 'link-manager':
+			$_wp_column_headers[$page] = array(
+				'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
+				'name' =&gt; __('Name'),
+				'url' =&gt; __('URL'),
+				'categories' =&gt; __('Categories'),
+				'rel' =&gt; __('rel'),
+				'visible' =&gt; __('Visible')
+			);
+
+			break;
+		case 'upload':
+			$_wp_column_headers[$page] = wp_manage_media_columns();
+			break;
+		case 'categories':
+			$_wp_column_headers[$page] = array(
+				'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
+				'name' =&gt; __('Name'),
+				'description' =&gt; __('Description'),
+				'slug' =&gt; __('Slug'),
+				'posts' =&gt; __('Posts')
+			);
+
+			break;
+		case 'edit-link-categories':
+			$_wp_column_headers[$page] = array(
+				'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
+				'name' =&gt; __('Name'),
+				'description' =&gt; __('Description'),
+				'slug' =&gt; __('Slug'),
+				'links' =&gt; __('Links')
+			);
+
+			break;
+		case 'edit-tags':
+			$_wp_column_headers[$page] = array(
+				'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
+				'name' =&gt; __('Name'),
+				'slug' =&gt; __('Slug'),
+				'posts' =&gt; __('Posts')
+			);
+
+			break;
+		case 'users':
+			$_wp_column_headers[$page] = array(
+				'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
+				'username' =&gt; __('Username'),
+				'name' =&gt; __('Name'),
+				'email' =&gt; __('E-mail'),
+				'role' =&gt; __('Role'),
+				'posts' =&gt; __('Posts')
+			);
+			break;
+		default :
+			$_wp_column_headers[$page] = array();
+	}
+
+	$_wp_column_headers[$page] = apply_filters('manage_' . $page . '_columns', $_wp_column_headers[$page]);
+	return $_wp_column_headers[$page];
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $type
+ * @param unknown_type $id
+ */
+function print_column_headers( $type, $id = true ) {
+	$type = str_replace('.php', '', $type);
+	$columns = get_column_headers( $type );
+	$hidden = get_hidden_columns($type);
+	$styles = array();
+//	$styles['tag']['posts'] = 'width: 90px;';
+//	$styles['link-category']['links'] = 'width: 90px;';
+//	$styles['category']['posts'] = 'width: 90px;';
+//	$styles['link']['visible'] = 'text-align: center;';
+
+	foreach ( $columns as $column_key =&gt; $column_display_name ) {
+		$class = ' class=&quot;manage-column';
+
+		$class .= &quot; column-$column_key&quot;;
+
+		if ( 'cb' == $column_key )
+			$class .= ' check-column';
+		elseif ( in_array($column_key, array('posts', 'comments', 'links')) )
+			$class .= ' num';
+
+		$class .= '&quot;';
+
+		$style = '';
+		if ( in_array($column_key, $hidden) )
+			$style = 'display:none;';
+
+		if ( isset($styles[$type]) &amp;&amp; isset($styles[$type][$column_key]) )
+			$style .= ' ' . $styles[$type][$column_key];
+		$style = ' style=&quot;' . $style . '&quot;';
+?&gt;
+	&lt;th scope=&quot;col&quot; &lt;?php echo $id ? &quot;id=\&quot;$column_key\&quot;&quot; : &quot;&quot;; echo $class; echo $style; ?&gt;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/th&gt;
+&lt;?php }
+}
+
+/**
+ * Register column headers for a particular screen.  The header names will be listed in the Screen Options.
+ *
+ * @since 2.7.0
+ *
+ * @param string $screen The handle for the screen to add help to.  This is usually the hook name returned by the add_*_page() functions.
+ * @param array $columns An array of columns with column IDs as the keys and translated column names as the values
+ * @see get_column_headers(), print_column_headers(), get_hidden_columns()
+ */
+function register_column_headers($screen, $columns) {
+	global $_wp_column_headers;
+
+	if ( !isset($_wp_column_headers) )
+		$_wp_column_headers = array();
+
+	$_wp_column_headers[$screen] = $columns;
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ */
+function get_hidden_columns($page) {
+	$page = str_replace('.php', '', $page);
+	return (array) get_user_option( 'manage-' . $page . '-columns-hidden', 0, false );
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * Outputs the quick edit and bulk edit table rows for posts and pages
+ *
+ * @since 2.7
+ *
+ * @param string $type 'post' or 'page'
+ */
+function inline_edit_row( $type ) {
+	global $current_user, $mode;
+
+	$is_page = 'page' == $type;
+	if ( $is_page ) {
+		$screen = 'edit-pages';
+		$post = get_default_page_to_edit();
+	} else {
+		$screen = 'edit';
+		$post = get_default_post_to_edit();
+	}
+
+	$columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns();
+	$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
+	$col_count = count($columns) - count($hidden);
+	$m = ( isset($mode) &amp;&amp; 'excerpt' == $mode ) ? 'excerpt' : 'list';
+	$can_publish = current_user_can(&quot;publish_{$type}s&quot;);
+	$core_columns = array( 'cb' =&gt; true, 'date' =&gt; true, 'title' =&gt; true, 'categories' =&gt; true, 'tags' =&gt; true, 'comments' =&gt; true, 'author' =&gt; true );
+
+?&gt;
+
+&lt;form method=&quot;get&quot; action=&quot;&quot;&gt;&lt;table style=&quot;display: none&quot;&gt;&lt;tbody id=&quot;inlineedit&quot;&gt;
+	&lt;?php
+	$bulk = 0;
+	while ( $bulk &lt; 2 ) { ?&gt;
+
+	&lt;tr id=&quot;&lt;?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?&gt;&quot; class=&quot;inline-edit-row inline-edit-row-&lt;?php echo &quot;$type &quot;;
+		echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$type&quot; : &quot;quick-edit-row quick-edit-row-$type&quot;;
+	?&gt;&quot; style=&quot;display: none&quot;&gt;&lt;td colspan=&quot;&lt;?php echo $col_count; ?&gt;&quot;&gt;
+
+	&lt;fieldset class=&quot;inline-edit-col-left&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
+		&lt;h4&gt;&lt;?php echo $bulk ? ( $is_page ? __( 'Bulk Edit Pages' ) : __( 'Bulk Edit Posts' ) ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
+
+
+&lt;?php if ( $bulk ) : ?&gt;
+		&lt;div id=&quot;bulk-title-div&quot;&gt;
+			&lt;div id=&quot;bulk-titles&quot;&gt;&lt;/div&gt;
+		&lt;/div&gt;
+
+&lt;?php else : // $bulk ?&gt;
+
+		&lt;label&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Title' ); ?&gt;&lt;/span&gt;
+			&lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;post_title&quot; class=&quot;ptitle&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
+		&lt;/label&gt;
+
+&lt;?php endif; // $bulk ?&gt;
+
+
+&lt;?php if ( !$bulk ) : ?&gt;
+
+		&lt;label&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Slug' ); ?&gt;&lt;/span&gt;
+			&lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;post_name&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
+		&lt;/label&gt;
+
+		&lt;label&gt;&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Date' ); ?&gt;&lt;/span&gt;&lt;/label&gt;
+		&lt;div class=&quot;inline-edit-date&quot;&gt;
+			&lt;?php touch_time(1, 1, 4, 1); ?&gt;
+		&lt;/div&gt;
+		&lt;br class=&quot;clear&quot; /&gt;
+
+&lt;?php endif; // $bulk
+
+		ob_start();
+		$authors = get_editable_user_ids( $current_user-&gt;id, true, $type ); // TODO: ROLE SYSTEM
+		if ( $authors &amp;&amp; count( $authors ) &gt; 1 ) :
+			$users_opt = array('include' =&gt; $authors, 'name' =&gt; 'post_author', 'class'=&gt; 'authors', 'multi' =&gt; 1);
+			if ( $bulk )
+				$users_opt['show_option_none'] = __('- No Change -');
+?&gt;
+		&lt;label&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Author' ); ?&gt;&lt;/span&gt;
+			&lt;?php wp_dropdown_users( $users_opt ); ?&gt;
+		&lt;/label&gt;
+
+&lt;?php
+		endif; // authors
+		$authors_dropdown = ob_get_clean();
+?&gt;
+
+&lt;?php if ( !$bulk ) : echo $authors_dropdown; ?&gt;
+
+		&lt;div class=&quot;inline-edit-group&quot;&gt;
+			&lt;label class=&quot;alignleft&quot;&gt;
+				&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Password' ); ?&gt;&lt;/span&gt;
+				&lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;post_password&quot; class=&quot;inline-edit-password-input&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
+			&lt;/label&gt;
+
+			&lt;em style=&quot;margin:5px 10px 0 0&quot; class=&quot;alignleft&quot;&gt;&lt;?php echo _c( '&amp;ndash;OR&amp;ndash;|Between password field and private checkbox on post quick edit interface' ); ?&gt;&lt;/em&gt;
+
+			&lt;label class=&quot;alignleft inline-edit-private&quot;&gt;
+				&lt;input type=&quot;checkbox&quot; name=&quot;keep_private&quot; value=&quot;private&quot; /&gt;
+				&lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php echo $is_page ? __('Private page') : __('Private post'); ?&gt;&lt;/span&gt;
+			&lt;/label&gt;
+		&lt;/div&gt;
+
+&lt;?php endif; ?&gt;
+
+	&lt;/div&gt;&lt;/fieldset&gt;
+
+&lt;?php if ( !$is_page &amp;&amp; !$bulk ) : ?&gt;
+
+	&lt;fieldset class=&quot;inline-edit-col-center inline-edit-categories&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
+		&lt;span class=&quot;title inline-edit-categories-label&quot;&gt;&lt;?php _e( 'Categories' ); ?&gt;
+			&lt;span class=&quot;catshow&quot;&gt;&lt;?php _e('[more]'); ?&gt;&lt;/span&gt;
+			&lt;span class=&quot;cathide&quot; style=&quot;display:none;&quot;&gt;&lt;?php _e('[less]'); ?&gt;&lt;/span&gt;
+		&lt;/span&gt;
+		&lt;ul class=&quot;cat-checklist&quot;&gt;
+			&lt;?php wp_category_checklist(); ?&gt;
+		&lt;/ul&gt;
+	&lt;/div&gt;&lt;/fieldset&gt;
+
+&lt;?php endif; // !$is_page &amp;&amp; !$bulk ?&gt;
+
+	&lt;fieldset class=&quot;inline-edit-col-right&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
+
+&lt;?php
+	if ( $bulk )
+		echo $authors_dropdown;
+?&gt;
+
+&lt;?php if ( $is_page ) : ?&gt;
+
+		&lt;label&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Parent' ); ?&gt;&lt;/span&gt;
+&lt;?php
+	$dropdown_args = array('selected' =&gt; $post-&gt;post_parent, 'name' =&gt; 'post_parent', 'show_option_none' =&gt; __('Main Page (no parent)'), 'option_none_value' =&gt; 0, 'sort_column'=&gt; 'menu_order, post_title');
+	if ( $bulk )
+		$dropdown_args['show_option_no_change'] =  __('- No Change -');
+	$dropdown_args = apply_filters('quick_edit_dropdown_pages_args', $dropdown_args);
+	wp_dropdown_pages($dropdown_args);
+?&gt;
+		&lt;/label&gt;
+
+&lt;?php	if ( !$bulk ) : ?&gt;
+
+		&lt;label&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Order' ); ?&gt;&lt;/span&gt;
+			&lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;menu_order&quot; class=&quot;inline-edit-menu-order-input&quot; value=&quot;&lt;?php echo $post-&gt;menu_order ?&gt;&quot; /&gt;&lt;/span&gt;
+		&lt;/label&gt;
+
+&lt;?php	endif; // !$bulk ?&gt;
+
+		&lt;label&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Template' ); ?&gt;&lt;/span&gt;
+			&lt;select name=&quot;page_template&quot;&gt;
+&lt;?php	if ( $bulk ) : ?&gt;
+				&lt;option value=&quot;-1&quot;&gt;&lt;?php _e('- No Change -'); ?&gt;&lt;/option&gt;
+&lt;?php	endif; // $bulk ?&gt;
+				&lt;option value=&quot;default&quot;&gt;&lt;?php _e( 'Default Template' ); ?&gt;&lt;/option&gt;
+				&lt;?php page_template_dropdown() ?&gt;
+			&lt;/select&gt;
+		&lt;/label&gt;
+
+&lt;?php elseif ( !$bulk ) : // $is_page ?&gt;
+
+		&lt;label class=&quot;inline-edit-tags&quot;&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Tags' ); ?&gt;&lt;/span&gt;
+			&lt;textarea cols=&quot;22&quot; rows=&quot;1&quot; name=&quot;tags_input&quot; class=&quot;tags_input&quot;&gt;&lt;/textarea&gt;
+		&lt;/label&gt;
+
+&lt;?php endif; // $is_page  ?&gt;
+
+&lt;?php if ( $bulk ) : ?&gt;
+
+		&lt;div class=&quot;inline-edit-group&quot;&gt;
+		&lt;label class=&quot;alignleft&quot;&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Comments' ); ?&gt;&lt;/span&gt;
+			&lt;select name=&quot;comment_status&quot;&gt;
+				&lt;option value=&quot;&quot;&gt;&lt;?php _e('- No Change -'); ?&gt;&lt;/option&gt;
+				&lt;option value=&quot;open&quot;&gt;&lt;?php _e('Allow'); ?&gt;&lt;/option&gt;
+				&lt;option value=&quot;closed&quot;&gt;&lt;?php _e('Do not allow'); ?&gt;&lt;/option&gt;
+			&lt;/select&gt;
+		&lt;/label&gt;
+
+		&lt;label class=&quot;alignright&quot;&gt;
+			&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Pings' ); ?&gt;&lt;/span&gt;
+			&lt;select name=&quot;ping_status&quot;&gt;
+				&lt;option value=&quot;&quot;&gt;&lt;?php _e('- No Change -'); ?&gt;&lt;/option&gt;
+				&lt;option value=&quot;open&quot;&gt;&lt;?php _e('Allow'); ?&gt;&lt;/option&gt;
+				&lt;option value=&quot;closed&quot;&gt;&lt;?php _e('Do not allow'); ?&gt;&lt;/option&gt;
+			&lt;/select&gt;
+		&lt;/label&gt;
+		&lt;/div&gt;
+
+&lt;?php else : // $bulk ?&gt;
+
+		&lt;div class=&quot;inline-edit-group&quot;&gt;
+			&lt;label class=&quot;alignleft&quot;&gt;
+				&lt;input type=&quot;checkbox&quot; name=&quot;comment_status&quot; value=&quot;open&quot; /&gt;
+				&lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php _e( 'Allow Comments' ); ?&gt;&lt;/span&gt;
+			&lt;/label&gt;
+
+			&lt;label class=&quot;alignleft&quot;&gt;
+				&lt;input type=&quot;checkbox&quot; name=&quot;ping_status&quot; value=&quot;open&quot; /&gt;
+				&lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php _e( 'Allow Pings' ); ?&gt;&lt;/span&gt;
+			&lt;/label&gt;
+		&lt;/div&gt;
+
+&lt;?php endif; // $bulk ?&gt;
+
+
+		&lt;div class=&quot;inline-edit-group&quot;&gt;
+			&lt;label class=&quot;inline-edit-status alignleft&quot;&gt;
+				&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Status' ); ?&gt;&lt;/span&gt;
+				&lt;select name=&quot;_status&quot;&gt;
+&lt;?php if ( $bulk ) : ?&gt;
+					&lt;option value=&quot;-1&quot;&gt;&lt;?php _e('- No Change -'); ?&gt;&lt;/option&gt;
+&lt;?php endif; // $bulk ?&gt;
+				&lt;?php if ( $can_publish ) : // Contributors only get &quot;Unpublished&quot; and &quot;Pending Review&quot; ?&gt;
+					&lt;option value=&quot;publish&quot;&gt;&lt;?php _e( 'Published' ); ?&gt;&lt;/option&gt;
+					&lt;option value=&quot;future&quot;&gt;&lt;?php _e( 'Scheduled' ); ?&gt;&lt;/option&gt;
+&lt;?php if ( $bulk ) : ?&gt;
+					&lt;option value=&quot;private&quot;&gt;&lt;?php _e('Private') ?&gt;&lt;/option&gt;
+&lt;?php endif; // $bulk ?&gt;
+				&lt;?php endif; ?&gt;
+					&lt;option value=&quot;pending&quot;&gt;&lt;?php _e( 'Pending Review' ); ?&gt;&lt;/option&gt;
+					&lt;option value=&quot;draft&quot;&gt;&lt;?php _e( 'Unpublished' ); ?&gt;&lt;/option&gt;
+				&lt;/select&gt;
+			&lt;/label&gt;
+
+&lt;?php if ( !$is_page &amp;&amp; $can_publish &amp;&amp; current_user_can( 'edit_others_posts' ) ) : ?&gt;
+
+&lt;?php	if ( $bulk ) : ?&gt;
+
+			&lt;label class=&quot;alignright&quot;&gt;
+				&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Sticky' ); ?&gt;&lt;/span&gt;
+				&lt;select name=&quot;sticky&quot;&gt;
+					&lt;option value=&quot;-1&quot;&gt;&lt;?php _e( '- No Change -' ); ?&gt;&lt;/option&gt;
+					&lt;option value=&quot;sticky&quot;&gt;&lt;?php _e( 'Sticky' ); ?&gt;&lt;/option&gt;
+					&lt;option value=&quot;unsticky&quot;&gt;&lt;?php _e( 'Not Sticky' ); ?&gt;&lt;/option&gt;
+				&lt;/select&gt;
+			&lt;/label&gt;
+
+&lt;?php	else : // $bulk ?&gt;
+
+			&lt;label class=&quot;alignleft&quot;&gt;
+				&lt;input type=&quot;checkbox&quot; name=&quot;sticky&quot; value=&quot;sticky&quot; /&gt;
+				&lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php _e( 'Make this post sticky' ); ?&gt;&lt;/span&gt;
+			&lt;/label&gt;
+
+&lt;?php	endif; // $bulk ?&gt;
+
+&lt;?php endif; // !$is_page &amp;&amp; $can_publish &amp;&amp; current_user_can( 'edit_others_posts' ) ?&gt;
+
+		&lt;/div&gt;
+
+	&lt;/div&gt;&lt;/fieldset&gt;
+
+&lt;?php
+	foreach ( $columns as $column_name =&gt; $column_display_name ) {
+		if ( isset( $core_columns[$column_name] ) )
+			continue;
+		do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $type);
+	}
+?&gt;
+	&lt;p class=&quot;submit inline-edit-save&quot;&gt;
+		&lt;a accesskey=&quot;c&quot; href=&quot;#inline-edit&quot; title=&quot;&lt;?php _e('Cancel'); ?&gt;&quot; class=&quot;button-secondary cancel alignleft&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+		&lt;?php if ( ! $bulk ) {
+			wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
+			$update_text = ( $is_page ) ? __( 'Update Page' ) : __( 'Update Post' );
+			?&gt;
+			&lt;a accesskey=&quot;s&quot; href=&quot;#inline-edit&quot; title=&quot;&lt;?php _e('Update'); ?&gt;&quot; class=&quot;button-primary save alignright&quot;&gt;&lt;?php echo attribute_escape( $update_text ); ?&gt;&lt;/a&gt;
+			&lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;images/loading.gif&quot; alt=&quot;&quot; /&gt;
+		&lt;?php } else {
+			$update_text = ( $is_page ) ? __( 'Update Pages' ) : __( 'Update Posts' );
+		?&gt;
+			&lt;input accesskey=&quot;s&quot; class=&quot;button-primary alignright&quot; type=&quot;submit&quot; name=&quot;bulk_edit&quot; value=&quot;&lt;?php echo attribute_escape( $update_text ); ?&gt;&quot; /&gt;
+		&lt;?php } ?&gt;
+		&lt;input type=&quot;hidden&quot; name=&quot;post_view&quot; value=&quot;&lt;?php echo $m; ?&gt;&quot; /&gt;
+		&lt;br class=&quot;clear&quot; /&gt;
+	&lt;/p&gt;
+	&lt;/td&gt;&lt;/tr&gt;
+&lt;?php
+	$bulk++;
+	} ?&gt;
+	&lt;/tbody&gt;&lt;/table&gt;&lt;/form&gt;
+&lt;?php
+}
+
+// adds hidden fields with the data for use in the inline editor for posts and pages
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $post
+ */
+function get_inline_data($post) {
+
+	if ( ! current_user_can('edit_' . $post-&gt;post_type, $post-&gt;ID) )
+		return;
+
+	$title = attribute_escape($post-&gt;post_title);
+
+	echo '
+&lt;div class=&quot;hidden&quot; id=&quot;inline_' . $post-&gt;ID . '&quot;&gt;
+	&lt;div class=&quot;post_title&quot;&gt;' . $title . '&lt;/div&gt;
+	&lt;div class=&quot;post_name&quot;&gt;' . $post-&gt;post_name . '&lt;/div&gt;
+	&lt;div class=&quot;post_author&quot;&gt;' . $post-&gt;post_author . '&lt;/div&gt;
+	&lt;div class=&quot;comment_status&quot;&gt;' . $post-&gt;comment_status . '&lt;/div&gt;
+	&lt;div class=&quot;ping_status&quot;&gt;' . $post-&gt;ping_status . '&lt;/div&gt;
+	&lt;div class=&quot;_status&quot;&gt;' . $post-&gt;post_status . '&lt;/div&gt;
+	&lt;div class=&quot;jj&quot;&gt;' . mysql2date( 'd', $post-&gt;post_date ) . '&lt;/div&gt;
+	&lt;div class=&quot;mm&quot;&gt;' . mysql2date( 'm', $post-&gt;post_date ) . '&lt;/div&gt;
+	&lt;div class=&quot;aa&quot;&gt;' . mysql2date( 'Y', $post-&gt;post_date ) . '&lt;/div&gt;
+	&lt;div class=&quot;hh&quot;&gt;' . mysql2date( 'H', $post-&gt;post_date ) . '&lt;/div&gt;
+	&lt;div class=&quot;mn&quot;&gt;' . mysql2date( 'i', $post-&gt;post_date ) . '&lt;/div&gt;
+	&lt;div class=&quot;ss&quot;&gt;' . mysql2date( 's', $post-&gt;post_date ) . '&lt;/div&gt;
+	&lt;div class=&quot;post_password&quot;&gt;' . wp_specialchars($post-&gt;post_password, 1) . '&lt;/div&gt;';
+
+	if( $post-&gt;post_type == 'page' )
+		echo '
+	&lt;div class=&quot;post_parent&quot;&gt;' . $post-&gt;post_parent . '&lt;/div&gt;
+	&lt;div class=&quot;page_template&quot;&gt;' . wp_specialchars(get_post_meta( $post-&gt;ID, '_wp_page_template', true ), 1) . '&lt;/div&gt;
+	&lt;div class=&quot;menu_order&quot;&gt;' . $post-&gt;menu_order . '&lt;/div&gt;';
+
+	if( $post-&gt;post_type == 'post' )
+		echo '
+	&lt;div class=&quot;tags_input&quot;&gt;' . wp_specialchars( str_replace( ',', ', ', get_tags_to_edit($post-&gt;ID) ), 1) . '&lt;/div&gt;
+	&lt;div class=&quot;post_category&quot;&gt;' . implode( ',', wp_get_post_categories( $post-&gt;ID ) ) . '&lt;/div&gt;
+	&lt;div class=&quot;sticky&quot;&gt;' . (is_sticky($post-&gt;ID) ? 'sticky' : '') . '&lt;/div&gt;';
+
+	echo '&lt;/div&gt;';
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $posts
+ */
+function post_rows( $posts = array() ) {
+	global $wp_query, $post, $mode;
+
+	add_filter('the_title','wp_specialchars');
+
+	// Create array of post IDs.
+	$post_ids = array();
+
+	if ( empty($posts) )
+		$posts = &amp;$wp_query-&gt;posts;
+
+	foreach ( $posts as $a_post )
+		$post_ids[] = $a_post-&gt;ID;
+
+	$comment_pending_count = get_pending_comments_num($post_ids);
+	if ( empty($comment_pending_count) )
+		$comment_pending_count = array();
+
+	foreach ( $posts as $post ) {
+		if ( empty($comment_pending_count[$post-&gt;ID]) )
+			$comment_pending_count[$post-&gt;ID] = 0;
+
+		_post_row($post, $comment_pending_count[$post-&gt;ID], $mode);
+	}
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $a_post
+ * @param unknown_type $pending_comments
+ * @param unknown_type $mode
+ */
+function _post_row($a_post, $pending_comments, $mode) {
+	global $post;
+	static $rowclass;
+
+	$global_post = $post;
+	$post = $a_post;
+	setup_postdata($post);
+
+	$rowclass = 'alternate' == $rowclass ? '' : 'alternate';
+	global $current_user;
+	$post_owner = ( $current_user-&gt;ID == $post-&gt;post_author ? 'self' : 'other' );
+	$edit_link = get_edit_post_link( $post-&gt;ID );
+	$title = _draft_or_post_title();
+?&gt;
+	&lt;tr id='post-&lt;?php echo $post-&gt;ID; ?&gt;' class='&lt;?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post-&gt;post_status ); ?&gt; iedit' valign=&quot;top&quot;&gt;
+&lt;?php
+	$posts_columns = get_column_headers('edit');
+	$hidden = get_hidden_columns('edit');
+	foreach ( $posts_columns as $column_name=&gt;$column_display_name ) {
+		$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
+
+		$style = '';
+		if ( in_array($column_name, $hidden) )
+			$style = ' style=&quot;display:none;&quot;';
+
+		$attributes = &quot;$class$style&quot;;
+
+		switch ($column_name) {
+
+		case 'cb':
+		?&gt;
+		&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can( 'edit_post', $post-&gt;ID ) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;post[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/th&gt;
+		&lt;?php
+		break;
+
+		case 'date':
+			if ( '0000-00-00 00:00:00' == $post-&gt;post_date &amp;&amp; 'date' == $column_name ) {
+				$t_time = $h_time = __('Unpublished');
+			} else {
+				$t_time = get_the_time(__('Y/m/d g:i:s A'));
+				$m_time = $post-&gt;post_date;
+				$time = get_post_time('G', true, $post);
+
+				$time_diff = time() - $time;
+
+				if ( ( 'future' == $post-&gt;post_status) ) {
+					if ( $time_diff &lt;= 0 ) {
+						$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
+					} else {
+						$h_time = $t_time;
+						$missed = true;
+					}
+				} else {
+
+					if ( $time_diff &gt; 0 &amp;&amp; $time_diff &lt; 24*60*60 )
+						$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
+					else
+						$h_time = mysql2date(__('Y/m/d'), $m_time);
+				}
+			}
+
+			echo '&lt;td ' . $attributes . '&gt;';
+			if ( 'excerpt' == $mode )
+				echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode);
+			else
+				echo '&lt;abbr title=&quot;' . $t_time . '&quot;&gt;' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '&lt;/abbr&gt;';
+			echo '&lt;br /&gt;';
+			if ( 'publish' == $post-&gt;post_status ) {
+				_e('Published');
+			} elseif ( 'future' == $post-&gt;post_status ) {
+				if ( isset($missed) )
+					echo '&lt;strong class=&quot;attention&quot;&gt;' . __('Missed schedule') . '&lt;/strong&gt;';
+				else
+					_e('Scheduled');
+			} else {
+				_e('Last Modified');
+			}
+			echo '&lt;/td&gt;';
+		break;
+
+		case 'title':
+			$attributes = 'class=&quot;post-title column-title&quot;' . $style;
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can( 'edit_post', $post-&gt;ID ) ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $title; }; _post_states($post); ?&gt;&lt;/strong&gt;
+		&lt;?php
+			if ( 'excerpt' == $mode )
+				the_excerpt();
+
+			$actions = array();
+			if ( current_user_can('edit_post', $post-&gt;ID) ) {
+				$actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot; title=&quot;' . attribute_escape(__('Edit this post')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+				$actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot; title=&quot;' . attribute_escape(__('Edit this post inline')) . '&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+				$actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . attribute_escape(__('Delete this post')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$post-&gt;ID&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf( ('draft' == $post-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $post-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+			}
+			if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
+				if ( current_user_can('edit_post', $post-&gt;ID) )
+					$actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . attribute_escape(sprintf(__('Preview &quot;%s&quot;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
+			} else {
+				$actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . attribute_escape(sprintf(__('View &quot;%s&quot;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
+			}
+			$action_count = count($actions);
+			$i = 0;
+			echo '&lt;div class=&quot;row-actions&quot;&gt;';
+			foreach ( $actions as $action =&gt; $link ) {
+				++$i;
+				( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+				echo &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+			}
+			echo '&lt;/div&gt;';
+
+			get_inline_data($post);
+		?&gt;
+		&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'categories':
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
+			$categories = get_the_category();
+			if ( !empty( $categories ) ) {
+				$out = array();
+				foreach ( $categories as $c )
+					$out[] = &quot;&lt;a href='edit.php?category_name=$c-&gt;slug'&gt; &quot; . wp_specialchars(sanitize_term_field('name', $c-&gt;name, $c-&gt;term_id, 'category', 'display')) . &quot;&lt;/a&gt;&quot;;
+					echo join( ', ', $out );
+			} else {
+				_e('Uncategorized');
+			}
+		?&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'tags':
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
+			$tags = get_the_tags($post-&gt;ID);
+			if ( !empty( $tags ) ) {
+				$out = array();
+				foreach ( $tags as $c )
+					$out[] = &quot;&lt;a href='edit.php?tag=$c-&gt;slug'&gt; &quot; . wp_specialchars(sanitize_term_field('name', $c-&gt;name, $c-&gt;term_id, 'post_tag', 'display')) . &quot;&lt;/a&gt;&quot;;
+				echo join( ', ', $out );
+			} else {
+				_e('No Tags');
+			}
+		?&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'comments':
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;div class=&quot;post-com-count-wrapper&quot;&gt;
+		&lt;?php
+			$pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) );
+			if ( $pending_comments )
+				echo '&lt;strong&gt;';
+				comments_number(&quot;&lt;a href='edit-comments.php?p=$post-&gt;ID' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$post-&gt;ID' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$post-&gt;ID' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
+				if ( $pending_comments )
+				echo '&lt;/strong&gt;';
+		?&gt;
+		&lt;/div&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'author':
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;a href=&quot;edit.php?author=&lt;?php the_author_ID(); ?&gt;&quot;&gt;&lt;?php the_author() ?&gt;&lt;/a&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'control_view':
+		?&gt;
+		&lt;td&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; rel=&quot;permalink&quot; class=&quot;view&quot;&gt;&lt;?php _e('View'); ?&gt;&lt;/a&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'control_edit':
+		?&gt;
+		&lt;td&gt;&lt;?php if ( current_user_can('edit_post', $post-&gt;ID) ) { echo &quot;&lt;a href='$edit_link' class='edit'&gt;&quot; . __('Edit') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		case 'control_delete':
+		?&gt;
+		&lt;td&gt;&lt;?php if ( current_user_can('delete_post', $post-&gt;ID) ) { echo &quot;&lt;a href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$id&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' class='delete'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+
+		default:
+		?&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php do_action('manage_posts_custom_column', $column_name, $post-&gt;ID); ?&gt;&lt;/td&gt;
+		&lt;?php
+		break;
+	}
+}
+?&gt;
+	&lt;/tr&gt;
+&lt;?php
+	$post = $global_post;
+}
+
 /*
  * display one row if the page doesn't have any children
  * otherwise, display the row and its children in subsequent rows
  */
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ * @param unknown_type $level
+ */
 function display_page_row( $page, $level = 0 ) {
 	global $post;
-	static $class;
+	static $rowclass;
 
 	$post = $page;
 	setup_postdata($page);
@@ -408,40 +1514,38 @@ function display_page_row( $page, $level = 0 ) {
 	$page-&gt;post_title = wp_specialchars( $page-&gt;post_title );
 	$pad = str_repeat( '&amp;#8212; ', $level );
 	$id = (int) $page-&gt;ID;
-	$class = ('alternate' == $class ) ? '' : 'alternate';
-	$posts_columns = wp_manage_pages_columns();
-	$title = get_the_title();
-	if ( empty($title) )
-		$title = __('(no title)');
+	$rowclass = 'alternate' == $rowclass ? '' : 'alternate';
+	$posts_columns = get_column_headers('edit-pages');
+	$hidden = get_hidden_columns('edit-pages');
+	$title = _draft_or_post_title();
 ?&gt;
-  &lt;tr id='page-&lt;?php echo $id; ?&gt;' class='&lt;?php echo $class; ?&gt;'&gt;
+&lt;tr id=&quot;page-&lt;?php echo $id; ?&gt;&quot; class=&quot;&lt;?php echo $rowclass; ?&gt; iedit&quot;&gt;
+&lt;?php
 
+foreach ($posts_columns as $column_name=&gt;$column_display_name) {
+	$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
 
- &lt;?php
+	$style = '';
+	if ( in_array($column_name, $hidden) )
+		$style = ' style=&quot;display:none;&quot;';
 
-foreach ($posts_columns as $column_name=&gt;$column_display_name) {
+	$attributes = &quot;$class$style&quot;;
 
 	switch ($column_name) {
 
 	case 'cb':
 		?&gt;
-		&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;delete[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;/th&gt;
+		&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;post[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;/th&gt;
 		&lt;?php
 		break;
-	case 'modified':
 	case 'date':
 		if ( '0000-00-00 00:00:00' == $page-&gt;post_date &amp;&amp; 'date' == $column_name ) {
 			$t_time = $h_time = __('Unpublished');
 		} else {
-			if ( 'modified' == $column_name ) {
-				$t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
-				$m_time = $page-&gt;post_modified;
-				$time = get_post_modified_time('G', true);
-			} else {
-				$t_time = get_the_time(__('Y/m/d g:i:s A'));
-				$m_time = $page-&gt;post_date;
-				$time = get_post_time('G', true);
-			}
+			$t_time = get_the_time(__('Y/m/d g:i:s A'));
+			$m_time = $page-&gt;post_date;
+			$time = get_post_time('G', true);
+
 			if ( ( abs(time() - $time) ) &lt; 86400 ) {
 				if ( ( 'future' == $page-&gt;post_status) )
 					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
@@ -451,26 +1555,57 @@ foreach ($posts_columns as $column_name=&gt;$column_display_name) {
 				$h_time = mysql2date(__('Y/m/d'), $m_time);
 			}
 		}
-		?&gt;
-		&lt;td&gt;&lt;abbr title=&quot;&lt;?php echo $t_time ?&gt;&quot;&gt;&lt;?php echo $h_time ?&gt;&lt;/abbr&gt;&lt;/td&gt;
-		&lt;?php
+		echo '&lt;td ' . $attributes . '&gt;';
+		echo '&lt;abbr title=&quot;' . $t_time . '&quot;&gt;' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '&lt;/abbr&gt;';
+		echo '&lt;br /&gt;';
+		if ( 'publish' == $page-&gt;post_status || 'future' == $page-&gt;post_status )
+			_e('Published');
+		else
+			_e('Last Modified');
+		echo '&lt;/td&gt;';
 		break;
 	case 'title':
+		$attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
+		$edit_link = get_edit_post_link( $page-&gt;ID );
 		?&gt;
-		&lt;td&gt;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;page.php?action=edit&amp;amp;post=&lt;?php the_ID(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;/strong&gt;
-		&lt;?php if ('private' == $page-&gt;post_status) _e(' &amp;#8212; &lt;strong&gt;Private&lt;/strong&gt;'); ?&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can( 'edit_post', $page-&gt;ID ) ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('Edit &quot;%s&quot;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states($page); ?&gt;&lt;/strong&gt;
 		&lt;?php
+		$actions = array();
+		if ( current_user_can('edit_page', $page-&gt;ID) ) {
+			$actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot; title=&quot;' . attribute_escape(__('Edit this page')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+			$actions['inline'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+			$actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . attribute_escape(__('Delete this page')) . &quot;' href='&quot; . wp_nonce_url(&quot;page.php?action=delete&amp;amp;post=$page-&gt;ID&quot;, 'delete-page_' . $page-&gt;ID) . &quot;' onclick=\&quot;if ( confirm('&quot; . js_escape(sprintf( ('draft' == $page-&gt;post_status) ? __(&quot;You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;) : __(&quot;You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete.&quot;), $page-&gt;post_title )) . &quot;') ) { return true;}return false;\&quot;&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+		}
+		if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
+			if ( current_user_can('edit_page', $page-&gt;ID) )
+				$actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . attribute_escape(sprintf(__('Preview &quot;%s&quot;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
+		} else {
+			$actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . attribute_escape(sprintf(__('View &quot;%s&quot;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
+		}
+		$action_count = count($actions);
+
+		$i = 0;
+		echo '&lt;div class=&quot;row-actions&quot;&gt;';
+		foreach ( $actions as $action =&gt; $link ) {
+			++$i;
+			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+			echo &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+		}
+		echo '&lt;/div&gt;';
+
+		get_inline_data($post);
+		echo '&lt;/td&gt;';
 		break;
 
 	case 'comments':
 		?&gt;
-		&lt;td class=&quot;num&quot;&gt;&lt;div class=&quot;post-com-count-wrapper&quot;&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;div class=&quot;post-com-count-wrapper&quot;&gt;
 		&lt;?php
 		$left = get_pending_comments_num( $page-&gt;ID );
 		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
 		if ( $left )
 			echo '&lt;strong&gt;';
-		comments_number(&quot;&lt;a href='edit-pages.php?page_id=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-pages.php?page_id=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-pages.php?page_id=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
+		comments_number(&quot;&lt;a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
 		if ( $left )
 			echo '&lt;/strong&gt;';
 		?&gt;
@@ -480,46 +1615,20 @@ foreach ($posts_columns as $column_name=&gt;$column_display_name) {
 
 	case 'author':
 		?&gt;
-		&lt;td&gt;&lt;a href=&quot;edit-pages.php?author=&lt;?php the_author_ID(); ?&gt;&quot;&gt;&lt;?php the_author() ?&gt;&lt;/a&gt;&lt;/td&gt;
-		&lt;?php
-		break;
-
-	case 'status':
-		?&gt;
-		&lt;td&gt;
-		&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php echo attribute_escape(sprintf(__('View &quot;%s&quot;'), $title)); ?&gt;&quot; rel=&quot;permalink&quot;&gt;
-		&lt;?php
-		switch ( $page-&gt;post_status ) {
-			case 'publish' :
-			case 'private' :
-				_e('Published');
-				break;
-			case 'future' :
-				_e('Scheduled');
-				break;
-			case 'pending' :
-				_e('Pending Review');
-				break;
-			case 'draft' :
-				_e('Unpublished');
-				break;
-		}
-		?&gt;
-		&lt;/a&gt;
-		&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;a href=&quot;edit-pages.php?author=&lt;?php the_author_ID(); ?&gt;&quot;&gt;&lt;?php the_author() ?&gt;&lt;/a&gt;&lt;/td&gt;
 		&lt;?php
 		break;
 
 	default:
 		?&gt;
-		&lt;td&gt;&lt;?php do_action('manage_pages_custom_column', $column_name, $id); ?&gt;&lt;/td&gt;
+		&lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php do_action('manage_pages_custom_column', $column_name, $id); ?&gt;&lt;/td&gt;
 		&lt;?php
 		break;
 	}
 }
- ?&gt;
+?&gt;
 
-   &lt;/tr&gt;
+&lt;/tr&gt;
 
 &lt;?php
 }
@@ -527,7 +1636,19 @@ foreach ($posts_columns as $column_name=&gt;$column_display_name) {
 /*
  * displays pages in hierarchical order with paging support
  */
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $pages
+ * @param unknown_type $pagenum
+ * @param unknown_type $per_page
+ * @return unknown
+ */
 function page_rows($pages, $pagenum = 1, $per_page = 20) {
+	global $wpdb;
+
 	$level = 0;
 
 	if ( ! $pages ) {
@@ -537,27 +1658,27 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
 			return false;
 	}
 
-	/* 
+	/*
 	 * arrange pages into two parts: top level pages and children_pages
-	 * children_pages is two dimensional array, eg. 
-	 * children_pages[10][] contains all sub-pages whose parent is 10. 
+	 * children_pages is two dimensional array, eg.
+	 * children_pages[10][] contains all sub-pages whose parent is 10.
 	 * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations
 	 * If searching, ignore hierarchy and treat everything as top level
 	 */
-	if ( empty($_GET['s']) )  {
-		
+	if ( empty($_GET['s']) ) {
+
 		$top_level_pages = array();
-		$children_pages  = array();
-		
+		$children_pages = array();
+
 		foreach ( $pages as $page ) {
-			
+
 			// catch and repair bad pages
 			if ( $page-&gt;post_parent == $page-&gt;ID ) {
 				$page-&gt;post_parent = 0;
 				$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;UPDATE $wpdb-&gt;posts SET post_parent = '0' WHERE ID = %d&quot;, $page-&gt;ID) );
 				clean_page_cache( $page-&gt;ID );
 			}
-	
+
 			if ( 0 == $page-&gt;post_parent )
 				$top_level_pages[] = $page;
 			else
@@ -570,7 +1691,7 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
 	$count = 0;
 	$start = ($pagenum - 1) * $per_page;
 	$end = $start + $per_page;
-	
+
 	foreach ( $pages as $page ) {
 		if ( $count &gt;= $end )
 			break;
@@ -583,7 +1704,7 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
 		if ( isset($children_pages) )
 			_page_rows( $children_pages, $count, $page-&gt;ID, $level + 1, $pagenum, $per_page );
 	}
-	
+
 	// if it is the last pagenum and there are orphaned pages, display them with paging as well
 	if ( isset($children_pages) &amp;&amp; $count &lt; $end ){
 		foreach( $children_pages as $orphans ){
@@ -602,19 +1723,31 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
  * Given a top level page ID, display the nested hierarchy of sub-pages
  * together with paging support
  */
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $children_pages
+ * @param unknown_type $count
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $pagenum
+ * @param unknown_type $per_page
+ */
 function _page_rows( &amp;$children_pages, &amp;$count, $parent, $level, $pagenum, $per_page ) {
-	
+
 	if ( ! isset( $children_pages[$parent] ) )
-		return; 
-		
+		return;
+
 	$start = ($pagenum - 1) * $per_page;
 	$end = $start + $per_page;
-	
+
 	foreach ( $children_pages[$parent] as $page ) {
-		
+
 		if ( $count &gt;= $end )
 			break;
-			
+
 		// If the page starts in a subtree, print the parents.
 		if ( $count == $start &amp;&amp; $page-&gt;post_parent &gt; 0 ) {
 			$my_parents = array();
@@ -635,20 +1768,30 @@ function _page_rows( &amp;$children_pages, &amp;$count, $parent, $level, $pagenum, $per_
 
 		if ( $count &gt;= $start )
 			echo &quot;\t&quot; . display_page_row( $page, $level );
-			
+
 		$count++;
 
 		_page_rows( $children_pages, $count, $page-&gt;ID, $level + 1, $pagenum, $per_page );
 	}
-	
+
 	unset( $children_pages[$parent] ); //required in order to keep track of orphans
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $user_object
+ * @param unknown_type $style
+ * @param unknown_type $role
+ * @return unknown
+ */
 function user_row( $user_object, $style = '', $role = '' ) {
 	global $wp_roles;
 
 	$current_user = wp_get_current_user();
-	
+
 	if ( !( is_object( $user_object) &amp;&amp; is_a( $user_object, 'WP_User' ) ) )
 		$user_object = new WP_User( (int) $user_object );
 	$email = $user_object-&gt;user_email;
@@ -658,42 +1801,98 @@ function user_row( $user_object, $style = '', $role = '' ) {
 	if ('/' == substr( $short_url, -1 ))
 		$short_url = substr( $short_url, 0, -1 );
 	if ( strlen( $short_url ) &gt; 35 )
-		$short_url =  substr( $short_url, 0, 32 ).'...';
+		$short_url = substr( $short_url, 0, 32 ).'...';
 	$numposts = get_usernumposts( $user_object-&gt;ID );
 	if ( current_user_can( 'edit_user', $user_object-&gt;ID ) ) {
 		if ($current_user-&gt;ID == $user_object-&gt;ID) {
-			$edit = 'profile.php';
+			$edit_link = 'profile.php';
 		} else {
-			$edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), &quot;user-edit.php?user_id=$user_object-&gt;ID&quot; ) );
+			$edit_link = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), &quot;user-edit.php?user_id=$user_object-&gt;ID&quot; ) );
 		}
-		$edit = &quot;&lt;a href=\&quot;$edit\&quot;&gt;$user_object-&gt;user_login&lt;/a&gt;&quot;;
+		$edit = &quot;&lt;strong&gt;&lt;a href=\&quot;$edit_link\&quot;&gt;$user_object-&gt;user_login&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&quot;;
+		$actions = array();
+		$actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
+		if ( $current_user-&gt;ID != $user_object-&gt;ID )
+			$actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url(&quot;users.php?action=delete&amp;amp;user=$user_object-&gt;ID&quot;, 'bulk-users') . &quot;'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
+		$action_count = count($actions);
+		$i = 0;
+		$edit .= '&lt;div class=&quot;row-actions&quot;&gt;';
+		foreach ( $actions as $action =&gt; $link ) {
+			++$i;
+			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+			$edit .= &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
+		}
+		$edit .= '&lt;/div&gt;';
 	} else {
-		$edit = $user_object-&gt;user_login;
+		$edit = '&lt;strong&gt;' . $user_object-&gt;user_login . '&lt;/strong&gt;';
 	}
-	$role_name = $wp_roles-&gt;role_names[$role] ? translate_with_context($wp_roles-&gt;role_names[$role]) : __('None');
-	$r = &quot;&lt;tr id='user-$user_object-&gt;ID'$style&gt;
-		&lt;th scope='row' class='check-column'&gt;&lt;input type='checkbox' name='users[]' id='user_{$user_object-&gt;ID}' class='$role' value='{$user_object-&gt;ID}' /&gt;&lt;/th&gt;
-		&lt;td&gt;&lt;strong&gt;$edit&lt;/strong&gt;&lt;/td&gt;
-		&lt;td&gt;$user_object-&gt;first_name $user_object-&gt;last_name&lt;/td&gt;
-		&lt;td&gt;&lt;a href='mailto:$email' title='&quot; . sprintf( __('e-mail: %s' ), $email ) . &quot;'&gt;$email&lt;/a&gt;&lt;/td&gt;
-		&lt;td&gt;$role_name&lt;/td&gt;&quot;;
-	$r .= &quot;\n\t\t&lt;td class='num'&gt;&quot;;
-	if ( $numposts &gt; 0 ) {
-		$r .= &quot;&lt;a href='edit.php?author=$user_object-&gt;ID' title='&quot; . __( 'View posts by this author' ) . &quot;' class='edit'&gt;&quot;;
-		$r .= $numposts;
-		$r .= '&lt;/a&gt;';
-	} else {
-		$r .= 0;
+	$role_name = isset($wp_roles-&gt;role_names[$role]) ? translate_with_context($wp_roles-&gt;role_names[$role]) : __('None');
+	$r = &quot;&lt;tr id='user-$user_object-&gt;ID'$style&gt;&quot;;
+	$columns = get_column_headers('users');
+	$hidden = get_hidden_columns('users');
+	$avatar = get_avatar( $user_object-&gt;user_email, 32 );
+	foreach ( $columns as $column_name =&gt; $column_display_name ) {
+		$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
+
+		$style = '';
+		if ( in_array($column_name, $hidden) )
+			$style = ' style=&quot;display:none;&quot;';
+
+		$attributes = &quot;$class$style&quot;;
+
+		switch ($column_name) {
+			case 'cb':
+				$r .= &quot;&lt;th scope='row' class='check-column'&gt;&lt;input type='checkbox' name='users[]' id='user_{$user_object-&gt;ID}' class='$role' value='{$user_object-&gt;ID}' /&gt;&lt;/th&gt;&quot;;
+				break;
+			case 'username':
+				$r .= &quot;&lt;td $attributes&gt;$avatar $edit&lt;/td&gt;&quot;;
+				break;
+			case 'name':
+				$r .= &quot;&lt;td $attributes&gt;$user_object-&gt;first_name $user_object-&gt;last_name&lt;/td&gt;&quot;;
+				break;
+			case 'email':
+				$r .= &quot;&lt;td $attributes&gt;&lt;a href='mailto:$email' title='&quot; . sprintf( __('e-mail: %s' ), $email ) . &quot;'&gt;$email&lt;/a&gt;&lt;/td&gt;&quot;;
+				break;
+			case 'role':
+				$r .= &quot;&lt;td $attributes&gt;$role_name&lt;/td&gt;&quot;;
+				break;
+			case 'posts':
+				$attributes = 'class=&quot;posts column-posts num&quot;' . $style;
+				$r .= &quot;&lt;td $attributes&gt;&quot;;
+				if ( $numposts &gt; 0 ) {
+					$r .= &quot;&lt;a href='edit.php?author=$user_object-&gt;ID' title='&quot; . __( 'View posts by this author' ) . &quot;' class='edit'&gt;&quot;;
+					$r .= $numposts;
+					$r .= '&lt;/a&gt;';
+				} else {
+					$r .= 0;
+				}
+				$r .= &quot;&lt;/td&gt;&quot;;
+		}
 	}
-	$r .= &quot;&lt;/td&gt;\n\t&lt;/tr&gt;&quot;;
+	$r .= '&lt;/tr&gt;';
+
 	return $r;
 }
 
-function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $status
+ * @param unknown_type $s
+ * @param unknown_type $start
+ * @param unknown_type $num
+ * @param unknown_type $post
+ * @param unknown_type $type
+ * @return unknown
+ */
+function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
 	global $wpdb;
 
 	$start = abs( (int) $start );
 	$num = (int) $num;
+	$post = (int) $post;
 
 	if ( 'moderated' == $status )
 		$approved = &quot;comment_approved = '0'&quot;;
@@ -704,6 +1903,25 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
 	else
 		$approved = &quot;( comment_approved = '0' OR comment_approved = '1' )&quot;;
 
+	if ( $post ) {
+		$post = &quot; AND comment_post_ID = '$post'&quot;;
+		$orderby = &quot;ORDER BY comment_date_gmt ASC LIMIT $start, $num&quot;;
+	} else {
+		$post = '';
+		$orderby = &quot;ORDER BY comment_date_gmt DESC LIMIT $start, $num&quot;;
+	}
+
+	if ( 'comment' == $type )
+		$typesql = &quot;AND comment_type = ''&quot;;
+	elseif ( 'pingback' == $type )
+		$typesql = &quot;AND comment_type = 'pingback'&quot;;
+	elseif ( 'trackback' == $type )
+		$typesql = &quot;AND comment_type = 'trackback'&quot;;
+	elseif ( 'pings' == $type )
+		$typesql = &quot;AND ( comment_type = 'pingback' OR comment_type = 'trackback' )&quot;;
+	else
+		$typesql = '';
+
 	if ( $s ) {
 		$s = $wpdb-&gt;escape($s);
 		$comments = $wpdb-&gt;get_results(&quot;SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb-&gt;comments WHERE
@@ -713,9 +1931,10 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
 			comment_author_IP LIKE ('%$s%') OR
 			comment_content LIKE ('%$s%') ) AND
 			$approved
-			ORDER BY comment_date_gmt DESC LIMIT $start, $num&quot;);
+			$typesql
+			$orderby&quot;);
 	} else {
-		$comments = $wpdb-&gt;get_results( &quot;SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb-&gt;comments WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num&quot; );
+		$comments = $wpdb-&gt;get_results( &quot;SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb-&gt;comments WHERE $approved $post $typesql $orderby&quot; );
 	}
 
 	update_comment_cache($comments);
@@ -725,30 +1944,28 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
 	return array($comments, $total);
 }
 
-function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true ) {
-	global $comment, $post;
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $comment_id
+ * @param unknown_type $mode
+ * @param unknown_type $comment_status
+ * @param unknown_type $checkbox
+ */
+function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
+	global $comment, $post, $_comment_pending_count;
 	$comment = get_comment( $comment_id );
 	$post = get_post($comment-&gt;comment_post_ID);
-	$authordata = get_userdata($post-&gt;post_author);
 	$the_comment_status = wp_get_comment_status($comment-&gt;comment_ID);
-	$class = ('unapproved' == $the_comment_status) ? 'unapproved' : '';
-
-	if ( current_user_can( 'edit_post', $post-&gt;ID ) ) {
-		$post_link = &quot;&lt;a href='&quot; . get_comment_link() . &quot;'&gt;&quot;;
 
-		$post_link .= get_the_title($comment-&gt;comment_post_ID) . '&lt;/a&gt;';
-			
-		$edit_link_start = &quot;&lt;a class='row-title' href='comment.php?action=editcomment&amp;amp;c={$comment-&gt;comment_ID}' title='&quot; . __('Edit comment') . &quot;'&gt;&quot;;
-		$edit_link_end = '&lt;/a&gt;';
-	} else {
-		$post_link = get_the_title($comment-&gt;comment_post_ID);
-		$edit_link_start = $edit_link_end ='';
-	}
-	
 	$author_url = get_comment_author_url();
 	if ( 'http://' == $author_url )
 		$author_url = '';
 	$author_url_display = $author_url;
+	$author_url_display = str_replace('http://www.', '', $author_url_display);
+	$author_url_display = str_replace('http://', '', $author_url_display);
 	if ( strlen($author_url_display) &gt; 50 )
 		$author_url_display = substr($author_url_display, 0, 49) . '...';
 
@@ -758,62 +1975,235 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
 	else
 		$ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment-&gt;comment_date );
 
-	$delete_url    = clean_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
-	$approve_url   = clean_url( wp_nonce_url( &quot;comment.php?action=approvecomment&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;approve-comment_$comment-&gt;comment_ID&quot; ) );
-	$unapprove_url = clean_url( wp_nonce_url( &quot;comment.php?action=unapprovecomment&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;unapprove-comment_$comment-&gt;comment_ID&quot; ) );
-	$spam_url      = clean_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;dt=spam&amp;p=$comment-&gt;comment_post_ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
+	$delete_url = clean_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
+	$approve_url = clean_url( wp_nonce_url( &quot;comment.php?action=approvecomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;approve-comment_$comment-&gt;comment_ID&quot; ) );
+	$unapprove_url = clean_url( wp_nonce_url( &quot;comment.php?action=unapprovecomment&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;unapprove-comment_$comment-&gt;comment_ID&quot; ) );
+	$spam_url = clean_url( wp_nonce_url( &quot;comment.php?action=deletecomment&amp;dt=spam&amp;p=$post-&gt;ID&amp;c=$comment-&gt;comment_ID&quot;, &quot;delete-comment_$comment-&gt;comment_ID&quot; ) );
 
-?&gt;
-  &lt;tr id=&quot;comment-&lt;?php echo $comment-&gt;comment_ID; ?&gt;&quot; class='&lt;?php echo $class; ?&gt;'&gt;
-&lt;?php if ( $checkbox ) : ?&gt;
-    &lt;td class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can('edit_post', $comment-&gt;comment_post_ID) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;delete_comments[]&quot; value=&quot;&lt;?php echo $comment-&gt;comment_ID; ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/td&gt;
-&lt;?php endif; ?&gt;
-    &lt;td class=&quot;comment&quot;&gt;
-    &lt;p class=&quot;comment-author&quot;&gt;&lt;strong&gt;&lt;?php echo $edit_link_start; comment_author(); echo $edit_link_end; ?&gt;&lt;/strong&gt;&lt;br /&gt;
-    &lt;?php if ( !empty($author_url) ) : ?&gt;
-    &lt;a href=&quot;&lt;?php echo $author_url ?&gt;&quot;&gt;&lt;?php echo $author_url_display; ?&gt;&lt;/a&gt; |
-    &lt;?php endif; ?&gt;
-    &lt;?php if ( current_user_can( 'edit_post', $post-&gt;ID ) ) : ?&gt;
-    &lt;?php if ( !empty($comment-&gt;comment_author_email) ): ?&gt;
-    &lt;?php comment_author_email_link() ?&gt; |
-    &lt;?php endif; ?&gt;
-    &lt;a href=&quot;edit-comments.php?s=&lt;?php comment_author_IP() ?&gt;&amp;amp;mode=detail&quot;&gt;&lt;?php comment_author_IP() ?&gt;&lt;/a&gt;
-	&lt;?php endif; //current_user_can?&gt;    
-    &lt;/p&gt;
-   	&lt;?php if ( 'detail' == $mode ) comment_text(); ?&gt;
-   	&lt;p&gt;&lt;?php printf(__('From %1$s, %2$s'), $post_link, $ptime) ?&gt;&lt;/p&gt;
-    &lt;/td&gt;
-    &lt;td&gt;&lt;?php comment_date(__('Y/m/d')); ?&gt;&lt;/td&gt;
-    &lt;td class=&quot;action-links&quot;&gt;
-&lt;?php
+	echo &quot;&lt;tr id='comment-$comment-&gt;comment_ID' class='$the_comment_status'&gt;&quot;;
+	$columns = get_column_headers('edit-comments');
+	$hidden = get_hidden_columns('edit-comments');
+	foreach ( $columns as $column_name =&gt; $column_display_name ) {
+		$class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
+
+		$style = '';
+		if ( in_array($column_name, $hidden) )
+			$style = ' style=&quot;display:none;&quot;';
 
-	$actions = array();
+		$attributes = &quot;$class$style&quot;;
 
-	if ( current_user_can('edit_post', $comment-&gt;comment_post_ID) ) {
-		$actions['approve']   = &quot;&lt;a href='$approve_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='&quot; . __( 'Approve this comment' ) . &quot;'&gt;&quot; . __( 'Approve' ) . '&lt;/a&gt; | ';
-		$actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='&quot; . __( 'Unapprove this comment' ) . &quot;'&gt;&quot; . __( 'Unapprove' ) . '&lt;/a&gt; | ';
+		switch ($column_name) {
+			case 'cb':
+				if ( !$checkbox ) break;
+				echo '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;';
+				if ( current_user_can('edit_post', $post-&gt;ID) ) echo &quot;&lt;input type='checkbox' name='delete_comments[]' value='$comment-&gt;comment_ID' /&gt;&quot;;
+				echo '&lt;/th&gt;';
+				break;
+			case 'comment':
+				echo &quot;&lt;td $attributes&gt;&quot;;
+				echo '&lt;div id=&quot;submitted-on&quot;&gt;';
+				printf(__('Submitted on &lt;a href=&quot;%1$s&quot;&gt;%2$s at %3$s&lt;/a&gt;'), get_comment_link($comment-&gt;comment_ID), get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia')));
+				echo '&lt;/div&gt;';
+				comment_text(); ?&gt;
+				&lt;div id=&quot;inline-&lt;?php echo $comment-&gt;comment_ID; ?&gt;&quot; class=&quot;hidden&quot;&gt;
+				&lt;textarea class=&quot;comment&quot; rows=&quot;3&quot; cols=&quot;10&quot;&gt;&lt;?php echo $comment-&gt;comment_content; ?&gt;&lt;/textarea&gt;
+				&lt;div class=&quot;author-email&quot;&gt;&lt;?php echo attribute_escape( $comment-&gt;comment_author_email ); ?&gt;&lt;/div&gt;
+				&lt;div class=&quot;author&quot;&gt;&lt;?php echo attribute_escape( $comment-&gt;comment_author ); ?&gt;&lt;/div&gt;
+				&lt;div class=&quot;author-url&quot;&gt;&lt;?php echo attribute_escape( $comment-&gt;comment_author_url ); ?&gt;&lt;/div&gt;
+				&lt;div class=&quot;comment_status&quot;&gt;&lt;?php echo $comment-&gt;comment_approved; ?&gt;&lt;/div&gt;
+				&lt;/div&gt;
+				&lt;?php
+				$actions = array();
+
+				if ( current_user_can('edit_post', $post-&gt;ID) ) {
+					$actions['approve'] = &quot;&lt;a href='$approve_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='&quot; . __( 'Approve this comment' ) . &quot;'&gt;&quot; . __( 'Approve' ) . '&lt;/a&gt;';
+					$actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='dim:the-comment-list:comment-$comment-&gt;comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='&quot; . __( 'Unapprove this comment' ) . &quot;'&gt;&quot; . __( 'Unapprove' ) . '&lt;/a&gt;';
+					if ( $comment_status ) { // not looking at all comments
+						if ( 'approved' == $the_comment_status ) {
+							$actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID:e7e7d3:action=dim-comment&amp;amp;new=unapproved vim-u vim-destructive' title='&quot; . __( 'Unapprove this comment' ) . &quot;'&gt;&quot; . __( 'Unapprove' ) . '&lt;/a&gt;';
+							unset($actions['approve']);
+						} else {
+							$actions['approve'] = &quot;&lt;a href='$approve_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID:e7e7d3:action=dim-comment&amp;amp;new=approved vim-a vim-destructive' title='&quot; . __( 'Approve this comment' ) . &quot;'&gt;&quot; . __( 'Approve' ) . '&lt;/a&gt;';
+							unset($actions['unapprove']);
+						}
+					}
+					if ( 'spam' != $the_comment_status )
+						$actions['spam'] = &quot;&lt;a href='$spam_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::spam=1 vim-s vim-destructive' title='&quot; . __( 'Mark this comment as spam' ) . &quot;'&gt;&quot; . _c( 'Spam|verb' ) . '&lt;/a&gt;';
+					$actions['delete'] = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete vim-d vim-destructive'&gt;&quot; . __('Delete') . '&lt;/a&gt;';
+					$actions['edit'] = &quot;&lt;a href='comment.php?action=editcomment&amp;amp;c={$comment-&gt;comment_ID}' title='&quot; . __('Edit comment') . &quot;'&gt;&quot;. __('Edit') . '&lt;/a&gt;';
+					$actions['quickedit'] = '&lt;a onclick=&quot;commentReply.open(\''.$comment-&gt;comment_ID.'\',\''.$post-&gt;ID.'\',\'edit\');return false;&quot; class=&quot;vim-q&quot; title=&quot;'.__('Quick Edit').'&quot; href=&quot;#&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
+					if ( 'spam' != $the_comment_status )
+						$actions['reply'] = '&lt;a onclick=&quot;commentReply.open(\''.$comment-&gt;comment_ID.'\',\''.$post-&gt;ID.'\');return false;&quot; class=&quot;vim-r&quot; title=&quot;'.__('Reply to this comment').'&quot; href=&quot;#&quot;&gt;' . __('Reply') . '&lt;/a&gt;';
+
+					$actions = apply_filters( 'comment_row_actions', $actions, $comment );
+
+					$i = 0;
+					echo '&lt;div class=&quot;row-actions&quot;&gt;';
+					foreach ( $actions as $action =&gt; $link ) {
+						++$i;
+						( ( ('approve' == $action || 'unapprove' == $action) &amp;&amp; 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
+
+						// Reply and quickedit need a hide-if-no-js span when not added with ajax
+						if ( ('reply' == $action || 'quickedit' == $action) &amp;&amp; ! $from_ajax )
+							$action .= ' hide-if-no-js';
+
+						echo &quot;&lt;span class='$action'&gt;$sep$link&lt;/span&gt;&quot;;
+					}
+					echo '&lt;/div&gt;';
+				}
 
-		// we're looking at list of only approved or only unapproved comments
-		if ( 'moderated' == $comment_status ) {
-			$actions['approve'] = &quot;&lt;a href='$approve_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID:e7e7d3:action=dim-comment&amp;new=approved' title='&quot; . __( 'Approve this comment' ) . &quot;'&gt;&quot; . __( 'Approve' ) . '&lt;/a&gt; | ';
-			unset($actions['unapprove']);
-		} elseif ( 'approved' == $comment_status ) {
-			$actions['unapprove'] = &quot;&lt;a href='$unapprove_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved' title='&quot; . __( 'Unapprove this comment' ) . &quot;'&gt;&quot; . __( 'Unapprove' ) . '&lt;/a&gt; | ';
-			unset($actions['approve']);
+				echo '&lt;/td&gt;';
+				break;
+			case 'author':
+				echo &quot;&lt;td $attributes&gt;&lt;strong&gt;&quot;; comment_author(); echo '&lt;/strong&gt;&lt;br /&gt;';
+				if ( !empty($author_url) )
+					echo &quot;&lt;a title='$author_url' href='$author_url'&gt;$author_url_display&lt;/a&gt;&lt;br /&gt;&quot;;
+				if ( current_user_can( 'edit_post', $post-&gt;ID ) ) {
+					if ( !empty($comment-&gt;comment_author_email) ) {
+						comment_author_email_link();
+						echo '&lt;br /&gt;';
+					}
+					echo '&lt;a href=&quot;edit-comments.php?s=';
+					comment_author_IP();
+					echo '&amp;amp;mode=detail';
+					if ( 'spam' == $comment_status )
+						echo '&amp;amp;comment_status=spam';
+					echo '&quot;&gt;';
+					comment_author_IP();
+					echo '&lt;/a&gt;';
+				} //current_user_can
+				echo '&lt;/td&gt;';
+				break;
+			case 'date':
+				echo &quot;&lt;td $attributes&gt;&quot; . get_comment_date(__('Y/m/d \a\t g:ia')) . '&lt;/td&gt;';
+				break;
+			case 'response':
+				if ( 'single' !== $mode ) {
+					if ( isset( $_comment_pending_count[$post-&gt;ID] ) ) {
+						$pending_comments = absint( $_comment_pending_count[$post-&gt;ID] );
+					} else {
+						$_comment_pending_count_temp = (array) get_pending_comments_num( array( $post-&gt;ID ) );
+						$pending_comments = $_comment_pending_count[$post-&gt;ID] = $_comment_pending_count_temp[$post-&gt;ID];
+					}
+					if ( current_user_can( 'edit_post', $post-&gt;ID ) ) {
+						$post_link = &quot;&lt;a href='&quot; . get_edit_post_link($post-&gt;ID) . &quot;'&gt;&quot;;
+						$post_link .= get_the_title($post-&gt;ID) . '&lt;/a&gt;';
+					} else {
+						$post_link = get_the_title($post-&gt;ID);
+					}
+					echo &quot;&lt;td $attributes&gt;\n&quot;;
+					echo $post_link;
+
+					echo '&lt;div class=&quot;response-links&quot;&gt;&lt;span class=&quot;post-com-count-wrapper&quot;&gt;';
+					$pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) );
+					if ( $pending_comments )
+						echo '&lt;strong&gt;';
+					comments_number(&quot;&lt;a href='edit-comments.php?p=$post-&gt;ID' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('0') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$post-&gt;ID' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('1') . '&lt;/span&gt;&lt;/a&gt;', &quot;&lt;a href='edit-comments.php?p=$post-&gt;ID' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;&quot; . __('%') . '&lt;/span&gt;&lt;/a&gt;');
+					if ( $pending_comments )
+						echo '&lt;/strong&gt;';
+					echo '&lt;/span&gt; ';
+					echo &quot;&lt;a href='&quot; . get_permalink( $post-&gt;ID ) . &quot;'&gt;#&lt;/a&gt;&quot;;
+					echo '&lt;/div&gt;&lt;/td&gt;';
+				}
 		}
+	}
+	echo &quot;&lt;/tr&gt;\n&quot;;
+}
 
-		$actions['spam']      = &quot;&lt;a href='$spam_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID::spam=1' title='&quot; . __( 'Mark this comment as spam' ) . &quot;'&gt;&quot; . __( 'Spam' ) . '&lt;/a&gt; | ';
-		$actions['delete']    = &quot;&lt;a href='$delete_url' class='delete:the-comment-list:comment-$comment-&gt;comment_ID delete'&gt;&quot; . __('Delete') . '&lt;/a&gt;';
-		$actions = apply_filters( 'comment_row_actions', $actions, $comment );
-		foreach ( $actions as $action =&gt; $link )
-			echo &quot;&lt;span class='$action'&gt;$link&lt;/span&gt;&quot;;
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $position
+ * @param unknown_type $checkbox
+ * @param unknown_type $mode
+ */
+function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) {
+	global $current_user;
+
+	// allow plugin to replace the popup content
+	$content = apply_filters( 'wp_comment_reply', '', array('position' =&gt; $position, 'checkbox' =&gt; $checkbox, 'mode' =&gt; $mode) );
+
+	if ( ! empty($content) ) {
+		echo $content;
+		return;
 	}
-	?&gt;
-	&lt;/td&gt;
-  &lt;/tr&gt;
-	&lt;?php
+
+	$columns = get_column_headers('edit-comments');
+	$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns('edit-comments') ) );
+	$col_count = count($columns) - count($hidden);
+
+?&gt;
+&lt;form method=&quot;get&quot; action=&quot;&quot;&gt;
+&lt;?php if ( $table_row ) : ?&gt;
+&lt;table style=&quot;display:none;&quot;&gt;&lt;tbody id=&quot;com-reply&quot;&gt;&lt;tr id=&quot;replyrow&quot;&gt;&lt;td colspan=&quot;&lt;?php echo $col_count; ?&gt;&quot;&gt;
+&lt;?php else : ?&gt;
+&lt;div id=&quot;com-reply&quot; style=&quot;display:none;&quot;&gt;&lt;div id=&quot;replyrow&quot;&gt;
+&lt;?php endif; ?&gt;
+	&lt;div id=&quot;replyhead&quot; style=&quot;display:none;&quot;&gt;&lt;?php _e('Reply to Comment'); ?&gt;&lt;/div&gt;
+
+	&lt;div id=&quot;edithead&quot; style=&quot;display:none;&quot;&gt;
+		&lt;div class=&quot;inside&quot;&gt;
+		&lt;label for=&quot;author&quot;&gt;&lt;?php _e('Name') ?&gt;&lt;/label&gt;
+		&lt;input type=&quot;text&quot; name=&quot;newcomment_author&quot; size=&quot;50&quot; value=&quot;&quot; tabindex=&quot;101&quot; id=&quot;author&quot; /&gt;
+		&lt;/div&gt;
+
+		&lt;div class=&quot;inside&quot;&gt;
+		&lt;label for=&quot;author-email&quot;&gt;&lt;?php _e('E-mail') ?&gt;&lt;/label&gt;
+		&lt;input type=&quot;text&quot; name=&quot;newcomment_author_email&quot; size=&quot;50&quot; value=&quot;&quot; tabindex=&quot;102&quot; id=&quot;author-email&quot; /&gt;
+		&lt;/div&gt;
+
+		&lt;div class=&quot;inside&quot;&gt;
+		&lt;label for=&quot;author-url&quot;&gt;&lt;?php _e('URL') ?&gt;&lt;/label&gt;
+		&lt;input type=&quot;text&quot; id=&quot;author-url&quot; name=&quot;newcomment_author_url&quot; size=&quot;103&quot; value=&quot;&quot; tabindex=&quot;103&quot; /&gt;
+		&lt;/div&gt;
+		&lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
+	&lt;/div&gt;
+
+	&lt;div id=&quot;replycontainer&quot;&gt;&lt;textarea rows=&quot;8&quot; cols=&quot;40&quot; name=&quot;replycontent&quot; tabindex=&quot;104&quot; id=&quot;replycontent&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;
+
+	&lt;p id=&quot;replysubmit&quot; class=&quot;submit&quot;&gt;
+	&lt;a href=&quot;#comments-form&quot; class=&quot;cancel button-secondary alignleft&quot; tabindex=&quot;106&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+	&lt;a href=&quot;#comments-form&quot; class=&quot;save button-primary alignright&quot; tabindex=&quot;104&quot;&gt;
+	&lt;span id=&quot;savebtn&quot; style=&quot;display:none;&quot;&gt;&lt;?php _e('Update Comment'); ?&gt;&lt;/span&gt;
+	&lt;span id=&quot;replybtn&quot; style=&quot;display:none;&quot;&gt;&lt;?php _e('Submit Reply'); ?&gt;&lt;/span&gt;&lt;/a&gt;
+	&lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;images/loading.gif&quot; alt=&quot;&quot; /&gt;
+	&lt;span class=&quot;error&quot; style=&quot;display:none;&quot;&gt;&lt;/span&gt;
+	&lt;br class=&quot;clear&quot; /&gt;
+	&lt;/p&gt;
+
+	&lt;input type=&quot;hidden&quot; name=&quot;user_ID&quot; id=&quot;user_ID&quot; value=&quot;&lt;?php echo $current_user-&gt;ID; ?&gt;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;action&quot; id=&quot;action&quot; value=&quot;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;comment_ID&quot; id=&quot;comment_ID&quot; value=&quot;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;comment_post_ID&quot; id=&quot;comment_post_ID&quot; value=&quot;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;position&quot; id=&quot;position&quot; value=&quot;&lt;?php echo $position; ?&gt;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;checkbox&quot; id=&quot;checkbox&quot; value=&quot;&lt;?php echo $checkbox ? 1 : 0; ?&gt;&quot; /&gt;
+	&lt;input type=&quot;hidden&quot; name=&quot;mode&quot; id=&quot;mode&quot; value=&quot;&lt;?php echo $mode; ?&gt;&quot; /&gt;
+	&lt;?php wp_nonce_field( 'replyto-comment', '_ajax_nonce', false ); ?&gt;
+	&lt;?php wp_comment_form_unfiltered_html_nonce(); ?&gt;
+&lt;?php if ( $table_row ) : ?&gt;
+&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
+&lt;?php else : ?&gt;
+&lt;/div&gt;&lt;/div&gt;
+&lt;?php endif; ?&gt;
+&lt;/form&gt;
+&lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $currentcat
+ * @param unknown_type $currentparent
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $categories
+ * @return unknown
+ */
 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
 	if (!$categories )
 		$categories = get_categories( array('hide_empty' =&gt; 0) );
@@ -835,28 +2225,58 @@ function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $le
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $meta
+ */
 function list_meta( $meta ) {
 	// Exit if no meta
-	if (!$meta ) {
-		echo '&lt;tbody id=&quot;the-list&quot; class=&quot;list:meta&quot;&gt;&lt;tr style=&quot;display: none;&quot;&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;'; //TBODY needed for list-manipulation JS
+	if ( ! $meta ) {
+		echo '
+&lt;table id=&quot;list-table&quot; style=&quot;display: none;&quot;&gt;
+	&lt;thead&gt;
+	&lt;tr&gt;
+		&lt;th class=&quot;left&quot;&gt;' . __( 'Name' ) . '&lt;/th&gt;
+		&lt;th&gt;' . __( 'Value' ) . '&lt;/th&gt;
+	&lt;/tr&gt;
+	&lt;/thead&gt;
+	&lt;tbody id=&quot;the-list&quot; class=&quot;list:meta&quot;&gt;
+	&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
+	&lt;/tbody&gt;
+&lt;/table&gt;'; //TBODY needed for list-manipulation JS
 		return;
 	}
 	$count = 0;
 ?&gt;
+&lt;table id=&quot;list-table&quot;&gt;
 	&lt;thead&gt;
 	&lt;tr&gt;
-		&lt;th&gt;&lt;?php _e( 'Key' ) ?&gt;&lt;/th&gt;
+		&lt;th class=&quot;left&quot;&gt;&lt;?php _e( 'Name' ) ?&gt;&lt;/th&gt;
 		&lt;th&gt;&lt;?php _e( 'Value' ) ?&gt;&lt;/th&gt;
-		&lt;th colspan='2'&gt;&lt;?php _e( 'Action' ) ?&gt;&lt;/th&gt;
 	&lt;/tr&gt;
 	&lt;/thead&gt;
 	&lt;tbody id='the-list' class='list:meta'&gt;
 &lt;?php
 	foreach ( $meta as $entry )
 		echo _list_meta_row( $entry, $count );
-	echo &quot;\n\t&lt;/tbody&gt;&quot;;
+?&gt;
+	&lt;/tbody&gt;
+&lt;/table&gt;
+&lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $entry
+ * @param unknown_type $count
+ * @return unknown
+ */
 function _list_meta_row( $entry, &amp;$count ) {
 	static $update_nonce = false;
 	if ( !$update_nonce )
@@ -882,23 +2302,30 @@ function _list_meta_row( $entry, &amp;$count ) {
 		}
 	}
 
-	$entry['meta_key']   = attribute_escape($entry['meta_key']);
+	$entry['meta_key'] = attribute_escape($entry['meta_key']);
 	$entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a &lt;textarea /&gt;
 	$entry['meta_id'] = (int) $entry['meta_id'];
 
 	$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
 
 	$r .= &quot;\n\t&lt;tr id='meta-{$entry['meta_id']}' class='$style'&gt;&quot;;
-	$r .= &quot;\n\t\t&lt;td valign='top'&gt;&lt;label class='hidden' for='meta[{$entry['meta_id']}][key]'&gt;&quot; . __( 'Key' ) . &quot;&lt;/label&gt;&lt;input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /&gt;&lt;/td&gt;&quot;;
-	$r .= &quot;\n\t\t&lt;td&gt;&lt;label class='hidden' for='meta[{$entry['meta_id']}][value]'&gt;&quot; . __( 'Value' ) . &quot;&lt;/label&gt;&lt;textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'&gt;{$entry['meta_value']}&lt;/textarea&gt;&lt;/td&gt;&quot;;
-	$r .= &quot;\n\t\t&lt;td style='text-align: center;'&gt;&lt;input name='updatemeta' type='submit' tabindex='6' value='&quot;.attribute_escape(__( 'Update' )).&quot;' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /&gt;&lt;br /&gt;&quot;;
-	$r .= &quot;\n\t\t&lt;input name='deletemeta[{$entry['meta_id']}]' type='submit' &quot;;
+	$r .= &quot;\n\t\t&lt;td class='left'&gt;&lt;label class='hidden' for='meta[{$entry['meta_id']}][key]'&gt;&quot; . __( 'Key' ) . &quot;&lt;/label&gt;&lt;input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /&gt;&quot;;
+
+	$r .= &quot;\n\t\t&lt;div class='submit'&gt;&lt;input name='deletemeta[{$entry['meta_id']}]' type='submit' &quot;;
 	$r .= &quot;class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='&quot;.attribute_escape(__( 'Delete' )).&quot;' /&gt;&quot;;
+	$r .= &quot;\n\t\t&lt;input name='updatemeta' type='submit' tabindex='6' value='&quot;.attribute_escape(__( 'Update' )).&quot;' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /&gt;&lt;/div&gt;&quot;;
 	$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
-	$r .= &quot;&lt;/td&gt;\n\t&lt;/tr&gt;&quot;;
+	$r .= &quot;&lt;/td&gt;&quot;;
+
+	$r .= &quot;\n\t\t&lt;td&gt;&lt;label class='hidden' for='meta[{$entry['meta_id']}][value]'&gt;&quot; . __( 'Value' ) . &quot;&lt;/label&gt;&lt;textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'&gt;{$entry['meta_value']}&lt;/textarea&gt;&lt;/td&gt;\n\t&lt;/tr&gt;&quot;;
 	return $r;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function meta_form() {
 	global $wpdb;
 	$limit = (int) apply_filters( 'postmeta_form_limit', 30 );
@@ -912,40 +2339,61 @@ function meta_form() {
 	if ( $keys )
 		natcasesort($keys);
 ?&gt;
-&lt;p&gt;&lt;strong&gt;&lt;?php _e( 'Add a new custom field:' ) ?&gt;&lt;/strong&gt;&lt;/p&gt;
-&lt;table id=&quot;newmeta&quot; cellspacing=&quot;3&quot; cellpadding=&quot;3&quot;&gt;
-	&lt;tr&gt;
-&lt;th colspan=&quot;2&quot;&gt;&lt;label &lt;?php if ( $keys ) : ?&gt; for=&quot;metakeyselect&quot; &lt;?php else : ?&gt; for=&quot;metakeyinput&quot; &lt;?php endif; ?&gt;&gt;&lt;?php _e( 'Key' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+&lt;p&gt;&lt;strong&gt;&lt;?php _e( 'Add new custom field:' ) ?&gt;&lt;/strong&gt;&lt;/p&gt;
+&lt;table id=&quot;newmeta&quot;&gt;
+&lt;thead&gt;
+&lt;tr&gt;
+&lt;th class=&quot;left&quot;&gt;&lt;label for=&quot;metakeyselect&quot;&gt;&lt;?php _e( 'Name' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
 &lt;th&gt;&lt;label for=&quot;metavalue&quot;&gt;&lt;?php _e( 'Value' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
 &lt;/tr&gt;
-	&lt;tr valign=&quot;top&quot;&gt;
-		&lt;td style=&quot;width: 18%;&quot; class=&quot;textright&quot;&gt;
-&lt;?php if ( $keys ) : ?&gt;
+&lt;/thead&gt;
+
+&lt;tbody&gt;
+&lt;tr&gt;
+&lt;td id=&quot;newmetaleft&quot; class=&quot;left&quot;&gt;
+&lt;?php if ( $keys ) { ?&gt;
 &lt;select id=&quot;metakeyselect&quot; name=&quot;metakeyselect&quot; tabindex=&quot;7&quot;&gt;
 &lt;option value=&quot;#NONE#&quot;&gt;&lt;?php _e( '- Select -' ); ?&gt;&lt;/option&gt;
 &lt;?php
 
 	foreach ( $keys as $key ) {
 		$key = attribute_escape( $key );
-		echo &quot;\n\t&lt;option value='$key'&gt;$key&lt;/option&gt;&quot;;
+		echo &quot;\n&lt;option value='$key'&gt;$key&lt;/option&gt;&quot;;
 	}
 ?&gt;
-&lt;/select&gt; &lt;label for=&quot;metakeyinput&quot;&gt;&lt;?php _e( 'or' ); ?&gt;&lt;/label&gt;
-&lt;?php endif; ?&gt;
+&lt;/select&gt;
+&lt;input class=&quot;hide-if-js&quot; type=&quot;text&quot; id=&quot;metakeyinput&quot; name=&quot;metakeyinput&quot; tabindex=&quot;7&quot; value=&quot;&quot; /&gt;
+&lt;a href=&quot;#postcustomstuff&quot; class=&quot;hide-if-no-js&quot; onclick=&quot;jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;&quot;&gt;
+&lt;span id=&quot;enternew&quot;&gt;&lt;?php _e('Enter new'); ?&gt;&lt;/span&gt;
+&lt;span id=&quot;cancelnew&quot; class=&quot;hidden&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/span&gt;&lt;/a&gt;
+&lt;?php } else { ?&gt;
+&lt;input type=&quot;text&quot; id=&quot;metakeyinput&quot; name=&quot;metakeyinput&quot; tabindex=&quot;7&quot; value=&quot;&quot; /&gt;
+&lt;?php } ?&gt;
 &lt;/td&gt;
-&lt;td&gt;&lt;input type=&quot;text&quot; id=&quot;metakeyinput&quot; name=&quot;metakeyinput&quot; tabindex=&quot;7&quot; /&gt;&lt;/td&gt;
-		&lt;td&gt;&lt;textarea id=&quot;metavalue&quot; name=&quot;metavalue&quot; rows=&quot;3&quot; cols=&quot;25&quot; tabindex=&quot;8&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;
-	&lt;/tr&gt;
-&lt;tr class=&quot;submit&quot;&gt;&lt;td colspan=&quot;3&quot;&gt;
-	&lt;?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?&gt;
-	&lt;input type=&quot;submit&quot; id=&quot;addmetasub&quot; name=&quot;addmeta&quot; class=&quot;add:the-list:newmeta&quot; tabindex=&quot;9&quot; value=&quot;&lt;?php _e( 'Add Custom Field' ) ?&gt;&quot; /&gt;
+&lt;td&gt;&lt;textarea id=&quot;metavalue&quot; name=&quot;metavalue&quot; rows=&quot;2&quot; cols=&quot;25&quot; tabindex=&quot;8&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;
+&lt;/tr&gt;
+
+&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;submit&quot;&gt;
+&lt;input type=&quot;submit&quot; id=&quot;addmetasub&quot; name=&quot;addmeta&quot; class=&quot;add:the-list:newmeta&quot; tabindex=&quot;9&quot; value=&quot;&lt;?php _e( 'Add Custom Field' ) ?&gt;&quot; /&gt;
+&lt;?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?&gt;
 &lt;/td&gt;&lt;/tr&gt;
+&lt;/tbody&gt;
 &lt;/table&gt;
 &lt;?php
 
 }
 
-function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $edit
+ * @param unknown_type $for_post
+ * @param unknown_type $tab_index
+ * @param unknown_type $multi
+ */
+function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
 	global $wp_locale, $post, $comment;
 
 	if ( $for_post )
@@ -966,29 +2414,55 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
 	$mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );
 	$ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );
 
-	$month = &quot;&lt;select id=\&quot;mm\&quot; name=\&quot;mm\&quot;$tab_index_attribute&gt;\n&quot;;
+	$cur_jj = gmdate( 'd', $time_adj );
+	$cur_mm = gmdate( 'm', $time_adj );
+	$cur_aa = gmdate( 'Y', $time_adj );
+	$cur_hh = gmdate( 'H', $time_adj );
+	$cur_mn = gmdate( 'i', $time_adj );
+
+	$month = &quot;&lt;select &quot; . ( $multi ? '' : 'id=&quot;mm&quot; ' ) . &quot;name=\&quot;mm\&quot;$tab_index_attribute&gt;\n&quot;;
 	for ( $i = 1; $i &lt; 13; $i = $i +1 ) {
 		$month .= &quot;\t\t\t&quot; . '&lt;option value=&quot;' . zeroise($i, 2) . '&quot;';
 		if ( $i == $mm )
 			$month .= ' selected=&quot;selected&quot;';
-		$month .= '&gt;' . $wp_locale-&gt;get_month( $i ) . &quot;&lt;/option&gt;\n&quot;;
+		$month .= '&gt;' . $wp_locale-&gt;get_month_abbrev( $wp_locale-&gt;get_month( $i ) ) . &quot;&lt;/option&gt;\n&quot;;
 	}
 	$month .= '&lt;/select&gt;';
 
-	$day = '&lt;input type=&quot;text&quot; id=&quot;jj&quot; name=&quot;jj&quot; value=&quot;' . $jj . '&quot; size=&quot;2&quot; maxlength=&quot;2&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot;  /&gt;';
-	$year = '&lt;input type=&quot;text&quot; id=&quot;aa&quot; name=&quot;aa&quot; value=&quot;' . $aa . '&quot; size=&quot;4&quot; maxlength=&quot;5&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot;  /&gt;';
-	$hour = '&lt;input type=&quot;text&quot; id=&quot;hh&quot; name=&quot;hh&quot; value=&quot;' . $hh . '&quot; size=&quot;2&quot; maxlength=&quot;2&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot;  /&gt;';
-	$minute = '&lt;input type=&quot;text&quot; id=&quot;mn&quot; name=&quot;mn&quot; value=&quot;' . $mn . '&quot; size=&quot;2&quot; maxlength=&quot;2&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot;  /&gt;';
-	printf(_c('%1$s%2$s, %3$s &lt;br /&gt;@ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);
+	$day = '&lt;input type=&quot;text&quot; ' . ( $multi ? '' : 'id=&quot;jj&quot; ' ) . 'name=&quot;jj&quot; value=&quot;' . $jj . '&quot; size=&quot;2&quot; maxlength=&quot;2&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot; /&gt;';
+	$year = '&lt;input type=&quot;text&quot; ' . ( $multi ? '' : 'id=&quot;aa&quot; ' ) . 'name=&quot;aa&quot; value=&quot;' . $aa . '&quot; size=&quot;4&quot; maxlength=&quot;5&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot; /&gt;';
+	$hour = '&lt;input type=&quot;text&quot; ' . ( $multi ? '' : 'id=&quot;hh&quot; ' ) . 'name=&quot;hh&quot; value=&quot;' . $hh . '&quot; size=&quot;2&quot; maxlength=&quot;2&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot; /&gt;';
+	$minute = '&lt;input type=&quot;text&quot; ' . ( $multi ? '' : 'id=&quot;mn&quot; ' ) . 'name=&quot;mn&quot; value=&quot;' . $mn . '&quot; size=&quot;2&quot; maxlength=&quot;2&quot;' . $tab_index_attribute . ' autocomplete=&quot;off&quot; /&gt;';
+	printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);
+
+	echo '&lt;input type=&quot;hidden&quot; id=&quot;ss&quot; name=&quot;ss&quot; value=&quot;' . $ss . '&quot; /&gt;';
+
+	if ( $multi ) return;
+
 	echo &quot;\n\n&quot;;
-	foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit )
+	foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) {
 		echo '&lt;input type=&quot;hidden&quot; id=&quot;hidden_' . $timeunit . '&quot; name=&quot;hidden_' . $timeunit . '&quot; value=&quot;' . $$timeunit . '&quot; /&gt;' . &quot;\n&quot;;
+		$cur_timeunit = 'cur_' . $timeunit;
+		echo '&lt;input type=&quot;hidden&quot; id=&quot;'. $cur_timeunit . '&quot; name=&quot;'. $cur_timeunit . '&quot; value=&quot;' . $$cur_timeunit . '&quot; /&gt;' . &quot;\n&quot;;
+	}
 ?&gt;
 
 &lt;input type=&quot;hidden&quot; id=&quot;ss&quot; name=&quot;ss&quot; value=&quot;&lt;?php echo $ss ?&gt;&quot; size=&quot;2&quot; maxlength=&quot;2&quot; /&gt;
+
+&lt;p&gt;
+&lt;a href=&quot;#edit_timestamp&quot; class=&quot;save-timestamp hide-if-no-js button&quot;&gt;&lt;?php _e('OK'); ?&gt;&lt;/a&gt;
+&lt;a href=&quot;#edit_timestamp&quot; class=&quot;cancel-timestamp hide-if-no-js&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+&lt;/p&gt;
 &lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $default
+ */
 function page_template_dropdown( $default = '' ) {
 	$templates = get_page_templates();
 	ksort( $templates );
@@ -1001,6 +2475,16 @@ function page_template_dropdown( $default = '' ) {
 	endforeach;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $default
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @return unknown
+ */
 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
 	global $wpdb, $post_ID;
 	$items = $wpdb-&gt;get_results( $wpdb-&gt;prepare(&quot;SELECT ID, post_parent, post_title FROM $wpdb-&gt;posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order&quot;, $parent) );
@@ -1019,7 +2503,7 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
 			else
 				$current = '';
 
-			echo &quot;\n\t&lt;option value='$item-&gt;ID'$current&gt;$pad &quot; . wp_specialchars($item-&gt;post_title) . &quot;&lt;/option&gt;&quot;;
+			echo &quot;\n\t&lt;option class='level-$level' value='$item-&gt;ID'$current&gt;$pad &quot; . wp_specialchars($item-&gt;post_title) . &quot;&lt;/option&gt;&quot;;
 			parent_dropdown( $default, $item-&gt;ID, $level +1 );
 		}
 	} else {
@@ -1027,16 +2511,26 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function browse_happy() {
 	$getit = __( 'WordPress recommends a better browser' );
 	echo '
-		&lt;span id=&quot;bh&quot; class=&quot;alignright&quot;&gt;&lt;a href=&quot;http://browsehappy.com/&quot; title=&quot;'.$getit.'&quot;&gt;&lt;img src=&quot;images/browse-happy.gif&quot; alt=&quot;Browse Happy&quot; /&gt;&lt;/a&gt;&lt;/span&gt;
-		';
+		&lt;div id=&quot;bh&quot;&gt;&lt;a href=&quot;http://browsehappy.com/&quot; title=&quot;'.$getit.'&quot;&gt;&lt;img src=&quot;images/browse-happy.gif&quot; alt=&quot;Browse Happy&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
+';
 }
 
-if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
-	add_action( 'in_admin_footer', 'browse_happy' );
-
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $id
+ * @return unknown
+ */
 function the_attachment_links( $id = false ) {
 	$id = (int) $id;
 	$post = &amp; get_post( $id );
@@ -1068,7 +2562,7 @@ function the_attachment_links( $id = false ) {
 &lt;?php else : ?&gt;
 	&lt;tr&gt;
 		&lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Link to file' ) ?&gt;&lt;/th&gt;
-		&lt;td&gt;&lt;textarea rows=&quot;1&quot; cols=&quot;40&quot; type=&quot;text&quot; class=&quot;attachmentlinks&quot; readonly=&quot;readonly&quot;&gt;&lt;a href=&quot;&lt;?php echo wp_get_attachment_url(); ?&gt;&quot; class=&quot;attachmentlink&quot;&gt;&lt;?php echo basename( wp_get_attachment_url() );  ?&gt;&lt;/a&gt;&lt;/textarea&gt;&lt;/td&gt;
+		&lt;td&gt;&lt;textarea rows=&quot;1&quot; cols=&quot;40&quot; type=&quot;text&quot; class=&quot;attachmentlinks&quot; readonly=&quot;readonly&quot;&gt;&lt;a href=&quot;&lt;?php echo wp_get_attachment_url(); ?&gt;&quot; class=&quot;attachmentlink&quot;&gt;&lt;?php echo basename( wp_get_attachment_url() ); ?&gt;&lt;/a&gt;&lt;/textarea&gt;&lt;/td&gt;
 	&lt;/tr&gt;
 	&lt;tr&gt;
 		&lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Link to page' ) ?&gt;&lt;/th&gt;
@@ -1080,8 +2574,16 @@ function the_attachment_links( $id = false ) {
 &lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $default
+ */
 function wp_dropdown_roles( $default = false ) {
 	global $wp_roles;
+	$p = '';
 	$r = '';
 	foreach( $wp_roles-&gt;role_names as $role =&gt; $name ) {
 		$name = translate_with_context($name);
@@ -1093,6 +2595,14 @@ function wp_dropdown_roles( $default = false ) {
 	echo $p . $r;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $size
+ * @return unknown
+ */
 function wp_convert_hr_to_bytes( $size ) {
 	$size = strtolower($size);
 	$bytes = (int) $size;
@@ -1105,6 +2615,14 @@ function wp_convert_hr_to_bytes( $size ) {
 	return $bytes;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $bytes
+ * @return unknown
+ */
 function wp_convert_bytes_to_hr( $bytes ) {
 	$units = array( 0 =&gt; 'B', 1 =&gt; 'kB', 2 =&gt; 'MB', 3 =&gt; 'GB' );
 	$log = log( $bytes, 1024 );
@@ -1113,6 +2631,13 @@ function wp_convert_bytes_to_hr( $bytes ) {
 	return $size . $units[$power];
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function wp_max_upload_size() {
 	$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
 	$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
@@ -1120,6 +2645,13 @@ function wp_max_upload_size() {
 	return $bytes;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $action
+ */
 function wp_import_upload_form( $action ) {
 	$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
 	$size = wp_convert_bytes_to_hr( $bytes );
@@ -1139,6 +2671,11 @@ function wp_import_upload_form( $action ) {
 &lt;?php
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
 function wp_remember_old_slug() {
 	global $post;
 	$name = attribute_escape($post-&gt;post_name); // just in case
@@ -1147,53 +2684,60 @@ function wp_remember_old_slug() {
 }
 
 /**
- * add_meta_box() - Add a meta box to an edit form
+ * Add a meta box to an edit form.
  *
- * @since 2.5
+ * @since 2.5.0
  *
  * @param string $id String for use in the 'id' attribute of tags.
- * @param string $title Title of the meta box
- * @param string $callback Function that fills the box with the desired content.  The function should echo its output.
- * @param string $page The type of edit page on which to show the box (post, page, link)
- * @param string $context The context within the page where the boxes should show ('normal', 'advanced')
- * @param string $priority The priority within the context where the boxes should show ('high', 'low')
+ * @param string $title Title of the meta box.
+ * @param string $callback Function that fills the box with the desired content. The function should echo its output.
+ * @param string $page The type of edit page on which to show the box (post, page, link).
+ * @param string $context The context within the page where the boxes should show ('normal', 'advanced').
+ * @param string $priority The priority within the context where the boxes should show ('high', 'low').
  */
 function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') {
 	global $wp_meta_boxes;
 
-	
-	if  ( !isset($wp_meta_boxes) )
+	if ( !isset($wp_meta_boxes) )
 		$wp_meta_boxes = array();
 	if ( !isset($wp_meta_boxes[$page]) )
 		$wp_meta_boxes[$page] = array();
 	if ( !isset($wp_meta_boxes[$page][$context]) )
 		$wp_meta_boxes[$page][$context] = array();
 
+	foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) {
 	foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
-		if ( !isset($wp_meta_boxes[$page][$context][$a_priority][$id]) )
+		if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
 			continue;
+
 		// If a core box was previously added or removed by a plugin, don't add.
 		if ( 'core' == $priority ) {
 			// If core box previously deleted, don't add
-			if ( false === $wp_meta_boxes[$page][$context][$a_priority][$id] )
+			if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
 				return;
 			// If box was added with default priority, give it core priority to maintain sort order
 			if ( 'default' == $a_priority ) {
-				$wp_meta_boxes[$page][$context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];
-				unset($wp_meta_boxes[$page][$context]['default'][$id]);
+				$wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
+				unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
 			}
 			return;
 		}
 		// If no priority given and id already present, use existing priority
-		if ( empty($priority) )
+		if ( empty($priority) ) {
 			$priority = $a_priority;
-		// An id can be in only one priority
-		if ( $priority != $a_priority )
-			unset($wp_meta_boxes[$page][$context][$a_priority][$id]);
+		// else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
+		} elseif ( 'sorted' == $priority ) {
+			$title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
+			$callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
+		}
+		// An id can be in only one priority and one context
+		if ( $priority != $a_priority || $context != $a_context )
+			unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
+	}
 	}
 
 	if ( empty($priority) )
-		$priority = low;
+		$priority = 'low';
 
 	if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
 		$wp_meta_boxes[$page][$context][$priority] = array();
@@ -1201,41 +2745,80 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri
 	$wp_meta_boxes[$page][$context][$priority][$id] = array('id' =&gt; $id, 'title' =&gt; $title, 'callback' =&gt; $callback);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ * @param unknown_type $context
+ * @param unknown_type $object
+ * @return int number of meta_boxes
+ */
 function do_meta_boxes($page, $context, $object) {
 	global $wp_meta_boxes;
+	static $already_sorted = false;
 
-	do_action('do_meta_boxes', $page, $context, $object);
+	//do_action('do_meta_boxes', $page, $context, $object);
 
-	if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
-		return;
+	$hidden = get_hidden_meta_boxes($page);
 
-	foreach ( array('high', 'core', 'default', 'low') as $priority ) {
-		foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
-			if ( false === $box )
-				continue;
-			echo '&lt;div id=&quot;' . $box['id'] . '&quot; class=&quot;postbox ' . postbox_classes($box['id'], $page) . '&quot;&gt;' . &quot;\n&quot;;
-			echo &quot;&lt;h3&gt;{$box['title']}&lt;/h3&gt;\n&quot;;
-			echo '&lt;div class=&quot;inside&quot;&gt;' . &quot;\n&quot;;
-			call_user_func($box['callback'], $object, $box);
-			echo &quot;&lt;/div&gt;\n&quot;;
-			echo &quot;&lt;/div&gt;\n&quot;;
+	echo &quot;&lt;div id='$context-sortables' class='meta-box-sortables'&gt;\n&quot;;
+
+	$i = 0;
+	do {
+		// Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
+		if ( !$already_sorted &amp;&amp; $sorted = get_user_option( &quot;meta-box-order_$page&quot;, 0, false ) ) {
+			foreach ( $sorted as $box_context =&gt; $ids )
+				foreach ( explode(',', $ids) as $id )
+					if ( $id )
+						add_meta_box( $id, null, null, $page, $box_context, 'sorted' );
 		}
-	}
+		$already_sorted = true;
+
+		if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
+			break;
+
+		foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) {
+			if ( isset($wp_meta_boxes[$page][$context][$priority]) ) {
+				foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
+					if ( false == $box || ! $box['title'] )
+						continue;
+					$i++;
+					$style = '';
+					if ( in_array($box['id'], $hidden) )
+						$style = 'style=&quot;display:none;&quot;';
+					echo '&lt;div id=&quot;' . $box['id'] . '&quot; class=&quot;postbox ' . postbox_classes($box['id'], $page) . '&quot; ' . $style . '&gt;' . &quot;\n&quot;;
+					echo '&lt;div class=&quot;handlediv&quot; title=&quot;' . __('Click to toggle') . '&quot;&gt;&lt;br /&gt;&lt;/div&gt;';
+					echo &quot;&lt;h3 class='hndle'&gt;&lt;span&gt;{$box['title']}&lt;/span&gt;&lt;/h3&gt;\n&quot;;
+					echo '&lt;div class=&quot;inside&quot;&gt;' . &quot;\n&quot;;
+					call_user_func($box['callback'], $object, $box);
+					echo &quot;&lt;/div&gt;\n&quot;;
+					echo &quot;&lt;/div&gt;\n&quot;;
+				}
+			}
+		}
+	} while(0);
+
+	echo &quot;&lt;/div&gt;&quot;;
+
+	return $i;
+
 }
 
 /**
- * remove_meta_box() - Remove a meta box from an edit form
+ * Remove a meta box from an edit form.
  *
- * @since 2.6
+ * @since 2.6.0
  *
  * @param string $id String for use in the 'id' attribute of tags.
- * @param string $page The type of edit page on which to show the box (post, page, link)
- * @param string $context The context within the page where the boxes should show ('normal', 'advanced')
+ * @param string $page The type of edit page on which to show the box (post, page, link).
+ * @param string $context The context within the page where the boxes should show ('normal', 'advanced').
  */
 function remove_meta_box($id, $page, $context) {
 	global $wp_meta_boxes;
 
-	if  ( !isset($wp_meta_boxes) )
+	if ( !isset($wp_meta_boxes) )
 		$wp_meta_boxes = array();
 	if ( !isset($wp_meta_boxes[$page]) )
 		$wp_meta_boxes[$page] = array();
@@ -1246,4 +2829,621 @@ function remove_meta_box($id, $page, $context) {
 		$wp_meta_boxes[$page][$context][$priority][$id] = false;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ */
+function meta_box_prefs($page) {
+	global $wp_meta_boxes;
+
+	if ( empty($wp_meta_boxes[$page]) )
+		return;
+
+	$hidden = get_hidden_meta_boxes($page);
+
+	foreach ( array_keys($wp_meta_boxes[$page]) as $context ) {
+		foreach ( array_keys($wp_meta_boxes[$page][$context]) as $priority ) {
+			foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
+				if ( false == $box || ! $box['title'] )
+					continue;
+				// Submit box cannot be hidden
+				if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
+					continue;
+				$box_id = $box['id'];
+				echo '&lt;label for=&quot;' . $box_id . '-hide&quot;&gt;';
+				echo '&lt;input class=&quot;hide-postbox-tog&quot; name=&quot;' . $box_id . '-hide&quot; type=&quot;checkbox&quot; id=&quot;' . $box_id . '-hide&quot; value=&quot;' . $box_id . '&quot;' . (! in_array($box_id, $hidden) ? ' checked=&quot;checked&quot;' : '') . ' /&gt;';
+				echo &quot;{$box['title']}&lt;/label&gt;\n&quot;;
+			}
+		}
+	}
+}
+
+function get_hidden_meta_boxes($page) {
+	$hidden = (array) get_user_option( &quot;meta-box-hidden_$page&quot;, 0, false );
+
+	// Hide slug boxes by default
+	if ( empty($hidden[0]) ) {
+		if ( 'page' == $page )
+			$hidden = array('pageslugdiv');
+		elseif ( 'post' == $page )
+			$hidden = array('slugdiv');
+	}
+
+	return $hidden;
+}
+
+/**
+ * Add a new section to a settings page.
+ *
+ * @since 2.7.0
+ *
+ * @param string $id String for use in the 'id' attribute of tags.
+ * @param string $title Title of the section.
+ * @param string $callback Function that fills the section with the desired content. The function should echo its output.
+ * @param string $page The type of settings page on which to show the section (general, reading, writing, ...).
+ */
+function add_settings_section($id, $title, $callback, $page) {
+	global $wp_settings_sections;
+
+	if ( !isset($wp_settings_sections) )
+		$wp_settings_sections = array();
+	if ( !isset($wp_settings_sections[$page]) )
+		$wp_settings_sections[$page] = array();
+	if ( !isset($wp_settings_sections[$page][$id]) )
+		$wp_settings_sections[$page][$id] = array();
+
+	$wp_settings_sections[$page][$id] = array('id' =&gt; $id, 'title' =&gt; $title, 'callback' =&gt; $callback);
+}
+
+/**
+ * Add a new field to a settings page.
+ *
+ * @since 2.7.0
+ *
+ * @param string $id String for use in the 'id' attribute of tags.
+ * @param string $title Title of the field.
+ * @param string $callback Function that fills the field with the desired content. The function should echo its output.
+ * @param string $page The type of settings page on which to show the field (general, reading, writing, ...).
+ * @param string $section The section of the settingss page in which to show the box (default, ...).
+ * @param array $args Additional arguments
+ */
+function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
+	global $wp_settings_fields;
+
+	if ( !isset($wp_settings_fields) )
+		$wp_settings_fields = array();
+	if ( !isset($wp_settings_fields[$page]) )
+		$wp_settings_fields[$page] = array();
+	if ( !isset($wp_settings_fields[$page][$section]) )
+		$wp_settings_fields[$page][$section] = array();
+
+	$wp_settings_fields[$page][$section][$id] = array('id' =&gt; $id, 'title' =&gt; $title, 'callback' =&gt; $callback, 'args' =&gt; $args);
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ */
+function do_settings_sections($page) {
+	global $wp_settings_sections, $wp_settings_fields;
+
+	if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
+		return;
+
+	foreach ( (array) $wp_settings_sections[$page] as $section ) {
+		echo &quot;&lt;h3&gt;{$section['title']}&lt;/h3&gt;\n&quot;;
+		call_user_func($section['callback'], $section);
+		if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]) )
+			continue;
+		echo '&lt;table class=&quot;form-table&quot;&gt;';
+		do_settings_fields($page, $section['id']);
+		echo '&lt;/table&gt;';
+	}
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ * @param unknown_type $section
+ */
+function do_settings_fields($page, $section) {
+	global $wp_settings_fields;
+
+	if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) )
+		return;
+
+	foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
+		echo '&lt;tr valign=&quot;top&quot;&gt;';
+		if ( !empty($field['args']['label_for']) )
+			echo '&lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;' . $field['args']['label_for'] . '&quot;&gt;' . $field['title'] . '&lt;/label&gt;&lt;/th&gt;';
+		else
+			echo '&lt;th scope=&quot;row&quot;&gt;' . $field['title'] . '&lt;/th&gt;';
+		echo '&lt;td&gt;';
+		call_user_func($field['callback']);
+		echo '&lt;/td&gt;';
+		echo '&lt;/tr&gt;';
+	}
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ */
+function manage_columns_prefs($page) {
+	$columns = get_column_headers($page);
+
+	$hidden = get_hidden_columns($page);
+
+	foreach ( $columns as $column =&gt; $title ) {
+		// Can't hide these
+		if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'username' == $column || 'media' == $column || 'comment' == $column )
+			continue;
+		if ( empty($title) )
+			continue;
+
+		if ( 'comments' == $column )
+			$title = __('Comments');
+		$id = &quot;$column-hide&quot;;
+		echo '&lt;label for=&quot;' . $id . '&quot;&gt;';
+		echo '&lt;input class=&quot;hide-column-tog&quot; name=&quot;' . $id . '&quot; type=&quot;checkbox&quot; id=&quot;' . $id . '&quot; value=&quot;' . $column . '&quot;' . (! in_array($column, $hidden) ? ' checked=&quot;checked&quot;' : '') . ' /&gt;';
+		echo &quot;$title&lt;/label&gt;\n&quot;;
+	}
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $found_action
+ */
+function find_posts_div($found_action = '') {
+?&gt;
+	&lt;div id=&quot;find-posts&quot; class=&quot;find-box&quot; style=&quot;display:none;&quot;&gt;
+		&lt;div id=&quot;find-posts-head&quot; class=&quot;find-box-head&quot;&gt;&lt;?php _e('Find Posts or Pages'); ?&gt;&lt;/div&gt;
+		&lt;div class=&quot;find-box-inside&quot;&gt;
+			&lt;div class=&quot;find-box-search&quot;&gt;
+				&lt;?php if ( $found_action ) { ?&gt;
+					&lt;input type=&quot;hidden&quot; name=&quot;found_action&quot; value=&quot;&lt;?php echo $found_action; ?&gt;&quot; /&gt;
+				&lt;?php } ?&gt;
+
+				&lt;input type=&quot;hidden&quot; name=&quot;affected&quot; id=&quot;affected&quot; value=&quot;&quot; /&gt;
+				&lt;?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?&gt;
+				&lt;label class=&quot;hidden&quot; for=&quot;find-posts-input&quot;&gt;&lt;?php _e( 'Search' ); ?&gt;&lt;/label&gt;
+				&lt;input type=&quot;text&quot; id=&quot;find-posts-input&quot; class=&quot;search-input&quot; name=&quot;ps&quot; value=&quot;&quot; /&gt;
+				&lt;input type=&quot;button&quot; onclick=&quot;findPosts.send();&quot; value=&quot;&lt;?php _e( 'Search' ); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;br /&gt;
+
+				&lt;input type=&quot;radio&quot; name=&quot;find-posts-what&quot; id=&quot;find-posts-posts&quot; checked=&quot;checked&quot; value=&quot;posts&quot; /&gt;
+				&lt;label for=&quot;find-posts-posts&quot;&gt;&lt;?php _e( 'Posts' ); ?&gt;&lt;/label&gt;
+				&lt;input type=&quot;radio&quot; name=&quot;find-posts-what&quot; id=&quot;find-posts-pages&quot; value=&quot;pages&quot; /&gt;
+				&lt;label for=&quot;find-posts-pages&quot;&gt;&lt;?php _e( 'Pages' ); ?&gt;&lt;/label&gt;
+			&lt;/div&gt;
+			&lt;div id=&quot;find-posts-response&quot;&gt;&lt;/div&gt;
+		&lt;/div&gt;
+		&lt;div class=&quot;find-box-buttons&quot;&gt;
+			&lt;input type=&quot;button&quot; class=&quot;button&quot; onclick=&quot;findPosts.close();&quot; value=&quot;&lt;?php _e('Close'); ?&gt;&quot; /&gt;
+			&lt;input id=&quot;find-posts-submit&quot; type=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php _e('Select'); ?&gt;&quot; /&gt;
+		&lt;/div&gt;
+	&lt;/div&gt;
+	&lt;script type=&quot;text/javascript&quot;&gt;
+	/* &lt;![CDATA[ */
+	(function($){
+		findPosts = {
+			open : function(af_name, af_val) {
+				var st = document.documentElement.scrollTop || $(document).scrollTop();
+
+				if ( af_name &amp;&amp; af_val )
+					$('#affected').attr('name', af_name).val(af_val);
+
+				$('#find-posts').show().draggable({
+					handle: '#find-posts-head'
+				}).resizable({
+					handles: 'all',
+					minHeight: 150,
+					minWidth: 280
+				}).css({'top':st+'px','left':'50%','marginLeft':'-200px'});
+
+				$('.ui-resizable-handle').css({
+					'backgroundColor': '#e5e5e5'
+				});
+
+				$('.ui-resizable-se').css({
+					'border': '0 none',
+					'width': '15px',
+					'height': '16px',
+					'background': 'transparent url(images/se.png) no-repeat scroll 0 0'
+				});
+
+				$('#find-posts-input').focus().keyup(function(e){
+					if (e.which == 27) findPosts.close(); // close on Escape
+				});
+
+				return false;
+			},
+
+			close : function() {
+				$('#find-posts-response').html('');
+				$('#find-posts').draggable('destroy').resizable('destroy').hide();
+			},
+
+			send : function() {
+				var post = {};
+
+				post['ps'] = $('#find-posts-input').val();
+				post['action'] = 'find_posts';
+				post['_ajax_nonce'] = $('#_ajax_nonce').val();
+
+				if ( $('#find-posts-pages:checked').val() )
+					post['pages'] = 1;
+				else
+					post['posts'] = 1;
+
+				$.ajax({
+					type : 'POST',
+					url : '&lt;?php echo admin_url('admin-ajax.php'); ?&gt;',
+					data : post,
+					success : function(x) { findPosts.show(x); },
+					error : function(r) { findPosts.error(r); }
+				});
+			},
+
+			show : function(x) {
+
+				if ( typeof(x) == 'string' ) {
+					this.error({'responseText': x});
+					return;
+				}
+
+				var r = wpAjax.parseAjaxResponse(x);
+
+				if ( r.errors )
+					this.error({'responseText': wpAjax.broken});
+
+				r = r.responses[0];
+				$('#find-posts-response').html(r.data);
+			},
+
+			error : function(r) {
+				var er = r.statusText;
+
+				if ( r.responseText )
+					er = r.responseText.replace( /&lt;.[^&lt;&gt;]*?&gt;/g, '' );
+
+				if ( er )
+					$('#find-posts-response').html(er);
+			}
+		};
+
+		$(document).ready(function(){
+			$('#find-posts-submit').click(function(e) {
+				if ( '' == $('#find-posts-response').html() )
+					e.preventDefault();
+			});
+		});
+	})(jQuery);
+	/* ]]&gt; */
+	&lt;/script&gt;
+&lt;?php
+}
+
+/**
+ * Display the post password.
+ *
+ * The password is passed through {@link attribute_escape()} to ensure that it
+ * is safe for placing in an html attribute.
+ *
+ * @uses attribute_escape
+ * @since 2.7.0
+ */
+function the_post_password() {
+	global $post;
+	if ( isset( $post-&gt;post_password ) ) echo attribute_escape( $post-&gt;post_password );
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ */
+function favorite_actions() {
+	$actions = array(
+		'post-new.php' =&gt; array(__('New Post'), 'edit_posts'),
+		'edit.php?post_status=draft' =&gt; array(__('Drafts'), 'edit_posts'),
+		'page-new.php' =&gt; array(__('New Page'), 'edit_pages'),
+		'media-new.php' =&gt; array(__('Upload'), 'upload_files'),
+		'edit-comments.php' =&gt; array(__('Comments'), 'moderate_comments')
+		);
+
+	$actions = apply_filters('favorite_actions', $actions);
+
+	$allowed_actions = array();
+	foreach ( $actions as $action =&gt; $data ) {
+		if ( current_user_can($data[1]) )
+			$allowed_actions[$action] = $data[0];
+	}
+
+	if ( empty($allowed_actions) )
+		return;
+
+	$first = array_keys($allowed_actions);
+	$first = $first[0];
+	echo '&lt;div id=&quot;favorite-actions&quot;&gt;';
+	echo '&lt;div id=&quot;favorite-first&quot;&gt;&lt;a href=&quot;' . $first . '&quot;&gt;' . $allowed_actions[$first] . '&lt;/a&gt;&lt;/div&gt;&lt;div id=&quot;favorite-toggle&quot;&gt;&lt;br /&gt;&lt;/div&gt;';
+	echo '&lt;div id=&quot;favorite-inside&quot;&gt;';
+
+	array_shift($allowed_actions);
+
+	foreach ( $allowed_actions as $action =&gt; $label) {
+		echo &quot;&lt;div class='favorite-action'&gt;&lt;a href='$action'&gt;&quot;;
+		echo $label;
+		echo &quot;&lt;/a&gt;&lt;/div&gt;\n&quot;;
+	}
+	echo &quot;&lt;/div&gt;&lt;/div&gt;\n&quot;;
+}
+
+/**
+ * Get the post title.
+ *
+ * The post title is fetched and if it is blank then a default string is
+ * returned.
+ *
+ * @since 2.7.0
+ * @param int $id The post id. If not supplied the global $post is used.
+ *
+ */
+function _draft_or_post_title($post_id = 0)
+{
+	$title = get_the_title($post_id);
+	if ( empty($title) )
+		$title = __('(no title)');
+	return $title;
+}
+
+/**
+ * Display the search query.
+ *
+ * A simple wrapper to display the &quot;s&quot; parameter in a GET URI. This function
+ * should only be used when {@link the_search_query()} cannot.
+ *
+ * @uses attribute_escape
+ * @since 2.7.0
+ *
+ */
+function _admin_search_query() {
+	echo isset($_GET['s']) ? attribute_escape( stripslashes( $_GET['s'] ) ) : '';
+}
+
+/**
+ * Generic Iframe header for use with Thickbox
+ *
+ * @since 2.7.0
+ * @param string $title Title of the Iframe page.
+ * @param bool $limit_styles Limit styles to colour-related styles only (unless others are enqueued).
+ *
+ */
+function iframe_header( $title = '', $limit_styles = false) {
+?&gt;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php do_action('admin_xml_ns'); ?&gt; &lt;?php language_attributes(); ?&gt;&gt;
+&lt;head&gt;
+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;&lt;?php bloginfo('html_type'); ?&gt;; charset=&lt;?php echo get_option('blog_charset'); ?&gt;&quot; /&gt;
+&lt;title&gt;&lt;?php bloginfo('name') ?&gt; &amp;rsaquo; &lt;?php echo $title ?&gt; &amp;#8212; &lt;?php _e('WordPress'); ?&gt;&lt;/title&gt;
+&lt;?php
+wp_enqueue_style( 'global' );
+wp_enqueue_style( 'colors' );
+if ( ! $limit_styles )
+	wp_enqueue_style( 'wp-admin' );
+?&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+//&lt;![CDATA[
+function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
+//]]&gt;
+&lt;/script&gt;
+&lt;?php
+do_action('admin_print_styles');
+do_action('admin_print_scripts');
+do_action('admin_head');
+?&gt;
+&lt;/head&gt;
+&lt;body&lt;?php if ( isset($GLOBALS['body_id']) ) echo ' id=&quot;' . $GLOBALS['body_id'] . '&quot;'; ?&gt;&gt;
+&lt;?php
+}
+
+/**
+ * Generic Iframe footer for use with Thickbox
+ *
+ * @since 2.7.0
+ *
+ */
+function iframe_footer() {
+	echo '
+	&lt;/body&gt;
+&lt;/html&gt;';
+}
+
+function _post_states($post) {
+	$post_states = array();
+	if ( isset($_GET['post_status']) )
+		$post_status = $_GET['post_status'];
+	else
+		$post_status = '';
+
+	if ( !empty($post-&gt;post_password) )
+		$post_states[] = __('Password protected');
+	if ( 'private' == $post-&gt;post_status &amp;&amp; 'private' != $post_status )
+		$post_states[] = __('Private');
+	if ( 'draft' == $post-&gt;post_status &amp;&amp; 'draft' != $post_status )
+		$post_states[] = __('Draft');
+	if ( 'pending' == $post-&gt;post_status &amp;&amp; 'pending' != $post_status )
+		$post_states[] = __('Pending');
+
+	if ( ! empty($post_states) ) {
+		$state_count = count($post_states);
+		$i = 0;
+		echo ' - ';
+		foreach ( $post_states as $state ) {
+			++$i;
+			( $i == $state_count ) ? $sep = '' : $sep = ', ';
+			echo &quot;&lt;span class='post-state'&gt;$state$sep&lt;/span&gt;&quot;;
+		}
+	}
+}
+
+function screen_meta($screen) {
+	global $wp_meta_boxes, $_wp_contextual_help;
+
+	$screen = str_replace('.php', '', $screen);
+	$screen = str_replace('-new', '', $screen);
+	$screen = str_replace('-add', '', $screen);
+	$screen = apply_filters('screen_meta_screen', $screen);
+
+	$column_screens = get_column_headers($screen);
+	$meta_screens = array('index' =&gt; 'dashboard');
+
+	if ( isset($meta_screens[$screen]) )
+		$screen = $meta_screens[$screen];
+	$show_screen = false;
+	if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) )
+		$show_screen = true;
+?&gt;
+&lt;div id=&quot;screen-meta&quot;&gt;
+&lt;?php
+	if ( $show_screen ) :
+?&gt;
+&lt;div id=&quot;screen-options-wrap&quot; class=&quot;hidden&quot;&gt;
+	&lt;h5&gt;&lt;?php _e('Show on screen') ?&gt;&lt;/h5&gt;
+	&lt;form id=&quot;adv-settings&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
+	&lt;div class=&quot;metabox-prefs&quot;&gt;
+&lt;?php
+	if ( !meta_box_prefs($screen) &amp;&amp; isset($column_screens) ) {
+		manage_columns_prefs($screen);
+		wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false );
+	}
+?&gt;
+	&lt;br class=&quot;clear&quot; /&gt;
+	&lt;/div&gt;&lt;/form&gt;
+&lt;/div&gt;
+
+&lt;?php
+	endif;
+
+	global $title;
+
+	if ( !isset($_wp_contextual_help) )
+		$_wp_contextual_help = array();
+
+	if ( !isset($_wp_contextual_help['post']) ) {
+		$help = drag_drop_help();
+		$help .= '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Writing_Posts&quot; target=&quot;_blank&quot;&gt;Writing Posts&lt;/a&gt;') . '&lt;/p&gt;';
+		$_wp_contextual_help['post'] = $help;
+	}
+
+	if ( !isset($_wp_contextual_help['page']) ) {
+		$help = drag_drop_help();
+		$_wp_contextual_help['page'] = $help;
+	}
+
+	if ( !isset($_wp_contextual_help['dashboard']) ) {
+		$help = drag_drop_help();
+		$_wp_contextual_help['dashboard'] = $help;
+	}
+
+	if ( !isset($_wp_contextual_help['link']) ) {
+		$help = drag_drop_help();
+		$_wp_contextual_help['link'] = $help;
+	}
+
+	if ( !isset($_wp_contextual_help['options-general']) )
+		$_wp_contextual_help['options-general'] =  __('&lt;a href=&quot;http://codex.wordpress.org/Settings_General_SubPanel&quot; target=&quot;_blank&quot;&gt;General Settings&lt;/a&gt;');
+
+	$_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen);
+	?&gt;
+	&lt;div id=&quot;contextual-help-wrap&quot; class=&quot;hidden&quot;&gt;
+	&lt;?php
+	$contextual_help = '';
+	if ( isset($_wp_contextual_help[$screen]) ) {
+		if ( !empty($title) )
+			$contextual_help .= '&lt;h5&gt;' . sprintf(__('Get help with &quot;%s&quot;'), $title) . '&lt;/h5&gt;';
+		else
+			$contextual_help .= '&lt;h5&gt;' . __('Get help with this page') . '&lt;/h5&gt;';
+		$contextual_help .= '&lt;div class=&quot;metabox-prefs&quot;&gt;' . $_wp_contextual_help[$screen] . &quot;&lt;/div&gt;\n&quot;;
+
+		$contextual_help .= '&lt;h5&gt;' . __('Other Help') . '&lt;/h5&gt;';
+	} else {
+		$contextual_help .= '&lt;h5&gt;' . __('Help') . '&lt;/h5&gt;';
+	}
+
+	$contextual_help .= '&lt;div class=&quot;metabox-prefs&quot;&gt;';
+	$contextual_help .= __('&lt;a href=&quot;http://codex.wordpress.org/&quot; target=&quot;_blank&quot;&gt;Documentation&lt;/a&gt;');
+	$contextual_help .= '&lt;br /&gt;';
+	$contextual_help .= __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;');
+	$contextual_help .= &quot;&lt;/div&gt;\n&quot;;
+	echo apply_filters('contextual_help', $contextual_help, $screen);
+	?&gt;
+	&lt;/div&gt;
+
+&lt;div id=&quot;screen-meta-links&quot;&gt;
+&lt;div id=&quot;contextual-help-link-wrap&quot; class=&quot;hide-if-no-js screen-meta-toggle&quot;&gt;
+&lt;a href=&quot;#contextual-help&quot; id=&quot;contextual-help-link&quot; class=&quot;show-settings&quot;&gt;&lt;?php _e('Help') ?&gt;&lt;/a&gt;
+&lt;/div&gt;
+&lt;?php if ( $show_screen ) { ?&gt;
+&lt;div id=&quot;screen-options-link-wrap&quot; class=&quot;hide-if-no-js screen-meta-toggle&quot;&gt;
+&lt;a href=&quot;#screen-options&quot; id=&quot;show-settings-link&quot; class=&quot;show-settings&quot;&gt;&lt;?php _e('Screen Options') ?&gt;&lt;/a&gt;
+&lt;/div&gt;
+&lt;?php } ?&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;?php
+}
+
+/**
+ * Add contextual help text for a page
+ *
+ * @since 2.7.0
+ *
+ * @param string $screen The handle for the screen to add help to.  This is usually the hook name returned by the add_*_page() functions.
+ * @param string $help Arbitrary help text
+ */
+function add_contextual_help($screen, $help) {
+	global $_wp_contextual_help;
+
+	if ( !isset($_wp_contextual_help) )
+		$_wp_contextual_help = array();
+
+	$_wp_contextual_help[$screen] = $help;
+}
+
+function drag_drop_help() {
+	return '
+	&lt;p&gt;' .	__('Most of the modules on this screen can be moved. If you hover your mouse over the title bar of a module you&#8217;ll notice the 4 arrow cursor appears to let you know it is movable. Click on it, hold down the mouse button and start dragging the module to a new location. As you drag the module, notice the dotted gray box that also moves. This box indicates where the module will be placed when you release the mouse button.') . '&lt;/p&gt;
+	&lt;p&gt;' . __('The same modules can be expanded and collapsed by clicking once on their title bar and also completely hidden from the Screen Options tab.') . '&lt;/p&gt;
+';
+}
+
+function screen_icon($name = '') {
+	global $parent_file, $hook_suffix;
+
+	if ( empty($name) ) {
+		if ( isset($parent_file) &amp;&amp; !empty($parent_file) )
+			$name = substr($parent_file, 0, -4);
+		else
+			$name = str_replace(array('.php', '-new', '-add'), '', $hook_suffix);
+	}
+	unset($hook_suffix);
+?&gt;
+	&lt;div id=&quot;icon-&lt;?php echo $name; ?&gt;&quot; class=&quot;icon32&quot;&gt;&lt;br /&gt;&lt;/div&gt;
+&lt;?php
+}
+
 ?&gt;</diff>
      <filename>wp-admin/includes/template.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,18 @@
 &lt;?php
+/**
+ * WordPress Theme Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function current_theme_info() {
 	$themes = get_themes();
 	$current_theme = get_current_theme();
@@ -18,6 +31,13 @@ function current_theme_info() {
 	return $ct;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_broken_themes() {
 	global $wp_broken_themes;
 
@@ -25,6 +45,13 @@ function get_broken_themes() {
 	return $wp_broken_themes;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_page_templates() {
 	$themes = get_themes();
 	$theme = get_current_theme();
@@ -35,11 +62,13 @@ function get_page_templates() {
 		foreach ( $templates as $template ) {
 			$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
 
-			preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
-			preg_match( '|Description:(.*)$|mi', $template_data, $description );
+			$name = '';
+			if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
+				$name = $name[1];
 
-			$name = $name[1];
-			$description = $description[1];
+			$description = '';
+			if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) )
+				$description = $description[1];
 
 			if ( !empty( $name ) ) {
 				$page_templates[trim( $name )] = basename( $template );</diff>
      <filename>wp-admin/includes/theme.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,42 +1,134 @@
 &lt;?php
+/**
+ * WordPress Administration Update API
+ *
+ * @package WordPress
+ * @subpackage Admin
+ */
 
 // The admin side of our 1.1 update system
 
+/**
+ * Selects the first update version from the update_core option
+ *
+ * @return object the response from the API
+ */
+function get_preferred_from_update_core() {
+	$updates = get_core_updates();
+	if ( !is_array( $updates ) )
+		return false;
+	if ( empty( $updates ) )
+		return (object)array('response' =&gt; 'latest');
+	return $updates[0];
+}
+
+/**
+ * Get available core updates
+ *
+ * @param array $options Set $options['dismissed'] to true to show dismissed upgrades too,
+ * 	set $options['available'] to false to skip not-dimissed updates.
+ * @return array Array of the update objects
+ */
+function get_core_updates( $options = array() ) {
+	$options = array_merge( array('available' =&gt; true, 'dismissed' =&gt; false ), $options );
+	$dismissed = get_option( 'dismissed_update_core' );
+	if ( !is_array( $dismissed ) ) $dismissed = array();
+	$from_api = get_option( 'update_core' );
+	if ( empty($from_api) )
+		return false;
+	if ( !is_array( $from_api-&gt;updates ) ) return false;
+	$updates = $from_api-&gt;updates;
+	if ( !is_array( $updates ) ) return false;
+	$result = array();
+	foreach($updates as $update) {
+		if ( array_key_exists( $update-&gt;current.'|'.$update-&gt;locale, $dismissed ) ) {
+			if ( $options['dismissed'] ) {
+				$update-&gt;dismissed = true;
+				$result[]= $update;
+			}
+		} else {
+			if ( $options['available'] ) {
+				$update-&gt;dismissed = false;
+				$result[]= $update;
+			}
+		}
+	}
+	return $result;
+}
+
+function dismiss_core_update( $update ) {
+	$dismissed = get_option( 'dismissed_update_core' );
+	$dismissed[ $update-&gt;current.'|'.$update-&gt;locale ] = true;
+	return update_option( 'dismissed_update_core', $dismissed );
+}
+
+function undismiss_core_update( $version, $locale ) {
+	$dismissed = get_option( 'dismissed_update_core' );
+	$key = $version.'|'.$locale;
+	if ( !isset( $dismissed[$key] ) ) return false;
+	unset( $dismissed[$key] );
+	return update_option( 'dismissed_update_core', $dismissed );
+}
+
+function find_core_update( $version, $locale ) {
+	$from_api = get_option( 'update_core' );
+	if ( !is_array( $from_api-&gt;updates ) ) return false;
+	$updates = $from_api-&gt;updates;
+	foreach($updates as $update) {
+		if ( $update-&gt;current == $version &amp;&amp; $update-&gt;locale == $locale )
+			return $update;
+	}
+	return false;
+}
+
 function core_update_footer( $msg = '' ) {
 	if ( !current_user_can('manage_options') )
 		return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
 
-	$cur = get_option( 'update_core' );
+	$cur = get_preferred_from_update_core();
+	if ( ! isset( $cur-&gt;current ) )
+		$cur-&gt;current = '';
+
+	if ( ! isset( $cur-&gt;url ) )
+		$cur-&gt;url = '';
+
+	if ( ! isset( $cur-&gt;response ) )
+		$cur-&gt;response = '';
 
 	switch ( $cur-&gt;response ) {
 	case 'development' :
-		return sprintf( '| '.__( 'You are using a development version (%s). Cool! Please &lt;a href=&quot;%s&quot;&gt;stay updated&lt;/a&gt;.' ), $GLOBALS['wp_version'], $cur-&gt;url, $cur-&gt;current );
+		return sprintf( __( 'You are using a development version (%1$s). Cool! Please &lt;a href=&quot;%2$s&quot;&gt;stay updated&lt;/a&gt;.' ), $GLOBALS['wp_version'], 'update-core.php');
 	break;
 
 	case 'upgrade' :
 		if ( current_user_can('manage_options') ) {
-			return sprintf( '| &lt;strong&gt;'.__( '&lt;a href=&quot;%2$s&quot;&gt;Get Version %3$s&lt;/a&gt;' ).'&lt;/strong&gt;', $GLOBALS['wp_version'], $cur-&gt;url, $cur-&gt;current );
+			return sprintf( '&lt;strong&gt;'.__( '&lt;a href=&quot;%1$s&quot;&gt;Get Version %2$s&lt;/a&gt;' ).'&lt;/strong&gt;', 'update-core.php', $cur-&gt;current);
 			break;
 		}
 
 	case 'latest' :
 	default :
-		return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'], $cur-&gt;url, $cur-&gt;current );
+		return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
 	break;
 	}
 }
 add_filter( 'update_footer', 'core_update_footer' );
 
 function update_nag() {
-	$cur = get_option( 'update_core' );
+	global $pagenow;
+
+	if ( 'update-core.php' == $pagenow )
+		return;
+
+	$cur = get_preferred_from_update_core();
 
 	if ( ! isset( $cur-&gt;response ) || $cur-&gt;response != 'upgrade' )
 		return false;
 
 	if ( current_user_can('manage_options') )
-		$msg = sprintf( __('WordPress %2$s is available! &lt;a href=&quot;%1$s&quot;&gt;Please update now&lt;/a&gt;.'), $cur-&gt;url, $cur-&gt;current );
+		$msg = sprintf( __('WordPress %1$s is available! &lt;a href=&quot;%2$s&quot;&gt;Please update now&lt;/a&gt;.'), $cur-&gt;current, 'update-core.php' );
 	else
-		$msg = sprintf( __('WordPress %2$s is available! Please notify the site administrator.'), $cur-&gt;url, $cur-&gt;current );
+		$msg = sprintf( __('WordPress %1$s is available! Please notify the site administrator.'), $cur-&gt;current );
 
 	echo &quot;&lt;div id='update-nag'&gt;$msg&lt;/div&gt;&quot;;
 }
@@ -44,11 +136,11 @@ add_action( 'admin_notices', 'update_nag', 3 );
 
 // Called directly from dashboard
 function update_right_now_message() {
-	$cur = get_option( 'update_core' );
+	$cur = get_preferred_from_update_core();
 
-	$msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] );
+	$msg = sprintf( __('You are using &lt;span class=&quot;b&quot;&gt;WordPress %s&lt;/span&gt;.'), $GLOBALS['wp_version'] );
 	if ( isset( $cur-&gt;response ) &amp;&amp; $cur-&gt;response == 'upgrade' &amp;&amp; current_user_can('manage_options') )
-		$msg .= &quot; &lt;a href='$cur-&gt;url' class='rbutton'&gt;&quot; . sprintf( __('Update to %s'), $cur-&gt;current ? $cur-&gt;current : __( 'Latest' ) ) . '&lt;/a&gt;';
+		$msg .= &quot; &lt;a href='update-core.php' class='button'&gt;&quot; . sprintf( __('Update to %s'), $cur-&gt;current ? $cur-&gt;current : __( 'Latest' ) ) . '&lt;/a&gt;';
 
 	echo &quot;&lt;span id='wp-version-message'&gt;$msg&lt;/span&gt;&quot;;
 }
@@ -60,14 +152,16 @@ function wp_plugin_update_row( $file, $plugin_data ) {
 
 	$r = $current-&gt;response[ $file ];
 
+	$details_url = admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $r-&gt;slug . '&amp;TB_iframe=true&amp;width=600&amp;height=800');
+
 	echo '&lt;tr&gt;&lt;td colspan=&quot;5&quot; class=&quot;plugin-update&quot;&gt;';
 	if ( ! current_user_can('update_plugins') )
-		printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot;&gt;Download version %3$s here&lt;/a&gt;.'), $plugin_data['Name'], $r-&gt;url, $r-&gt;new_version);
+		printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot; class=&quot;thickbox&quot; title=&quot;%1$s&quot;&gt;View version %3$s Details&lt;/a&gt;.'), $plugin_data['Name'], $details_url, $r-&gt;new_version);
 	else if ( empty($r-&gt;package) )
-		printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot;&gt;Download version %3$s here&lt;/a&gt; &lt;em&gt;automatic upgrade unavailable for this plugin&lt;/em&gt;.'), $plugin_data['Name'], $r-&gt;url, $r-&gt;new_version);
+		printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot; class=&quot;thickbox&quot; title=&quot;%1$s&quot;&gt;View version %3$s Details&lt;/a&gt; &lt;em&gt;automatic upgrade unavailable for this plugin&lt;/em&gt;.'), $plugin_data['Name'], $details_url, $r-&gt;new_version);
 	else
-		printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot;&gt;Download version %3$s here&lt;/a&gt; or &lt;a href=&quot;%4$s&quot;&gt;upgrade automatically&lt;/a&gt;.'), $plugin_data['Name'], $r-&gt;url, $r-&gt;new_version, wp_nonce_url('update.php?action=upgrade-plugin&amp;amp;plugin=' . $file, 'upgrade-plugin_' . $file) );
-	
+		printf( __('There is a new version of %1$s available. &lt;a href=&quot;%2$s&quot; class=&quot;thickbox&quot; title=&quot;%1$s&quot;&gt;View version %3$s Details&lt;/a&gt; or &lt;a href=&quot;%4$s&quot;&gt;upgrade automatically&lt;/a&gt;.'), $plugin_data['Name'], $details_url, $r-&gt;new_version, wp_nonce_url('update.php?action=upgrade-plugin&amp;amp;plugin=' . $file, 'upgrade-plugin_' . $file) );
+
 	echo '&lt;/td&gt;&lt;/tr&gt;';
 }
 add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );
@@ -102,7 +196,7 @@ function wp_update_plugin($plugin, $feedback = '') {
 	$content_dir = $wp_filesystem-&gt;wp_content_dir();
 	if( empty($content_dir) )
 		return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
-	
+
 	$plugins_dir = trailingslashit( $plugins_dir );
 	$content_dir = trailingslashit( $content_dir );
 
@@ -129,10 +223,10 @@ function wp_update_plugin($plugin, $feedback = '') {
 	apply_filters('update_feedback', __('Unpacking the update'));
 	// Unzip package to working directory
 	$result = unzip_file($download_file, $working_dir);
-	
+
 	// Once extracted, delete the package
 	unlink($download_file);
-	
+
 	if ( is_wp_error($result) ) {
 		$wp_filesystem-&gt;delete($working_dir, true);
 		return $result;
@@ -147,7 +241,7 @@ function wp_update_plugin($plugin, $feedback = '') {
 	// Remove the existing plugin.
 	apply_filters('update_feedback', __('Removing the old version of the plugin'));
 	$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
-	
+
 	// If plugin is in its own directory, recursively delete the directory.
 	if ( strpos($plugin, '/') &amp;&amp; $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
 		$deleted = $wp_filesystem-&gt;delete($this_plugin_dir, true);
@@ -163,7 +257,7 @@ function wp_update_plugin($plugin, $feedback = '') {
 	// Copy new version of plugin into place.
 	$result = copy_dir($working_dir, $plugins_dir);
 	if ( is_wp_error($result) ) {
-		//$wp_filesystem-&gt;delete($working_dir, true); //TODO: Uncomment? This DOES mean that the new files are available in the upgrade folder if it fails.
+		$wp_filesystem-&gt;delete($working_dir, true);
 		return $result;
 	}
 
@@ -175,10 +269,10 @@ function wp_update_plugin($plugin, $feedback = '') {
 
 	// Force refresh of plugin update information
 	delete_option('update_plugins');
-	
+
 	if( empty($filelist) )
 		return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
-	
+
 	$folder = $filelist[0];
 	$plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash
 	$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
@@ -186,4 +280,213 @@ function wp_update_plugin($plugin, $feedback = '') {
 	return  $folder . '/' . $pluginfiles[0];
 }
 
+function wp_update_theme($theme, $feedback = '') {
+	global $wp_filesystem;
+
+	if ( !empty($feedback) )
+		add_filter('update_feedback', $feedback);
+
+	// Is an update available?
+	$current = get_option( 'update_themes' );
+	if ( !isset( $current-&gt;response[ $theme ] ) )
+		return new WP_Error('up_to_date', __('The theme is at the latest version.'));
+
+	$r = $current-&gt;response[ $theme ];
+
+	$themes = get_themes();
+	foreach ( (array) $themes as $this_theme ) {
+		if ( $this_theme['Stylesheet'] == $theme ) {
+			$theme_directory = preg_replace('!^/themes/!i', '', $this_theme['Stylesheet Dir']);
+			break;
+		}
+	}
+	unset($themes);
+
+	if ( empty($theme_directory) )
+		return new WP_Error('theme_non_existant', __('Theme does not exist.'));
+
+	// Is a filesystem accessor setup?
+	if ( ! $wp_filesystem || ! is_object($wp_filesystem) )
+		WP_Filesystem();
+
+	if ( ! is_object($wp_filesystem) )
+		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
+
+	if ( $wp_filesystem-&gt;errors-&gt;get_error_code() )
+		return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem-&gt;errors);
+
+	//Get the base plugin folder
+	$themes_dir = $wp_filesystem-&gt;wp_themes_dir();
+	if ( empty($themes_dir) )
+		return new WP_Error('fs_no_themes_dir', __('Unable to locate WordPress Theme directory.'));
+
+	//And the same for the Content directory.
+	$content_dir = $wp_filesystem-&gt;wp_content_dir();
+	if( empty($content_dir) )
+		return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
+
+	$themes_dir = trailingslashit( $themes_dir );
+	$content_dir = trailingslashit( $content_dir );
+
+	if ( empty($r-&gt;package) )
+		return new WP_Error('no_package', __('Upgrade package not available.'));
+
+	// Download the package
+	apply_filters('update_feedback', sprintf(__('Downloading update from %s'), $r['package']));
+	$download_file = download_url($r['package']);
+
+	if ( is_wp_error($download_file) )
+		return new WP_Error('download_failed', __('Download failed.'), $download_file-&gt;get_error_message());
+
+	$working_dir = $content_dir . 'upgrade/' . basename($theme_directory);
+
+	// Clean up working directory
+	if ( $wp_filesystem-&gt;is_dir($working_dir) )
+		$wp_filesystem-&gt;delete($working_dir, true);
+
+	apply_filters('update_feedback', __('Unpacking the update'));
+	// Unzip package to working directory
+	$result = unzip_file($download_file, $working_dir);
+
+	// Once extracted, delete the package
+	unlink($download_file);
+
+	if ( is_wp_error($result) ) {
+		$wp_filesystem-&gt;delete($working_dir, true);
+		return $result;
+	}
+
+	//TODO: Is theme currently active? If so, set default theme
+	/*
+	if ( is_plugin_active($plugin) ) {
+		//Deactivate the plugin silently, Prevent deactivation hooks from running.
+		apply_filters('update_feedback', __('Deactivating the plugin'));
+		deactivate_plugins($plugin, true);
+	}*/
+
+	// Remove the existing plugin.
+	apply_filters('update_feedback', __('Removing the old version of the theme'));
+	$deleted = $wp_filesystem-&gt;delete($themes_dir . $theme_directory, true);
+
+	if ( ! $deleted ) {
+		$wp_filesystem-&gt;delete($working_dir, true);
+		return new WP_Error('delete_failed', __('Could not remove the old plugin'));
+	}
+
+	apply_filters('update_feedback', __('Installing the latest version'));
+	// Copy new version of plugin into place.
+	$result = copy_dir($working_dir, $themes_dir);
+	if ( is_wp_error($result) ) {
+		$wp_filesystem-&gt;delete($working_dir, true);
+		return $result;
+	}
+
+	//Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin
+	//$filelist = array_keys( $wp_filesystem-&gt;dirlist($working_dir) );
+
+	// Remove working directory
+	$wp_filesystem-&gt;delete($working_dir, true);
+
+	// Force refresh of plugin update information
+	delete_option('update_themes');
+
+	/*if( empty($filelist) )
+		return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
+
+	$folder = $filelist[0];
+	$plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash
+	$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
+
+	return  $folder . '/' . $pluginfiles[0];*/
+}
+
+
+function wp_update_core($current, $feedback = '') {
+	global $wp_filesystem;
+
+	@set_time_limit( 300 );
+
+	if ( !empty($feedback) )
+		add_filter('update_feedback', $feedback);
+
+	// Is an update available?
+	if ( !isset( $current-&gt;response ) || $current-&gt;response == 'latest' )
+		return new WP_Error('up_to_date', __('WordPress is at the latest version.'));
+
+	// Is a filesystem accessor setup?
+	if ( ! $wp_filesystem || ! is_object($wp_filesystem) )
+		WP_Filesystem();
+
+	if ( ! is_object($wp_filesystem) )
+		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
+
+	if ( $wp_filesystem-&gt;errors-&gt;get_error_code() )
+		return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem-&gt;errors);
+
+	// Get the base WP folder
+	$wp_dir = $wp_filesystem-&gt;abspath();
+	if ( empty($wp_dir) )
+		return new WP_Error('fs_no_wp_dir', __('Unable to locate WordPress directory.'));
+
+	// And the same for the Content directory.
+	$content_dir = $wp_filesystem-&gt;wp_content_dir();
+	if( empty($content_dir) )
+		return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
+
+	$wp_dir = trailingslashit( $wp_dir );
+	$content_dir = trailingslashit( $content_dir );
+
+	// Get the URL to the zip file
+	$package = $current-&gt;package;
+
+	// Download the package
+	apply_filters('update_feedback', sprintf(__('Downloading update from %s'), $package));
+	$download_file = download_url($package);
+
+	if ( is_wp_error($download_file) )
+		return new WP_Error('download_failed', __('Download failed.'), $download_file-&gt;get_error_message());
+
+	$working_dir = $content_dir . 'upgrade/core';
+	// Clean up working directory
+	if ( $wp_filesystem-&gt;is_dir($working_dir) ) {
+		$wp_filesystem-&gt;delete($working_dir, true);
+	}
+
+	apply_filters('update_feedback', __('Unpacking the core update'));
+	// Unzip package to working directory
+	$result = unzip_file($download_file, $working_dir);
+	// Once extracted, delete the package
+	unlink($download_file);
+
+	if ( is_wp_error($result) ) {
+		$wp_filesystem-&gt;delete($working_dir, true);
+		return $result;
+	}
+
+	// Copy update-core.php from the new version into place.
+	if ( !$wp_filesystem-&gt;copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true) ) {
+		$wp_filesystem-&gt;delete($working_dir, true);
+		return new WP_Error('copy_failed', __('Could not copy files'));
+	}
+	$wp_filesystem-&gt;chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE);
+
+	require(ABSPATH . 'wp-admin/includes/update-core.php');
+
+	return update_core($working_dir, $wp_dir);
+}
+
+function maintenance_nag() {
+	global $upgrading;
+	if ( ! isset( $upgrading ) )
+		return false;
+
+	if ( current_user_can('manage_options') )
+		$msg = sprintf( __('An automated WordPress update has failed to complete - &lt;a href=&quot;%s&quot;&gt;please attempt the update again now&lt;/a&gt;.'), 'update-core.php' );
+	else
+		$msg = __('An automated WordPress update has failed to complete! Please notify the site administrator.');
+
+	echo &quot;&lt;div id='update-nag'&gt;$msg&lt;/div&gt;&quot;;
+}
+add_action( 'admin_notices', 'maintenance_nag' );
+
 ?&gt;</diff>
      <filename>wp-admin/includes/update.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,38 @@
 &lt;?php
+/**
+ * WordPress Upgrade API
+ *
+ * Most of the functions are pluggable and can be overwritten
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
+/** Include user install customize script. */
 if ( file_exists(WP_CONTENT_DIR . '/install.php') )
 	require (WP_CONTENT_DIR . '/install.php');
+
+/** WordPress Administration API */
 require_once(ABSPATH . 'wp-admin/includes/admin.php');
+
+/** WordPress Schema API */
 require_once(ABSPATH . 'wp-admin/includes/schema.php');
 
 if ( !function_exists('wp_install') ) :
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param string $blog_title Blog title.
+ * @param string $user_name User's username.
+ * @param string $user_email User's email.
+ * @param bool $public Whether blog is public.
+ * @param null $deprecated Optional. Not used.
+ * @return array Array keys 'url', 'user_id', 'password'.
+ */
 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') {
 	global $wp_rewrite;
 
@@ -53,6 +80,15 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='
 endif;
 
 if ( !function_exists('wp_install_defaults') ) :
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ */
 function wp_install_defaults($user_id) {
 	global $wpdb;
 
@@ -107,6 +143,18 @@ function wp_install_defaults($user_id) {
 endif;
 
 if ( !function_exists('wp_new_blog_notification') ) :
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param string $blog_title Blog title.
+ * @param string $blog_url Blog url.
+ * @param int $user_id User ID.
+ * @param string $password User's Password.
+ */
 function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
 	$user = new WP_User($user_id);
 	$email = $user-&gt;user_email;
@@ -132,6 +180,15 @@ http://wordpress.org/
 endif;
 
 if ( !function_exists('wp_upgrade') ) :
+/**
+ * Run WordPress Upgrade functions.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @return null
+ */
 function wp_upgrade() {
 	global $wp_current_db_version, $wp_db_version;
 
@@ -141,6 +198,9 @@ function wp_upgrade() {
 	if ( $wp_db_version == $wp_current_db_version )
 		return;
 
+	if( ! is_blog_installed() )
+		return;
+
 	wp_check_mysql_version();
 	wp_cache_flush();
 	make_db_current_silent();
@@ -149,7 +209,13 @@ function wp_upgrade() {
 }
 endif;
 
-// Functions to be called in install and upgrade scripts
+/**
+ * Functions to be called in install and upgrade scripts.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ */
 function upgrade_all() {
 	global $wp_current_db_version, $wp_db_version, $wp_rewrite;
 	$wp_current_db_version = __get_option('db_version');
@@ -207,6 +273,9 @@ function upgrade_all() {
 	if ( $wp_current_db_version &lt; 8201 )
 		upgrade_260();
 
+	if ( $wp_current_db_version &lt; 8989 )
+		upgrade_270();
+
 	maybe_disable_automattic_widgets();
 
 	$wp_rewrite-&gt;flush_rules();
@@ -214,6 +283,11 @@ function upgrade_all() {
 	update_option('db_version', $wp_db_version);
 }
 
+/**
+ * Execute changes made in WordPress 1.0.
+ *
+ * @since 1.0.0
+ */
 function upgrade_100() {
 	global $wpdb;
 
@@ -236,7 +310,6 @@ function upgrade_100() {
 		}
 	}
 
-
 	$wpdb-&gt;query(&quot;UPDATE $wpdb-&gt;options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')
 	WHERE option_name LIKE 'links_rating_image%'
 	AND option_value LIKE 'wp-links/links-images/%'&quot;);
@@ -266,6 +339,11 @@ function upgrade_100() {
 	endif;
 }
 
+/**
+ * Execute changes made in WordPress 1.0.1.
+ *
+ * @since 1.0.1
+ */
 function upgrade_101() {
 	global $wpdb;
 
@@ -279,7 +357,11 @@ function upgrade_101() {
 	add_clean_index($wpdb-&gt;links , 'link_visible');
 }
 
-
+/**
+ * Execute changes made in WordPress 1.2.
+ *
+ * @since 1.2.0
+ */
 function upgrade_110() {
 	global $wpdb;
 
@@ -299,7 +381,6 @@ function upgrade_110() {
 		}
 	}
 
-
 	// Get the GMT offset, we'll use that later on
 	$all_options = get_alloptions_110();
 
@@ -336,6 +417,11 @@ function upgrade_110() {
 
 }
 
+/**
+ * Execute changes made in WordPress 1.5.
+ *
+ * @since 1.5.0
+ */
 function upgrade_130() {
 	global $wpdb;
 
@@ -413,6 +499,11 @@ function upgrade_130() {
 	make_site_theme();
 }
 
+/**
+ * Execute changes made in WordPress 2.0.
+ *
+ * @since 2.0.0
+ */
 function upgrade_160() {
 	global $wpdb, $wp_current_db_version;
 
@@ -491,6 +582,11 @@ function upgrade_160() {
 	}
 }
 
+/**
+ * Execute changes made in WordPress 2.1.
+ *
+ * @since 2.1.0
+ */
 function upgrade_210() {
 	global $wpdb, $wp_current_db_version;
 
@@ -530,6 +626,11 @@ function upgrade_210() {
 	}
 }
 
+/**
+ * Execute changes made in WordPress 2.3.
+ *
+ * @since 2.3.0
+ */
 function upgrade_230() {
 	global $wp_current_db_version, $wpdb;
 
@@ -568,7 +669,7 @@ function upgrade_230() {
 			}
 		}
 
-		$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;INSERT INTO $wpdb-&gt;terms (term_id, name, slug, term_group) VALUES 
+		$wpdb-&gt;query( $wpdb-&gt;prepare(&quot;INSERT INTO $wpdb-&gt;terms (term_id, name, slug, term_group) VALUES
 		(%d, %s, %s, %d)&quot;, $term_id, $name, $slug, $term_group) );
 
 		$count = 0;
@@ -700,6 +801,11 @@ function upgrade_230() {
 	}
 }
 
+/**
+ * Remove old options from the database.
+ *
+ * @since 2.3.0
+ */
 function upgrade_230_options_table() {
 	global $wpdb;
 	$old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' );
@@ -709,6 +815,11 @@ function upgrade_230_options_table() {
 	$wpdb-&gt;show_errors();
 }
 
+/**
+ * Remove old categories, link2cat, and post2cat database tables.
+ *
+ * @since 2.3.0
+ */
 function upgrade_230_old_tables() {
 	global $wpdb;
 	$wpdb-&gt;query('DROP TABLE IF EXISTS ' . $wpdb-&gt;prefix . 'categories');
@@ -716,22 +827,36 @@ function upgrade_230_old_tables() {
 	$wpdb-&gt;query('DROP TABLE IF EXISTS ' . $wpdb-&gt;prefix . 'post2cat');
 }
 
+/**
+ * Upgrade old slugs made in version 2.2.
+ *
+ * @since 2.2.0
+ */
 function upgrade_old_slugs() {
 	// upgrade people who were using the Redirect Old Slugs plugin
 	global $wpdb;
 	$wpdb-&gt;query(&quot;UPDATE $wpdb-&gt;postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'&quot;);
 }
 
-
+/**
+ * Execute changes made in WordPress 2.5.0.
+ *
+ * @since 2.5.0
+ */
 function upgrade_250() {
 	global $wp_current_db_version;
 
 	if ( $wp_current_db_version &lt; 6689 ) {
 		populate_roles_250();
 	}
-	
+
 }
 
+/**
+ * Execute changes made in WordPress 2.5.1.
+ *
+ * @since 2.5.1
+ */
 function upgrade_251() {
 	global $wp_current_db_version;
 
@@ -739,13 +864,25 @@ function upgrade_251() {
 	update_option('secret', wp_generate_password(64));
 }
 
+/**
+ * Execute changes made in WordPress 2.5.2.
+ *
+ * @since 2.5.2
+ */
 function upgrade_252() {
 	global $wpdb;
 
 	$wpdb-&gt;query(&quot;UPDATE $wpdb-&gt;users SET user_activation_key = ''&quot;);
 }
 
+/**
+ * Execute changes made in WordPress 2.6.
+ *
+ * @since 2.6.0
+ */
 function upgrade_260() {
+	global $wp_current_db_version;
+
 	if ( $wp_current_db_version &lt; 8000 )
 		populate_roles_260();
 
@@ -755,9 +892,38 @@ function upgrade_260() {
 	}
 }
 
+/**
+ * Execute changes made in WordPress 2.7.
+ *
+ * @since 2.7.0
+ */
+function upgrade_270() {
+	global $wpdb, $wp_current_db_version;
+
+	if ( $wp_current_db_version &lt; 8980 )
+		populate_roles_270();
+
+	// Update post_date for unpublished posts with empty timestamp
+	if ( $wp_current_db_version &lt; 8921 )
+		$wpdb-&gt;query( &quot;UPDATE $wpdb-&gt;posts SET post_date = post_modified WHERE post_date = '0000-00-00 00:00:00'&quot; );
+}
+
+
 // The functions we use to actually do stuff
 
 // General
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param string $table_name Database table name to create.
+ * @param string $create_ddl SQL statement to create table.
+ * @return bool If table already exists or was created by function.
+ */
 function maybe_create_table($table_name, $create_ddl) {
 	global $wpdb;
 	foreach ($wpdb-&gt;get_col(&quot;SHOW TABLES&quot;,0) as $table ) {
@@ -776,6 +942,17 @@ function maybe_create_table($table_name, $create_ddl) {
 	return false;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param string $table Database table name.
+ * @param string $index Index name to drop.
+ * @return bool True, when finished.
+ */
 function drop_index($table, $index) {
 	global $wpdb;
 	$wpdb-&gt;hide_errors();
@@ -788,6 +965,17 @@ function drop_index($table, $index) {
 	return true;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param string $table Database table name.
+ * @param string $index Database table index column.
+ * @return bool True, when done with execution.
+ */
 function add_clean_index($table, $index) {
 	global $wpdb;
 	drop_index($table, $index);
@@ -820,8 +1008,13 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
 	return false;
 }
 
-
-// get_alloptions as it was for 1.2.
+/**
+ * Retrieve all options as it was for 1.2.
+ *
+ * @since 1.2.0
+ *
+ * @return array List of options.
+ */
 function get_alloptions_110() {
 	global $wpdb;
 	if ($options = $wpdb-&gt;get_results(&quot;SELECT option_name, option_value FROM $wpdb-&gt;options&quot;)) {
@@ -837,7 +1030,15 @@ function get_alloptions_110() {
 	return $all_options;
 }
 
-// Version of get_option that is private to install/upgrade.
+/**
+ * Version of get_option that is private to install/upgrade.
+ *
+ * @since unknown
+ * @access private
+ *
+ * @param string $setting Option name.
+ * @return mixed
+ */
 function __get_option($setting) {
 	global $wpdb;
 
@@ -864,6 +1065,16 @@ function __get_option($setting) {
 		return $option;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param string $content
+ * @return string
+ */
 function deslash($content) {
 	// Note: \\\ inside a regex denotes a single backslash.
 
@@ -881,6 +1092,17 @@ function deslash($content) {
 	return $content;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $queries
+ * @param unknown_type $execute
+ * @return unknown
+ */
 function dbDelta($queries, $execute = true) {
 	global $wpdb;
 
@@ -1082,6 +1304,13 @@ function dbDelta($queries, $execute = true) {
 	return $for_update;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ */
 function make_db_current() {
 	global $wp_queries;
 
@@ -1091,12 +1320,30 @@ function make_db_current() {
 	echo &quot;&lt;/ol&gt;\n&quot;;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ */
 function make_db_current_silent() {
 	global $wp_queries;
 
 	$alterations = dbDelta($wp_queries);
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $theme_name
+ * @param unknown_type $template
+ * @return unknown
+ */
 function make_site_theme_from_oldschool($theme_name, $template) {
 	$home_path = get_home_path();
 	$site_dir = WP_CONTENT_DIR . &quot;/themes/$template&quot;;
@@ -1165,6 +1412,17 @@ function make_site_theme_from_oldschool($theme_name, $template) {
 	return true;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $theme_name
+ * @param unknown_type $template
+ * @return unknown
+ */
 function make_site_theme_from_default($theme_name, $template) {
 	$site_dir = WP_CONTENT_DIR . &quot;/themes/$template&quot;;
 	$default_dir = WP_CONTENT_DIR . '/themes/default';
@@ -1220,6 +1478,15 @@ function make_site_theme_from_default($theme_name, $template) {
 }
 
 // Create a site theme from the default theme.
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function make_site_theme() {
 	// Name the theme after the blog.
 	$theme_name = __get_option('blogname');
@@ -1261,6 +1528,14 @@ function make_site_theme() {
 	return $template;
 }
 
+/**
+ * Translate user level to user role name.
+ *
+ * @since unknown
+ *
+ * @param int $level User level.
+ * @return string User role name.
+ */
 function translate_level_to_role($level) {
 	switch ($level) {
 	case 10:
@@ -1282,6 +1557,13 @@ function translate_level_to_role($level) {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ */
 function wp_check_mysql_version() {
 	global $wpdb;
 	$result = $wpdb-&gt;check_database_version();
@@ -1289,6 +1571,13 @@ function wp_check_mysql_version() {
 		die( $result-&gt;get_error_message() );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ */
 function maybe_disable_automattic_widgets() {
 	$plugins = __get_option( 'active_plugins' );
 </diff>
      <filename>wp-admin/includes/upgrade.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,21 @@
 &lt;?php
-
-// Creates a new user from the &quot;Users&quot; form using $_POST information.
+/**
+ * WordPress user administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Creates a new user from the &quot;Users&quot; form using $_POST information.
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param int $user_id Optional. User ID.
+ * @return null|WP_Error|int Null when adding user, WP_Error or User ID integer when no parameters.
+ */
 function add_user() {
 	if ( func_num_args() ) { // The hackiest hack that ever did hack
 		global $current_user, $wp_roles;
@@ -18,6 +33,16 @@ function add_user() {
 	}
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param int $user_id Optional. User ID.
+ * @return unknown
+ */
 function edit_user( $user_id = 0 ) {
 	global $current_user, $wp_roles, $wpdb;
 	if ( $user_id != 0 ) {
@@ -71,7 +96,13 @@ function edit_user( $user_id = 0 ) {
 	else if ( isset( $_POST['rich_editing'] ) )
 		$user-&gt;rich_editing = $_POST['rich_editing'];
 	else
-		$user-&gt;rich_editing = 'false';
+		$user-&gt;rich_editing = 'true';
+
+	$user-&gt;comment_shortcuts = isset( $_POST['comment_shortcuts'] )? $_POST['comment_shortcuts'] : '';
+
+	$user-&gt;use_ssl = 0;
+	if ( !empty($_POST['use_ssl']) )
+		$user-&gt;use_ssl = 1;
 
 	if ( !$update )
 		$user-&gt;admin_color = 'fresh';  // Default to fresh for new users.
@@ -138,12 +169,31 @@ function edit_user( $user_id = 0 ) {
 	return $user_id;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @return array List of user IDs.
+ */
 function get_author_user_ids() {
 	global $wpdb;
 	$level_key = $wpdb-&gt;prefix . 'user_level';
 	return $wpdb-&gt;get_col( $wpdb-&gt;prepare(&quot;SELECT user_id FROM $wpdb-&gt;usermeta WHERE meta_key = %s AND meta_value != '0'&quot;, $level_key) );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ * @return array|bool List of editable authors. False if no editable users.
+ */
 function get_editable_authors( $user_id ) {
 	global $wpdb;
 
@@ -159,13 +209,24 @@ function get_editable_authors( $user_id ) {
 	return apply_filters('get_editable_authors', $authors);
 }
 
-function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
+ * @return unknown
+ */
+function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
 	global $wpdb;
 
 	$user = new WP_User( $user_id );
 
-	if ( ! $user-&gt;has_cap('edit_others_posts') ) {
-		if ( $user-&gt;has_cap('edit_posts') || $exclude_zeros == false )
+	if ( ! $user-&gt;has_cap(&quot;edit_others_{$post_type}s&quot;) ) {
+		if ( $user-&gt;has_cap(&quot;edit_{$post_type}s&quot;) || $exclude_zeros == false )
 			return array($user-&gt;id);
 		else
 			return false;
@@ -180,6 +241,15 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
 	return $wpdb-&gt;get_col( $query );
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since unknown
+ *
+ * @return unknown
+ */
 function get_nonauthor_user_ids() {
 	global $wpdb;
 	$level_key = $wpdb-&gt;prefix . 'user_level';
@@ -187,6 +257,15 @@ function get_nonauthor_user_ids() {
 	return $wpdb-&gt;get_col( $wpdb-&gt;prepare(&quot;SELECT user_id FROM $wpdb-&gt;usermeta WHERE meta_key = %s AND meta_value = '0'&quot;, $level_key) );
 }
 
+/**
+ * Retrieve editable posts from other users.
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID to not retrieve posts from.
+ * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
+ * @return array List of posts from others.
+ */
 function get_others_unpublished_posts($user_id, $type='any') {
 	global $wpdb;
 
@@ -209,14 +288,38 @@ function get_others_unpublished_posts($user_id, $type='any') {
 	return apply_filters('get_others_drafts', $other_unpubs);
 }
 
+/**
+ * Retrieve drafts from other users.
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ * @return array List of drafts from other users.
+ */
 function get_others_drafts($user_id) {
 	return get_others_unpublished_posts($user_id, 'draft');
 }
 
+/**
+ * Retrieve pending review posts from other users.
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ * @return array List of posts with pending review post type from other users.
+ */
 function get_others_pending($user_id) {
 	return get_others_unpublished_posts($user_id, 'pending');
 }
 
+/**
+ * Retrieve user data and filter it.
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ * @return object WP_User object with user data.
+ */
 function get_user_to_edit( $user_id ) {
 	$user = new WP_User( $user_id );
 	$user-&gt;user_login   = attribute_escape($user-&gt;user_login);
@@ -226,14 +329,22 @@ function get_user_to_edit( $user_id ) {
 	$user-&gt;last_name    = attribute_escape($user-&gt;last_name);
 	$user-&gt;display_name = attribute_escape($user-&gt;display_name);
 	$user-&gt;nickname     = attribute_escape($user-&gt;nickname);
-	$user-&gt;aim          = attribute_escape($user-&gt;aim);
-	$user-&gt;yim          = attribute_escape($user-&gt;yim);
-	$user-&gt;jabber       = attribute_escape($user-&gt;jabber);
-	$user-&gt;description  =  wp_specialchars($user-&gt;description);
+	$user-&gt;aim          = isset( $user-&gt;aim ) &amp;&amp; !empty( $user-&gt;aim ) ? attribute_escape($user-&gt;aim) : '';
+	$user-&gt;yim          = isset( $user-&gt;yim ) &amp;&amp; !empty( $user-&gt;yim ) ? attribute_escape($user-&gt;yim) : '';
+	$user-&gt;jabber       = isset( $user-&gt;jabber ) &amp;&amp; !empty( $user-&gt;jabber ) ? attribute_escape($user-&gt;jabber) : '';
+	$user-&gt;description  = isset( $user-&gt;description ) &amp;&amp; !empty( $user-&gt;description ) ? wp_specialchars($user-&gt;description) : '';
 
 	return $user;
 }
 
+/**
+ * Retrieve the user's drafts.
+ *
+ * @since unknown
+ *
+ * @param int $user_id User ID.
+ * @return array
+ */
 function get_users_drafts( $user_id ) {
 	global $wpdb;
 	$query = $wpdb-&gt;prepare(&quot;SELECT ID, post_title FROM $wpdb-&gt;posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC&quot;, $user_id);
@@ -241,6 +352,20 @@ function get_users_drafts( $user_id ) {
 	return $wpdb-&gt;get_results( $query );
 }
 
+/**
+ * Remove user and optionally reassign posts and links to another user.
+ *
+ * If the $reassign parameter is not assigned to an User ID, then all posts will
+ * be deleted of that user. The action 'delete_user' that is passed the User ID
+ * being deleted will be run after the posts are either reassigned or deleted.
+ * The user meta will also be deleted that are for that User ID.
+ *
+ * @since unknown
+ *
+ * @param int $id User ID.
+ * @param int $reassign Optional. Reassign posts and links to new User ID.
+ * @return bool True when finished.
+ */
 function wp_delete_user($id, $reassign = 'novalue') {
 	global $wpdb;
 
@@ -275,6 +400,13 @@ function wp_delete_user($id, $reassign = 'novalue') {
 	return true;
 }
 
+/**
+ * Remove all capabilities from user.
+ *
+ * @since unknown
+ *
+ * @param int $id User ID.
+ */
 function wp_revoke_user($id) {
 	$id = (int) $id;
 
@@ -282,27 +414,161 @@ function wp_revoke_user($id) {
 	$user-&gt;remove_all_caps();
 }
 
-// WP_User_Search class
-// by Mark Jaquith
-
 if ( !class_exists('WP_User_Search') ) :
+/**
+ * WordPress User Search class.
+ *
+ * @since unknown
+ * @author Mark Jaquith
+ */
 class WP_User_Search {
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $results;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $search_term;
+
+	/**
+	 * Page number.
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var int
+	 */
 	var $page;
+
+	/**
+	 * Role name that users have.
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var string
+	 */
 	var $role;
+
+	/**
+	 * Raw page number.
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var int|bool
+	 */
 	var $raw_page;
+
+	/**
+	 * Amount of users to display per page.
+	 *
+	 * @since unknown
+	 * @access public
+	 * @var int
+	 */
 	var $users_per_page = 50;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $first_user;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var int
+	 */
 	var $last_user;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $query_limit;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $query_sort;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $query_from_where;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var int
+	 */
 	var $total_users_for_query = 0;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var bool
+	 */
 	var $too_many_total_users = false;
+
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
 	var $search_errors;
 
-	function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor
+	/**
+	 * {@internal Missing Description}}
+	 *
+	 * @since unknown
+	 * @access private
+	 * @var unknown_type
+	 */
+	var $paging_text;
+
+	/**
+	 * PHP4 Constructor - Sets up the object properties.
+	 *
+	 * @since unknown
+	 *
+	 * @param string $search_term Search terms string.
+	 * @param int $page Optional. Page ID.
+	 * @param string $role Role name.
+	 * @return WP_User_Search
+	 */
+	function WP_User_Search ($search_term = '', $page = '', $role = '') {
 		$this-&gt;search_term = $search_term;
 		$this-&gt;raw_page = ( '' == $page ) ? false : (int) $page;
 		$this-&gt;page = (int) ( '' == $page ) ? 1 : $page;
@@ -314,6 +580,14 @@ class WP_User_Search {
 		$this-&gt;do_paging();
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since unknown
+	 * @access public
+	 */
 	function prepare_query() {
 		global $wpdb;
 		$this-&gt;first_user = ($this-&gt;page - 1) * $this-&gt;users_per_page;
@@ -338,6 +612,14 @@ class WP_User_Search {
 
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since unknown
+	 * @access public
+	 */
 	function query() {
 		global $wpdb;
 		$this-&gt;results = $wpdb-&gt;get_col('SELECT ID ' . $this-&gt;query_from_where . $this-&gt;query_sort . $this-&gt;query_limit);
@@ -348,10 +630,26 @@ class WP_User_Search {
 			$this-&gt;search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!'));
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since unknown
+	 * @access public
+	 */
 	function prepare_vars_for_template_usage() {
 		$this-&gt;search_term = stripslashes($this-&gt;search_term); // done with DB, from now on we want slashes gone
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since unknown
+	 * @access public
+	 */
 	function do_paging() {
 		if ( $this-&gt;total_users_for_query &gt; $this-&gt;users_per_page ) { // have to page the results
 			$args = array();
@@ -367,23 +665,67 @@ class WP_User_Search {
 				'format' =&gt; 'userspage=%#%',
 				'add_args' =&gt; $args
 			) );
+			if ( $this-&gt;paging_text ) {
+				$this-&gt;paging_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
+					number_format_i18n( ( $this-&gt;page - 1 ) * $this-&gt;users_per_page + 1 ),
+					number_format_i18n( min( $this-&gt;page * $this-&gt;users_per_page, $this-&gt;total_users_for_query ) ),
+					number_format_i18n( $this-&gt;total_users_for_query ),
+					$this-&gt;paging_text
+				);
+			}
 		}
 	}
 
+	/**
+	 * {@internal Missing Short Description}}
+	 *
+	 * {@internal Missing Long Description}}
+	 *
+	 * @since unknown
+	 * @access public
+	 *
+	 * @return unknown
+	 */
 	function get_results() {
 		return (array) $this-&gt;results;
 	}
 
+	/**
+	 * Displaying paging text.
+	 *
+	 * @see do_paging() Builds paging text.
+	 *
+	 * @since unknown
+	 * @access public
+	 */
 	function page_links() {
 		echo $this-&gt;paging_text;
 	}
 
+	/**
+	 * Whether paging is enabled.
+	 *
+	 * @see do_paging() Builds paging text.
+	 *
+	 * @since unknown
+	 * @access public
+	 *
+	 * @return bool
+	 */
 	function results_are_paged() {
 		if ( $this-&gt;paging_text )
 			return true;
 		return false;
 	}
 
+	/**
+	 * Whether there are search terms.
+	 *
+	 * @since unknown
+	 * @access public
+	 *
+	 * @return bool
+	 */
 	function is_search() {
 		if ( $this-&gt;search_term )
 			return true;</diff>
      <filename>wp-admin/includes/user.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,21 @@
 &lt;?php
+/**
+ * WordPress Widgets Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
-// $_search is unsanitized
+/**
+ * Display list of widgets, either all or matching search.
+ *
+ * The search parameter are search terms separated by spaces.
+ *
+ * @since unknown
+ *
+ * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'.
+ * @param string $_search Optional. Search for widgets. Should be unsanitized.
+ */
 function wp_list_widgets( $show = 'all', $_search = false ) {
 	global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
 	if ( $_search ) {
@@ -46,9 +61,11 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
 			if ( ( 'unused' == $show &amp;&amp; $sidebar ) || ( 'used' == $show &amp;&amp; !$sidebar ) )
 				continue;
 
+			if ( ! isset( $widget['params'][0] ) )
+				$widget['params'][0] = array();
 			ob_start();
-				$args = wp_list_widget_controls_dynamic_sidebar( array( 0 =&gt; array( 'widget_id' =&gt; $widget['id'], 'widget_name' =&gt; $widget['name'], '_display' =&gt; 'template', '_show' =&gt; $show ), 1 =&gt; $widget['params'][0] ) );
-				$sidebar_args = call_user_func_array( 'wp_widget_control', $args );
+			$args = wp_list_widget_controls_dynamic_sidebar( array( 0 =&gt; array( 'widget_id' =&gt; $widget['id'], 'widget_name' =&gt; $widget['name'], '_display' =&gt; 'template', '_show' =&gt; $show ), 1 =&gt; $widget['params'][0] ) );
+			$sidebar_args = call_user_func_array( 'wp_widget_control', $args );
 			$widget_control_template = ob_get_contents();
 			ob_end_clean();
 
@@ -84,7 +101,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
 					'edit' =&gt; $widget['id'],
 					'key' =&gt; array_search( $widget['id'], $sidebars_widgets[$sidebar] ),
 				) ) );
-				
+
 				$widget_control_template = '&lt;textarea rows=&quot;1&quot; cols=&quot;1&quot;&gt;' . htmlspecialchars( $widget_control_template ) . '&lt;/textarea&gt;';
 			}
 
@@ -148,8 +165,13 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
 &lt;?php
 }
 
-
-
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param string $sidebar
+ */
 function wp_list_widget_controls( $sidebar ) {
 	add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
 ?&gt;
@@ -163,7 +185,14 @@ function wp_list_widget_controls( $sidebar ) {
 &lt;?php
 }
 
-
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param array $params
+ * @return array
+ */
 function wp_list_widget_controls_dynamic_sidebar( $params ) {
 	global $wp_registered_widgets;
 	static $i = 0;
@@ -182,15 +211,22 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) {
 	return $params;
 }
 
-/*
- * Meta widget used to display the control form for a widget.  Called from dynamic_sidebar()
+/**
+ * Meta widget used to display the control form for a widget.
+ *
+ * Called from dynamic_sidebar().
+ *
+ * @since unknown
+ *
+ * @param array $sidebar_args
+ * @return array
  */
 function wp_widget_control( $sidebar_args ) {
 	global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget;
 	$widget_id = $sidebar_args['widget_id'];
 	$sidebar_id = isset($sidebar_args['id']) ? $sidebar_args['id'] : false;
 
-	$control = $wp_registered_widget_controls[$widget_id];
+	$control = isset($wp_registered_widget_controls[$widget_id]) ? $wp_registered_widget_controls[$widget_id] : 0;
 	$widget  = $wp_registered_widgets[$widget_id];
 
 	$key = $sidebar_id ? array_search( $widget_id, $sidebars_widgets[$sidebar_id] ) : 'no-key'; // position of widget in sidebar
@@ -198,6 +234,13 @@ function wp_widget_control( $sidebar_args ) {
 	$edit = -1 &lt;  $edit_widget &amp;&amp; is_numeric($key) &amp;&amp; $edit_widget === $key; // (bool) are we currently editing this widget
 
 	$id_format = $widget['id'];
+
+	if ( ! isset( $sidebar_args['_show'] ) )
+		$sidebar_args['_show'] = '';
+
+	if ( ! isset( $sidebar_args['_display'] ) )
+		$sidebar_args['_display'] = '';
+
 	// We aren't showing a widget control, we're outputing a template for a mult-widget control
 	if ( 'all' == $sidebar_args['_show'] &amp;&amp; 'template' == $sidebar_args['_display'] &amp;&amp; isset($control['params'][0]['number']) ) {
 		// number == -1 implies a template where id numbers are replaced by a generic '%i%'
@@ -262,11 +305,11 @@ function wp_widget_control( $sidebar_args ) {
 
 				&lt;?php if ( $control ) : ?&gt;
 
-				&lt;a class=&quot;widget-action widget-control-save wp-no-js-hidden edit alignleft&quot; href=&quot;#save:&lt;?php echo $id_format; ?&gt;&quot;&gt;&lt;?php _e('Change'); ?&gt;&lt;/a&gt;
+				&lt;a class=&quot;button widget-action widget-control-save hide-if-no-js edit alignleft&quot; href=&quot;#save:&lt;?php echo $id_format; ?&gt;&quot;&gt;&lt;?php _e('Done'); ?&gt;&lt;/a&gt;
 
 				&lt;?php endif; ?&gt;
 
-				&lt;a class=&quot;widget-action widget-control-remove delete alignright&quot; href=&quot;&lt;?php echo clean_url( wp_nonce_url( add_query_arg( array( 'remove' =&gt; $id_format, 'key' =&gt; $key ) ), &quot;remove-widget_$widget[id]&quot; ) ); ?&gt;&quot;&gt;&lt;?php _e('Remove'); ?&gt;&lt;/a&gt;
+				&lt;a class=&quot;button widget-action widget-control-remove alignright&quot; href=&quot;&lt;?php echo clean_url( wp_nonce_url( add_query_arg( array( 'remove' =&gt; $id_format, 'key' =&gt; $key ) ), &quot;remove-widget_$widget[id]&quot; ) ); ?&gt;&quot;&gt;&lt;?php _e('Remove'); ?&gt;&lt;/a&gt;
 				&lt;br class=&quot;clear&quot; /&gt;
 			&lt;/div&gt;
 		&lt;/div&gt;
@@ -276,6 +319,14 @@ function wp_widget_control( $sidebar_args ) {
 	return $sidebar_args;
 }
 
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param string $string
+ * @return string
+ */
 function wp_widget_control_ob_filter( $string ) {
 	if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) )
 		return '';
@@ -286,4 +337,4 @@ function wp_widget_control_ob_filter( $string ) {
 	return trim( wp_specialchars( strip_tags( $string ) ) );
 }
 
-?&gt;
+?&gt;
\ No newline at end of file</diff>
      <filename>wp-admin/includes/widgets.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,40 @@
 &lt;?php
+/**
+ * Handle default dashboard widgets options AJAX.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Bootstrap */
 require_once('admin.php');
+
+/** Load WordPress Administration Dashboard API */
 require( 'inclu