<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15954] trunk/wp-admin: Shuffle list-table files.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15954">15954</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-10-25 00:12:41 +0000 (Mon, 25 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Shuffle list-table files. First pass. see <a href="http://trac.wordpress.org/ticket/14579">#14579</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminincludesadminphp">trunk/wp-admin/includes/admin.php</a></li>
<li><a href="#trunkwpadminincludesdefaultlisttablesphp">trunk/wp-admin/includes/default-list-tables.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswplisttablephp">trunk/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunkwpadminincludeslisttablepostsphp">trunk/wp-admin/includes/list-table-posts.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpadminincludeslisttablephp">trunk/wp-admin/includes/list-table.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (15953 => 15954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-10-24 21:45:35 UTC (rev 15953)
+++ trunk/wp-admin/admin-ajax.php        2010-10-25 00:12:41 UTC (rev 15954)
</span><span class="lines">@@ -52,6 +52,8 @@
</span><span class="cx"> switch ( $action = $_GET['action'] ) :
</span><span class="cx"> case 'fetch-list' :
</span><span class="cx">         require_once( ABSPATH . '/wp-admin/includes/default-list-tables.php' );
</span><ins>+        // Temp
+        require_once( ABSPATH . '/wp-admin/includes/list-table-posts.php' );
</ins><span class="cx"> 
</span><span class="cx">         $class = $_GET['list_args']['class'];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludesadminphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/admin.php (15953 => 15954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/admin.php        2010-10-24 21:45:35 UTC (rev 15953)
+++ trunk/wp-admin/includes/admin.php        2010-10-25 00:12:41 UTC (rev 15954)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> require_once(ABSPATH . 'wp-admin/includes/template.php');
</span><span class="cx"> 
</span><span class="cx"> /** WordPress List Table Administration API */
</span><del>-require_once(ABSPATH . 'wp-admin/includes/list-table.php');
</del><ins>+require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
</ins><span class="cx"> 
</span><span class="cx"> /** WordPress Theme Administration API */
</span><span class="cx"> require_once(ABSPATH . 'wp-admin/includes/theme.php');
</span></span></pre></div>
<a id="trunkwpadminincludesclasswplisttablephpfromrev15953trunkwpadminincludeslisttablephp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/includes/class-wp-list-table.php (from rev 15953, trunk/wp-admin/includes/list-table.php) (0 => 15954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-list-table.php                                (rev 0)
+++ trunk/wp-admin/includes/class-wp-list-table.php        2010-10-25 00:12:41 UTC (rev 15954)
</span><span class="lines">@@ -0,0 +1,831 @@
</span><ins>+&lt;?php
+
+/**
+ * Base class for displaying a list of items as an ajaxified html table
+ *
+ * @package WordPress
+ * @since 3.1.0
+ */
+class WP_List_Table {
+
+        /**
+         * The current list of items
+         *
+         * @since 3.1.0
+         * @var array
+         * @access protected
+         */
+        var $items;
+
+        /**
+         * Various information about the current table
+         *
+         * @since 3.1.0
+         * @var array
+         * @access private
+         */
+        var $_args;
+
+        /**
+         * Various information needed for displaying the pagination
+         *
+         * @since 3.1.0
+         * @var array
+         * @access private
+         */
+        var $_pagination_args = array();
+
+        /**
+         * The current screen
+         *
+         * @since 3.1.0
+         * @var object
+         * @access private
+         */
+        var $_screen;
+
+        /**
+         * Cached bulk actions
+         *
+         * @since 3.1.0
+         * @var array
+         * @access private
+         */
+        var $_actions;
+
+        /**
+         * Cached pagination output
+         *
+         * @since 3.1.0
+         * @var string
+         * @access private
+         */
+        var $_pagination;
+
+        /**
+         * Constructor. The child class should call this constructor from it's own constructor
+         *
+         * @param array $args An associative array with information about the current table
+         * @access protected
+         */
+        function WP_List_Table( $args ) {
+                $args = wp_parse_args( $args, array(
+                        'screen' =&gt; '',
+                        'plural' =&gt; '',
+                        'singular' =&gt; '',
+                        'ajax' =&gt; true
+                ) );
+
+                $this-&gt;_screen = $args['screen'];
+
+                if ( is_string( $this-&gt;_screen ) )
+                        $this-&gt;_screen = convert_to_screen( $this-&gt;_screen );
+
+                add_filter( 'manage_' . $this-&gt;_screen-&gt;id . '_columns', array( $this, 'get_columns' ), 0 );
+
+                if ( !$args['plural'] )
+                        $args['plural'] = $this-&gt;_screen-&gt;base;
+
+                $this-&gt;_args = $args;
+
+                if ( $args['ajax'] ) {
+                        wp_enqueue_script( 'list-table' );
+                        add_action( 'admin_footer', array( $this, '_js_vars' ) );
+                }
+        }
+
+        /**
+         * Checks the current user's permissions
+         * @uses wp_die()
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function check_permissions() {
+                die( 'function WP_List_Table::check_permissions() must be over-ridden in a sub-class.' );
+        }
+
+        /**
+         * Prepares the list of items for displaying.
+         * @uses WP_List_Table::set_pagination_args()
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function prepare_items() {
+                die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
+        }
+
+        /**
+         * An internal method that sets all the necessary pagination arguments
+         *
+         * @param array $args An associative array with information about the pagination
+         * @access protected
+         */
+        function set_pagination_args( $args ) {
+                $args = wp_parse_args( $args, array(
+                        'query_var' =&gt; 'paged',
+                        'total_items' =&gt; 0,
+                        'total_pages' =&gt; 0,
+                        'per_page' =&gt; 0,
+                ) );
+
+                if ( !$args['total_pages'] &amp;&amp; $args['per_page'] &gt; 0 )
+                        $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
+
+                $this-&gt;_pagination_args = $args;
+        }
+
+        /**
+         * Access the pagination args
+         *
+         * @since 3.1.0
+         * @access public
+         *
+         * @param string $key
+         * @return array
+         */
+        function get_pagination_arg( $key ) {
+                if ( 'page' == $key )
+                        return $this-&gt;get_pagenum();
+
+                if ( isset( $this-&gt;_pagination_args[$key] ) )
+                        return $this-&gt;_pagination_args[$key];
+        }
+
+        /**
+         * Whether the table has items to display or not
+         *
+         * @since 3.1.0
+         * @access public
+         *
+         * @return bool
+         */
+        function has_items() {
+                return !empty( $this-&gt;items );
+        }
+
+        /**
+         * Message to be displayed when there are no items
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function no_items() {
+                _e( 'No items found.' );
+        }
+
+        /**
+         * Get an associative array ( id =&gt; link ) with the list
+         * of views available on this table.
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return array
+         */
+        function get_views() {
+                return array();
+        }
+
+        /**
+         * Display the bulk actions dropdown.
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function views() {
+                $views = $this-&gt;get_views();
+                $views = apply_filters( 'views_' . $this-&gt;_screen-&gt;base, $views );
+
+                if ( empty( $views ) )
+                        return;
+
+                echo &quot;&lt;ul class='subsubsub'&gt;\n&quot;;
+                echo implode( &quot; |&lt;/li&gt;\n&quot;, $views ) . &quot;&lt;/li&gt;\n&quot;;
+                echo &quot;&lt;/ul&gt;&quot;;
+        }
+
+        /**
+         * Get an associative array ( option_name =&gt; option_title ) with the list
+         * of bulk actions available on this table.
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return array
+         */
+        function get_bulk_actions() {
+                return array();
+        }
+
+        /**
+         * Display the bulk actions dropdown.
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function bulk_actions() {
+
+                if ( is_null( $this-&gt;_actions ) ) {
+                        $this-&gt;_actions = $this-&gt;get_bulk_actions();
+                        $this-&gt;_actions = apply_filters( 'bulk_actions-' . $this-&gt;_screen-&gt;base, $this-&gt;_actions );
+                        $two = '';
+                }
+                else {
+                        $two = '2';
+                }
+
+                if ( empty( $this-&gt;_actions ) )
+                        return;
+
+                echo &quot;&lt;select name='action$two'&gt;\n&quot;;
+                echo &quot;&lt;option value='-1' selected='selected'&gt;&quot; . __( 'Bulk Actions' ) . &quot;&lt;/option&gt;\n&quot;;
+                foreach ( $this-&gt;_actions as $name =&gt; $title )
+                        echo &quot;\t&lt;option value='$name'&gt;$title&lt;/option&gt;\n&quot;;
+                echo &quot;&lt;/select&gt;\n&quot;;
+
+                echo &quot;&lt;input type='submit' value='&quot; . esc_attr__( 'Apply' ) . &quot;' name='doaction$two' id='doaction$two' class='button-secondary action' /&gt;\n&quot;;
+        }
+
+        /**
+         * Get the current action selected from the bulk actions dropdown.
+         *
+         * @since 3.1.0
+         * @access public
+         *
+         * @return string|bool The action name or False if no action was selected
+         */
+        function current_action() {
+                if ( isset( $_REQUEST['action'] ) &amp;&amp; -1 != $_REQUEST['action'] )
+                        return $_REQUEST['action'];
+
+                if ( isset( $_REQUEST['action2'] ) &amp;&amp; -1 != $_REQUEST['action2'] )
+                        return $_REQUEST['action2'];
+
+                return false;
+        }
+
+        /**
+         * Generate row actions div
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @param array $actions The list of actions
+         * @param bool $always_visible Wether the actions should be always visible
+         * @return string
+         */
+        function row_actions( $actions, $always_visible = false ) {
+                $action_count = count( $actions );
+                $i = 0;
+
+                if ( !$action_count )
+                        return '';
+
+                $out = '&lt;div class=&quot;' . ( $always_visible ? 'row-actions-visible' : '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;';
+
+                return $out;
+        }
+
+        /**
+         * Display a monthly dropdown for filtering items
+         *
+         * @since 3.1.0
+         * @access protected
+         */
+        function months_dropdown( $post_type ) {
+                global $wpdb, $wp_locale;
+
+                $months = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;
+                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
+                        FROM $wpdb-&gt;posts
+                        WHERE post_type = %s
+                        ORDER BY post_date DESC
+                &quot;, $post_type ) );
+
+                $month_count = count( $months );
+
+                if ( !$month_count || ( 1 == $month_count &amp;&amp; 0 == $months[0]-&gt;month ) )
+                        return;
+
+                $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
+?&gt;
+                &lt;select name='m'&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 ( $months as $arc_row ) {
+                        if ( 0 == $arc_row-&gt;year )
+                                continue;
+
+                        $month = zeroise( $arc_row-&gt;month, 2 );
+                        $year = $arc_row-&gt;year;
+
+                        printf( &quot;&lt;option %s value='%s'&gt;%s&lt;/option&gt;\n&quot;,
+                                selected( $m, $year . $month, false ),
+                                esc_attr( $arc_row-&gt;year . $month ),
+                                $wp_locale-&gt;get_month( $month ) . &quot; $year&quot;
+                        );
+                }
+?&gt;
+                &lt;/select&gt;
+&lt;?php
+        }
+
+        /**
+         * Display a view switcher
+         *
+         * @since 3.1.0
+         * @access protected
+         */
+        function view_switcher( $current_mode ) {
+                $modes = array(
+                        'list'    =&gt; __( 'List View' ),
+                        'excerpt' =&gt; __( 'Excerpt View' )
+                );
+
+?&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo esc_attr( $current_mode ); ?&gt;&quot; /&gt;
+                &lt;div class=&quot;view-switch&quot;&gt;
+&lt;?php
+                        foreach ( $modes as $mode =&gt; $title ) {
+                                $class = ( $current_mode == $mode ) ? 'class=&quot;current&quot;' : '';
+                                echo &quot;&lt;a href='&quot; . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . &quot;' $class&gt;&lt;img id='view-switch-$mode' src='&quot; . esc_url( includes_url( 'images/blank.gif' ) ) . &quot;' width='20' height='20' title='$title' alt='$title' /&gt;&lt;/a&gt;\n&quot;;
+                        }
+                ?&gt;
+                &lt;/div&gt;
+&lt;?php
+        }
+
+        /**
+         * Display a comment count bubble
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @param int $post_id
+         * @param int $pending_comments
+         */
+        function comments_bubble( $post_id, $pending_comments ) {
+                $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
+
+                if ( $pending_comments )
+                        echo '&lt;strong&gt;';
+
+                $link = &quot;&lt;a href='&quot; . add_query_arg( 'p', $post_id, admin_url('edit-comments.php') ) . &quot;' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;%s&lt;/span&gt;&lt;/a&gt;&quot;;
+
+                comments_number(
+                        sprintf( $link, /* translators: comment count link */ _x( '0', 'comment count' ) ),
+                        sprintf( $link, /* translators: comment count link */ _x( '1', 'comment count' ) ),
+                        sprintf( $link, /* translators: comment count link: % will be substituted by comment count */ _x( '%', 'comment count' ) )
+                );
+
+                if ( $pending_comments )
+                        echo '&lt;/strong&gt;';
+        }
+
+        /**
+         * Get the current page number
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return int
+         */
+        function get_pagenum( $query_var = 'paged' ) {
+                $pagenum = isset( $_REQUEST[$query_var] ) ? absint( $_REQUEST[$query_var] ) : 0;
+
+                return max( 1, $pagenum );
+        }
+
+        /**
+         * Get number of items to display on a single page
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return int
+         */
+        function get_items_per_page( $option, $default = 20 ) {
+                $per_page = (int) get_user_option( $option );
+                if ( empty( $per_page ) || $per_page &lt; 1 )
+                        $per_page = $default;
+
+                return (int) apply_filters( $option, $per_page );
+        }
+
+        /**
+         * Display the pagination.
+         *
+         * @since 3.1.0
+         * @access protected
+         */
+        function pagination() {
+                if ( $this-&gt;_pagination ) {
+                        echo $this-&gt;_pagination;
+                        return;
+                }
+
+                if ( empty( $this-&gt;_pagination_args ) )
+                        return;
+
+                extract( $this-&gt;_pagination_args );
+
+                if ( $total_pages &lt; 2 )
+                        return;
+
+                $output = '&lt;span class=&quot;displaying-num&quot;&gt;' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '&lt;/span&gt;';
+
+                $current = $this-&gt;get_pagenum( $query_var );
+
+                $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+
+                $page_links = array();
+
+                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
+                        'first-page',
+                        esc_attr__( 'Go to the first page' ),
+                        esc_url( remove_query_arg( $query_var, $current_url ) ),
+                        '&amp;laquo;&amp;laquo;'
+                );
+
+                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
+                        'prev-page',
+                        esc_attr__( 'Go to the previous page' ),
+                        esc_url( add_query_arg( $query_var, max( 1, $current-1 ), $current_url ) ),
+                        '&amp;laquo;'
+                );
+
+                $html_current_page = sprintf( &quot;&lt;input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' /&gt;&quot;,
+                        esc_attr__( 'Current page' ),
+                        esc_attr( $query_var ),
+                        number_format_i18n( $current ),
+                        strlen( $total_pages )
+                );
+                $html_total_pages = sprintf( &quot;&lt;span class='total-pages'&gt;%s&lt;/span&gt;&quot;, number_format_i18n( $total_pages ) );
+                $page_links[] = sprintf( _x( '%s of %s', 'paging' ), $html_current_page, $html_total_pages );
+
+                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
+                        'next-page',
+                        esc_attr__( 'Go to the next page' ),
+                        esc_url( add_query_arg( $query_var, min( $total_pages, $current+1 ), $current_url ) ),
+                        '&amp;raquo;'
+                );
+
+                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
+                        'last-page',
+                        esc_attr__( 'Go to the last page' ),
+                        esc_url( add_query_arg( $query_var, $total_pages, $current_url ) ),
+                        '&amp;raquo;&amp;raquo;'
+                );
+
+                $output .= join( &quot;\n&quot;, $page_links );
+
+                $this-&gt;_pagination = &quot;&lt;div class='tablenav-pages'&gt;$output&lt;/div&gt;&quot;;
+
+                echo $this-&gt;_pagination;
+        }
+
+        /**
+         * Get a list of columns. The format is internal_name =&gt; title
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return array
+         */
+        function get_columns() {
+                die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
+        }
+
+        /**
+         * Get a list of sortable columns. The format is internal_name =&gt; orderby
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return array
+         */
+        function get_sortable_columns() {
+                return array();
+        }
+
+        /**
+         * Get a list of all, hidden and sortable columns, with filter applied
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return array
+         */
+        function get_column_info() {
+                if ( !isset( $this-&gt;_column_headers ) ) {
+                        $columns = get_column_headers( $this-&gt;_screen );
+                        $hidden = get_hidden_columns( $this-&gt;_screen );
+                        $sortable = apply_filters( 'manage_' . $this-&gt;_screen-&gt;id . '_sortable_columns', $this-&gt;get_sortable_columns() );
+
+                        $this-&gt;_column_headers = array( $columns, $hidden, $sortable );
+                }
+
+                return $this-&gt;_column_headers;
+        }
+
+        /**
+         * Print column headers, accounting for hidden and sortable columns.
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @param bool $with_id Whether to set the id attribute or not
+         */
+        function print_column_headers( $with_id = true ) {
+                $screen = $this-&gt;_screen;
+
+                list( $columns, $hidden, $sortable ) = $this-&gt;get_column_info();
+
+                $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+
+                if ( isset( $_GET['orderby'] ) )
+                        $current_orderby = $_GET['orderby'];
+                else
+                        $current_orderby = '';
+
+                if ( isset( $_GET['order'] ) &amp;&amp; 'desc' == $_GET['order'] )
+                        $current_order = 'desc';
+                else
+                        $current_order = 'asc';
+
+                foreach ( $columns as $column_key =&gt; $column_display_name ) {
+                        $class = array( 'manage-column', &quot;column-$column_key&quot; );
+
+                        $style = '';
+                        if ( in_array( $column_key, $hidden ) )
+                                $style = 'display:none;';
+
+                        $style = ' style=&quot;' . $style . '&quot;';
+
+                        if ( 'cb' == $column_key )
+                                $class[] = 'check-column';
+                        elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
+                                $class[] = 'num';
+
+                        if ( isset( $sortable[$column_key] ) ) {
+                                $orderby = $sortable[$column_key];
+                                if ( $current_orderby == $orderby ) {
+                                        $order = 'asc' == $current_order ? 'desc' : 'asc';
+                                        $class[] = &quot;sorted-$current_order&quot;;
+                                } else {
+                                        $order = 'asc';
+                                        $class[] = 'sortable';
+                                }
+                                $column_display_name = '&lt;a href=&quot;' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '&quot;&gt;' . $column_display_name . '&lt;/a&gt;';
+                                $column_display_name .= '&lt;div class=&quot;sorting-indicator&quot;&gt;&lt;/div&gt;';
+                        }
+
+                        $id = $with_id ? &quot;id='$column_key'&quot; : '';
+
+                        if ( !empty( $class ) )
+                                $class = &quot;class='&quot; . join( ' ', $class ) . &quot;'&quot;;
+
+                        echo &quot;&lt;th scope='col' $id $class $style&gt;$column_display_name&lt;/th&gt;&quot;;
+                }
+        }
+
+        /**
+         * Display the table or a message if there are no items
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function display() {
+                if ( $this-&gt;has_items() ) {
+                        $this-&gt;display_table();
+                } else {
+                        echo '&lt;br class=&quot;clear&quot;&gt;';
+                        $this-&gt;extra_tablenav( 'top' );
+                        echo '&lt;br class=&quot;clear&quot;&gt;';
+                        echo '&lt;p&gt;';
+                        $this-&gt;no_items();
+                        echo '&lt;/p&gt;';
+                }
+        }
+
+        /**
+         * Get a list of CSS classes for the &lt;table&gt; tag
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @return array
+         */
+        function get_table_classes() {
+                extract( $this-&gt;_args );
+
+                return array( 'widefat', 'fixed', $plural );
+        }
+
+        /**
+         * Display the full table
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function display_table() {
+                extract( $this-&gt;_args );
+
+                $this-&gt;display_tablenav( 'top' );
+
+?&gt;
+&lt;table class=&quot;&lt;?php echo implode( ' ', $this-&gt;get_table_classes() ); ?&gt;&quot; cellspacing=&quot;0&quot;&gt;
+        &lt;thead&gt;
+        &lt;tr&gt;
+                &lt;?php $this-&gt;print_column_headers(); ?&gt;
+        &lt;/tr&gt;
+        &lt;/thead&gt;
+
+        &lt;tfoot&gt;
+        &lt;tr&gt;
+                &lt;?php $this-&gt;print_column_headers( false ); ?&gt;
+        &lt;/tr&gt;
+        &lt;/tfoot&gt;
+
+        &lt;tbody id=&quot;the-list&quot;&lt;?php if ( $singular ) echo &quot; class='list:$singular'&quot;; ?&gt;&gt;
+                &lt;?php $this-&gt;display_rows(); ?&gt;
+        &lt;/tbody&gt;
+&lt;/table&gt;
+&lt;?php
+
+                $this-&gt;display_tablenav( 'bottom' );
+        }
+
+        /**
+         * Generate the table navigation above or below the table
+         *
+         * @since 3.1.0
+         * @access protected
+         */
+        function display_tablenav( $which ) {
+                if ( 'top' == $which )
+                        wp_nonce_field( 'bulk-' . $this-&gt;_args['plural'] );
+?&gt;
+        &lt;div class=&quot;tablenav&quot;&gt;
+
+                &lt;div class=&quot;alignleft actions&quot;&gt;
+                        &lt;?php $this-&gt;bulk_actions( $which ); ?&gt;
+                &lt;/div&gt;
+
+        &lt;?php
+                $this-&gt;extra_tablenav( $which );
+                $this-&gt;pagination( $which );
+        ?&gt;
+
+                &lt;br class=&quot;clear&quot;&gt;
+        &lt;/div&gt;
+
+        &lt;br class=&quot;clear&quot;&gt;
+&lt;?php
+        }
+
+        /**
+         * Extra controls to be displayed between bulk actions and pagination
+         *
+         * @since 3.1.0
+         * @access protected
+         */
+        function extra_tablenav( $which ) {}
+
+        /**
+         * Generate the &lt;tbody&gt; part of the table
+         *
+         * @since 3.1.0
+         * @access protected
+         */
+        function display_rows() {
+                foreach ( $this-&gt;items as $item )
+                        $this-&gt;single_row( $item );
+        }
+
+        /**
+         * Generates content for a single row of the table
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @param $object $item The current item
+         */
+        function single_row( $item ) {
+                static $row_class = '';
+                $row_class = ( $row_class == '' ? ' class=&quot;alternate&quot;' : '' );
+
+                echo '&lt;tr' . $row_class . '&gt;';
+                echo $this-&gt;single_row_columns( $item );
+                echo '&lt;/tr&gt;';
+        }
+
+        /**
+         * Generates the columns for a single row of the table
+         *
+         * @since 3.1.0
+         * @access protected
+         *
+         * @param $object $item The current item
+         */
+        function single_row_columns( $item ) {
+                list( $columns, $hidden ) = $this-&gt;get_column_info();
+
+                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;;
+
+                        if ( 'cb' == $column_name ) {
+                                echo '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;';
+                                echo $this-&gt;column_cb( $item );
+                                echo '&lt;/th&gt;';
+                        }
+                        elseif ( method_exists( $this, 'column_' . $column_name ) ) {
+                                echo &quot;&lt;td $attributes&gt;&quot;;
+                                echo call_user_func( array( $this, 'column_' . $column_name ), $item );
+                                echo &quot;&lt;/td&gt;&quot;;
+                        }
+                        else {
+                                echo &quot;&lt;td $attributes&gt;&quot;;
+                                echo $this-&gt;column_default( $item, $column_name );
+                                echo &quot;&lt;/td&gt;&quot;;
+                        }
+                }
+        }
+
+        /**
+         * Handle an incoming ajax request (called from admin-ajax.php)
+         *
+         * @since 3.1.0
+         * @access public
+         */
+        function ajax_response() {
+                $this-&gt;check_permissions();
+                $this-&gt;prepare_items();
+
+                extract( $this-&gt;_args );
+                extract( $this-&gt;_pagination_args );
+
+                ob_start();
+                $this-&gt;display_rows();
+                $rows = ob_get_clean();
+
+                $response = array( 'rows' =&gt; $rows );
+
+                if ( isset( $total_items ) )
+                        $response['total_items'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );
+
+                if ( isset( $total_pages ) )
+                        $response['total_pages'] = $total_pages;
+
+                die( json_encode( $response ) );
+        }
+
+        /**
+         * Send required variables to JavaScript land
+         *
+         * @access private
+         */
+        function _js_vars() {
+                extract( $this-&gt;_args );
+
+                $class = get_class( $this );
+
+                printf( &quot;&lt;script type='text/javascript'&gt;list_args = %s;&lt;/script&gt;\n&quot;,
+                        json_encode( compact( 'screen', 'class' ) )
+                );
+        }
+}
+
+/**
+ * Fetch an instance of a WP_List_Table class
+ *
+ * @since 3.1.0
+ *
+ * @param string $type The type of the list table
+ * @return object
+ */
+function get_list_table( $type ) {
+        require_once( ABSPATH . '/wp-admin/includes/default-list-tables.php' );
+        // Temp
+        require_once( ABSPATH . '/wp-admin/includes/list-table-posts.php' );
+
+        $class = 'WP_' . strtr( ucwords( strtr( $type, '-', ' ') ), ' ', '_' ) . '_Table';
+        $class = apply_filters( &quot;get_list_table_$type&quot;, $class );
+
+        return new $class;
+}
+
</ins></span></pre></div>
<a id="trunkwpadminincludesdefaultlisttablesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/default-list-tables.php (15953 => 15954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/default-list-tables.php        2010-10-24 21:45:35 UTC (rev 15953)
+++ trunk/wp-admin/includes/default-list-tables.php        2010-10-25 00:12:41 UTC (rev 15954)
</span><span class="lines">@@ -9,979 +9,6 @@
</span><span class="cx">  * @subpackage Administration
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-class WP_Posts_Table extends WP_List_Table {
-
-        /**
-         * Whether the items should be displayed hierarchically or linearly
-         *
-         * @since 3.1.0
-         * @var bool
-         * @access protected
-         */
-        var $hierarchical_display;
-
-        /**
-         * Holds the number of pending comments for each post
-         *
-         * @since 3.1.0
-         * @var bool
-         * @access protected
-         */
-        var $comment_pending_count;
-
-        /**
-         * Holds the number of posts for this user
-         *
-         * @since 3.1.0
-         * @var bool
-         * @access private
-         */
-        var $user_posts_count;
-
-        function WP_Posts_Table() {
-                global $post_type_object, $post_type, $current_screen, $wpdb;
-
-                if ( !isset( $_REQUEST['post_type'] ) )
-                        $post_type = 'post';
-                elseif ( in_array( $_REQUEST['post_type'], get_post_types( array( 'show_ui' =&gt; true ) ) ) )
-                        $post_type = $_REQUEST['post_type'];
-                else
-                        wp_die( __( 'Invalid post type' ) );
-                $_REQUEST['post_type'] = $post_type;
-
-                $post_type_object = get_post_type_object( $post_type );
-
-                if ( !current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) {
-                        $this-&gt;user_posts_count = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;
-                                SELECT COUNT( 1 ) FROM $wpdb-&gt;posts
-                                WHERE post_type = '%s' AND post_status NOT IN ( 'trash', 'auto-draft' )
-                                AND post_author = %d
-                        &quot;, $post_type, get_current_user_id() ) );
-
-                        if ( $this-&gt;user_posts_count &amp;&amp; empty( $_REQUEST['post_status'] ) &amp;&amp; empty( $_REQUEST['all_posts'] ) &amp;&amp; empty( $_REQUEST['author'] ) )
-                                $_GET['author'] = get_current_user_id();
-                }
-
-                parent::WP_List_Table( array(
-                        'screen' =&gt; $current_screen,
-                        'plural' =&gt; 'posts',
-                ) );
-        }
-
-        function check_permissions() {
-                global $post_type_object;
-
-                if ( !current_user_can( $post_type_object-&gt;cap-&gt;edit_posts ) )
-                        wp_die( __( 'Cheatin&amp;#8217; uh?' ) );
-        }
-
-        function prepare_items() {
-                global $post_type_object, $post_type, $avail_post_stati, $wp_query, $per_page, $mode;
-
-                $avail_post_stati = wp_edit_posts_query();
-
-                $this-&gt;hierarchical_display = ( $post_type_object-&gt;hierarchical &amp;&amp; 'menu_order title' == $wp_query-&gt;query['orderby'] );
-
-                $total_items = $this-&gt;hierarchical_display ? $wp_query-&gt;post_count : $wp_query-&gt;found_posts;
-
-                $per_page = $this-&gt;get_items_per_page( 'edit_' . $post_type . '_per_page' );
-                 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
-
-                if ( $this-&gt;hierarchical_display )
-                        $total_pages = ceil( $total_items / $per_page );
-                else
-                        $total_pages = $wp_query-&gt;max_num_pages;
-
-                $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
-
-                $this-&gt;is_trash = isset( $_REQUEST['post_status'] ) &amp;&amp; $_REQUEST['post_status'] == 'trash';
-
-                $this-&gt;set_pagination_args( array(
-                        'total_items' =&gt; $total_items,
-                        'total_pages' =&gt; $total_pages,
-                        'per_page' =&gt; $per_page
-                ) );
-        }
-
-        function has_items() {
-                return have_posts();
-        }
-
-        function no_items() {
-                global $post_type_object;
-
-                if ( isset( $_REQUEST['post_status'] ) &amp;&amp; 'trash' == $_REQUEST['post_status'] )
-                        echo $post_type_object-&gt;labels-&gt;not_found_in_trash;
-                else
-                        echo $post_type_object-&gt;labels-&gt;not_found;
-        }
-
-        function get_views() {
-                global $post_type, $post_type_object, $locked_post_status, $avail_post_stati;
-
-                if ( !empty($locked_post_status) )
-                        return array();
-
-                $status_links = array();
-                $num_posts = wp_count_posts( $post_type, 'readable' );
-                $class = '';
-                $allposts = '';
-
-                $current_user_id = get_current_user_id();
-
-                if ( $this-&gt;user_posts_count ) {
-                        if ( isset( $_GET['author'] ) &amp;&amp; ( $_GET['author'] == $current_user_id ) )
-                                $class = ' class=&quot;current&quot;';
-                        $status_links['mine'] = &quot;&lt;li&gt;&lt;a href='edit.php?post_type=$post_type&amp;author=$current_user_id'$class&gt;&quot; . sprintf( _nx( 'Mine &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Mine &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $this-&gt;user_posts_count, 'posts' ), number_format_i18n( $this-&gt;user_posts_count ) ) . '&lt;/a&gt;';
-                        $allposts = '&amp;all_posts=1';
-                }
-
-                $total_posts = array_sum( (array) $num_posts );
-
-                // Subtract post types that are not included in the admin all list.
-                foreach ( get_post_stati( array('show_in_admin_all_list' =&gt; false) ) as $state )
-                        $total_posts -= $num_posts-&gt;$state;
-
-                $class = empty($class) &amp;&amp; empty($_REQUEST['post_status']) ? ' class=&quot;current&quot;' : '';
-                $status_links['all'] = &quot;&lt;li&gt;&lt;a href='edit.php?post_type=$post_type{$allposts}'$class&gt;&quot; . sprintf( _nx( '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, 'posts' ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
-
-                foreach ( get_post_stati(array('show_in_admin_status_list' =&gt; true), 'objects') as $status ) {
-                        $class = '';
-
-                        $status_name = $status-&gt;name;
-
-                        if ( !in_array( $status_name, $avail_post_stati ) )
-                                continue;
-
-                        if ( empty( $num_posts-&gt;$status_name ) )
-                                continue;
-
-                        if ( isset($_REQUEST['post_status']) &amp;&amp; $status_name == $_REQUEST['post_status'] )
-                                $class = ' class=&quot;current&quot;';
-
-                        $status_links[$status_name] = &quot;&lt;li&gt;&lt;a href='edit.php?post_status=$status_name&amp;amp;post_type=$post_type'$class&gt;&quot; . sprintf( _n( $status-&gt;label_count[0], $status-&gt;label_count[1], $num_posts-&gt;$status_name ), number_format_i18n( $num_posts-&gt;$status_name ) ) . '&lt;/a&gt;';
-                }
-
-                return $status_links;
-        }
-
-        function get_bulk_actions() {
-                $actions = array();
-
-                if ( $this-&gt;is_trash )
-                        $actions['untrash'] = __( 'Restore' );
-                else
-                        $actions['edit'] = __( 'Edit' );
-
-                if ( $this-&gt;is_trash || !EMPTY_TRASH_DAYS )
-                        $actions['delete'] = __( 'Delete Permanently' );
-                else
-                        $actions['trash'] = __( 'Move to Trash' );
-
-                return $actions;
-        }
-
-        function extra_tablenav( $which ) {
-                global $post_type, $post_type_object, $cat;
-
-                if ( 'top' == $which &amp;&amp; !is_singular() ) {
-?&gt;
-                &lt;div class=&quot;alignleft actions&quot;&gt;
-&lt;?php
-                        $this-&gt;months_dropdown( $post_type );
-
-                        if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
-                                $dropdown_options = array(
-                                        'show_option_all' =&gt; __( 'View all categories' ),
-                                        'hide_empty' =&gt; 0,
-                                        'hierarchical' =&gt; 1,
-                                        'show_count' =&gt; 0,
-                                        'orderby' =&gt; 'name',
-                                        'selected' =&gt; $cat
-                                );
-                                wp_dropdown_categories( $dropdown_options );
-                        }
-                        do_action( 'restrict_manage_posts' );
-?&gt;
-                        &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e( 'Filter' ); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
-                &lt;/div&gt;
-&lt;?php
-                }
-
-                if ( $this-&gt;is_trash &amp;&amp; current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) {
-?&gt;
-                &lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e( 'Empty Trash' ); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
-&lt;?php
-                }
-        }
-
-        function current_action() {
-                if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
-                        return 'delete_all';
-
-                return parent::current_action();
-        }
-
-        function pagination( $which ) {
-                global $post_type_object, $mode;
-
-                parent::pagination( $which );
-
-                if ( 'top' == $which &amp;&amp; !$post_type_object-&gt;hierarchical )
-                        $this-&gt;view_switcher( $mode );
-        }
-
-        function get_table_classes() {
-                global $post_type_object;
-
-                return array( 'widefat', 'fixed', $post_type_object-&gt;hierarchical ? 'pages' : 'posts' );
-        }
-
-        function get_columns() {
-                $screen = $this-&gt;_screen;
-
-                if ( empty( $screen ) )
-                        $post_type = 'post';
-                else
-                        $post_type = $screen-&gt;post_type;
-
-                $posts_columns = array();
-                $posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
-                /* translators: manage posts column name */
-                $posts_columns['title'] = _x( 'Title', 'column name' );
-                $posts_columns['author'] = __( 'Author' );
-                if ( empty( $post_type ) || is_object_in_taxonomy( $post_type, 'category' ) )
-                        $posts_columns['categories'] = __( 'Categories' );
-                if ( empty( $post_type ) || is_object_in_taxonomy( $post_type, 'post_tag' ) )
-                        $posts_columns['tags'] = __( 'Tags' );
-                $post_status = !empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
-                if ( !in_array( $post_status, array( 'pending', 'draft', 'future' ) ) &amp;&amp; ( empty( $post_type ) || post_type_supports( $post_type, 'comments' ) ) )
-                        $posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;Comments&quot; src=&quot;' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '&quot; /&gt;&lt;/div&gt;';
-                $posts_columns['date'] = __( 'Date' );
-
-                if ( 'page' == $post_type )
-                        $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
-                else
-                        $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
-                $posts_columns = apply_filters( &quot;manage_{$post_type}_posts_columns&quot;, $posts_columns );
-
-                return $posts_columns;
-        }
-
-        function get_sortable_columns() {
-                return array(
-                        'title'    =&gt; 'title',
-                        'author'   =&gt; 'author',
-                        'parent'   =&gt; 'parent',
-                        'comments' =&gt; 'comment_count',
-                        'date'     =&gt; 'date',
-                );
-        }
-
-        function display_rows( $posts = array() ) {
-                global $wp_query, $post_type_object, $per_page;
-
-                if ( empty( $posts ) )
-                        $posts = $wp_query-&gt;posts;
-
-                if ( $this-&gt;hierarchical_display ) {
-                        $this-&gt;_display_rows_hierarchical( $posts, $this-&gt;get_pagenum(), $per_page );
-                } else {
-                        $this-&gt;_display_rows( $posts );
-                }
-        }
-
-        function _display_rows( $posts ) {
-                global $post, $mode;
-
-                add_filter( 'the_title','esc_html' );
-
-                // Create array of post IDs.
-                $post_ids = array();
-
-                foreach ( $posts as $a_post )
-                        $post_ids[] = $a_post-&gt;ID;
-
-                $this-&gt;comment_pending_count = get_pending_comments_num( $post_ids );
-
-                foreach ( $posts as $post )
-                        $this-&gt;single_row( $post );
-        }
-
-        function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
-                global $wpdb;
-
-                $level = 0;
-
-                if ( ! $pages ) {
-                        $pages = get_pages( array( 'sort_column' =&gt; 'menu_order' ) );
-
-                        if ( ! $pages )
-                                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.
-                 * 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( $_REQUEST['s'] ) ) {
-
-                        $top_level_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;update( $wpdb-&gt;posts, array( 'post_parent' =&gt; 0 ), array( 'ID' =&gt; $page-&gt;ID ) );
-                                        clean_page_cache( $page-&gt;ID );
-                                }
-
-                                if ( 0 == $page-&gt;post_parent )
-                                        $top_level_pages[] = $page;
-                                else
-                                        $children_pages[ $page-&gt;post_parent ][] = $page;
-                        }
-
-                        $pages = &amp;$top_level_pages;
-                }
-
-                $count = 0;
-                $start = ( $pagenum - 1 ) * $per_page;
-                $end = $start + $per_page;
-
-                foreach ( $pages as $page ) {
-                        if ( $count &gt;= $end )
-                                break;
-
-                        if ( $count &gt;= $start )
-                                echo &quot;\t&quot; . $this-&gt;single_row( $page, $level );
-
-                        $count++;
-
-                        if ( isset( $children_pages ) )
-                                $this-&gt;_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 ){
-                                foreach ( $orphans as $op ) {
-                                        if ( $count &gt;= $end )
-                                                break;
-                                        if ( $count &gt;= $start )
-                                                echo &quot;\t&quot; . $this-&gt;single_row( $op, 0 );
-                                        $count++;
-                                }
-                        }
-                }
-        }
-
-        /**
-         * Given a top level page ID, display the nested hierarchy of sub-pages
-         * together with paging support
-         *
-         * @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;
-
-                $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();
-                                $my_parent = $page-&gt;post_parent;
-                                while ( $my_parent ) {
-                                        $my_parent = get_post( $my_parent );
-                                        $my_parents[] = $my_parent;
-                                        if ( !$my_parent-&gt;post_parent )
-                                                break;
-                                        $my_parent = $my_parent-&gt;post_parent;
-                                }
-                                $num_parents = count( $my_parents );
-                                while ( $my_parent = array_pop( $my_parents ) ) {
-                                        echo &quot;\t&quot; . $this-&gt;single_row( $my_parent, $level - $num_parents );
-                                        $num_parents--;
-                                }
-                        }
-
-                        if ( $count &gt;= $start )
-                                echo &quot;\t&quot; . $this-&gt;single_row( $page, $level );
-
-                        $count++;
-
-                        $this-&gt;_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
-        }
-
-        function single_row( $a_post, $level = 0 ) {
-                global $post, $current_screen, $mode;
-                static $rowclass;
-
-                $global_post = $post;
-                $post = $a_post;
-                setup_postdata( $post );
-
-                $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
-                $post_owner = ( get_current_user_id() == $post-&gt;post_author ? 'self' : 'other' );
-                $edit_link = get_edit_post_link( $post-&gt;ID );
-                $title = _draft_or_post_title();
-                $post_type_object = get_post_type_object( $post-&gt;post_type );
-                $can_edit_post = current_user_can( 'edit_post', $post-&gt;ID );
-        ?&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
-
-                list( $columns, $hidden ) = $this-&gt;get_column_info();
-
-                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':
-                        ?&gt;
-                        &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( $can_edit_post ) { ?&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 'title':
-                                if ( $this-&gt;hierarchical_display ) {
-                                        $attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
-
-                                        if ( 0 == $level &amp;&amp; (int) $post-&gt;post_parent &gt; 0 ) {
-                                                //sent level 0 by accident, by default, or because we don't know the actual level
-                                                $find_main_page = (int) $post-&gt;post_parent;
-                                                while ( $find_main_page &gt; 0 ) {
-                                                        $parent = get_page( $find_main_page );
-
-                                                        if ( is_null( $parent ) )
-                                                                break;
-
-                                                        $level++;
-                                                        $find_main_page = (int) $parent-&gt;post_parent;
-
-                                                        if ( !isset( $parent_name ) )
-                                                                $parent_name = $parent-&gt;post_title;
-                                                }
-                                        }
-
-                                        $post-&gt;post_title = esc_html( $post-&gt;post_title );
-                                        $pad = str_repeat( '&amp;#8212; ', $level );
-?&gt;
-                        &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( $can_edit_post &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( sprintf( __( 'Edit &amp;#8220;%s&amp;#8221;' ), $title ) ); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object-&gt;labels-&gt;parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?&gt;&lt;/strong&gt;
-&lt;?php
-                                }
-                                else {
-                                        $attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
-?&gt;
-                        &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( $can_edit_post &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( sprintf( __( 'Edit &amp;#8220;%s&amp;#8221;' ), $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 ( $can_edit_post &amp;&amp; 'trash' != $post-&gt;post_status ) {
-                                        $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link( $post-&gt;ID, true ) . '&quot; title=&quot;' . esc_attr( __( 'Edit this item' ) ) . '&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt;';
-                                        $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot; title=&quot;' . esc_attr( __( 'Edit this item inline' ) ) . '&quot;&gt;' . __( 'Quick&amp;nbsp;Edit' ) . '&lt;/a&gt;';
-                                }
-                                if ( current_user_can( $post_type_object-&gt;cap-&gt;delete_post, $post-&gt;ID ) ) {
-                                        if ( 'trash' == $post-&gt;post_status )
-                                                $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr( __( 'Restore this item from the Trash' ) ) . &quot;' href='&quot; . wp_nonce_url( admin_url( sprintf( $post_type_object-&gt;_edit_link . '&amp;amp;action=untrash', $post-&gt;ID ) ), 'untrash-' . $post-&gt;post_type . '_' . $post-&gt;ID ) . &quot;'&gt;&quot; . __( 'Restore' ) . &quot;&lt;/a&gt;&quot;;
-                                        elseif ( EMPTY_TRASH_DAYS )
-                                                $actions['trash'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr( __( 'Move this item to the Trash' ) ) . &quot;' href='&quot; . get_delete_post_link( $post-&gt;ID ) . &quot;'&gt;&quot; . __( 'Trash' ) . &quot;&lt;/a&gt;&quot;;
-                                        if ( 'trash' == $post-&gt;post_status || !EMPTY_TRASH_DAYS )
-                                                $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr( __( 'Delete this item permanently' ) ) . &quot;' href='&quot; . get_delete_post_link( $post-&gt;ID, '', true ) . &quot;'&gt;&quot; . __( 'Delete Permanently' ) . &quot;&lt;/a&gt;&quot;;
-                                }
-                                if ( in_array( $post-&gt;post_status, array( 'pending', 'draft' ) ) ) {
-                                        if ( $can_edit_post )
-                                                $actions['view'] = '&lt;a href=&quot;' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post-&gt;ID ) ) ) . '&quot; title=&quot;' . esc_attr( sprintf( __( 'Preview &amp;#8220;%s&amp;#8221;' ), $title ) ) . '&quot; rel=&quot;permalink&quot;&gt;' . __( 'Preview' ) . '&lt;/a&gt;';
-                                } elseif ( 'trash' != $post-&gt;post_status ) {
-                                        $actions['view'] = '&lt;a href=&quot;' . get_permalink( $post-&gt;ID ) . '&quot; title=&quot;' . esc_attr( sprintf( __( 'View &amp;#8220;%s&amp;#8221;' ), $title ) ) . '&quot; rel=&quot;permalink&quot;&gt;' . __( 'View' ) . '&lt;/a&gt;';
-                                }
-
-                                $actions = apply_filters( $this-&gt;hierarchical_display ? 'page_row_actions' : 'post_row_actions', $actions, $post );
-                                echo $this-&gt;row_actions( $actions );
-
-                                get_inline_data( $post );
-                        break;
-
-                        case 'date':
-                                if ( '0000-00-00 00:00:00' == $post-&gt;post_date &amp;&amp; 'date' == $column_name ) {
-                                        $t_time = $h_time = __( 'Unpublished' );
-                                        $time_diff = 0;
-                                } 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 ( $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 ( $time_diff &gt; 0 )
-                                                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 '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[] = sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
-                                                        add_query_arg( array( 'post_type' =&gt; $post-&gt;post_type, 'category_name' =&gt; $c-&gt;slug ), 'edit.php' ),
-                                                        esc_html( sanitize_term_field( 'name', $c-&gt;name, $c-&gt;term_id, 'category', 'display' ) )
-                                                );
-                                        }
-                                        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[] = sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
-                                                        add_query_arg( array( 'post_type' =&gt; $post-&gt;post_type, 'tag' =&gt; $c-&gt;slug ), 'edit.php' ),
-                                                        esc_html( sanitize_term_field( 'name', $c-&gt;name, $c-&gt;term_id, 'tag', 'display' ) )
-                                                );
-                                        }
-                                        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_comments = isset( $this-&gt;comment_pending_count[$post-&gt;ID] ) ? $this-&gt;comment_pending_count[$post-&gt;ID] : 0;
-
-                                $this-&gt;comments_bubble( $post-&gt;ID, $pending_comments );
-                        ?&gt;
-                        &lt;/div&gt;&lt;/td&gt;
-                        &lt;?php
-                        break;
-
-                        case 'author':
-                        ?&gt;
-                        &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
-                                printf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
-                                        add_query_arg( array( 'post_type' =&gt; $post-&gt;post_type, 'author' =&gt; get_the_author_meta( 'ID' ) ), 'edit.php' ),
-                                        get_the_author()
-                                );
-                        ?&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;
-        }
-
-        /**
-         * Outputs the hidden row displayed when inline editing
-         *
-         * @since 3.1.0
-         */
-        function inline_edit() {
-                global $mode;
-
-                $screen = $this-&gt;_screen;
-
-                $post = get_default_post_to_edit( $screen-&gt;post_type );
-                $post_type_object = get_post_type_object( $screen-&gt;post_type );
-
-                $taxonomy_names = get_object_taxonomies( $screen-&gt;post_type );
-                $hierarchical_taxonomies = array();
-                $flat_taxonomies = array();
-                foreach ( $taxonomy_names as $taxonomy_name ) {
-                        $taxonomy = get_taxonomy( $taxonomy_name );
-
-                        if ( !$taxonomy-&gt;show_ui )
-                                continue;
-
-                        if ( $taxonomy-&gt;hierarchical )
-                                $hierarchical_taxonomies[] = $taxonomy;
-                        else
-                                $flat_taxonomies[] = $taxonomy;
-                }
-
-                list( $columns, $hidden ) = $this-&gt;get_column_info();
-
-                $col_count = count( $columns ) - count( $hidden );
-                $m = ( isset( $mode ) &amp;&amp; 'excerpt' == $mode ) ? 'excerpt' : 'list';
-                $can_publish = current_user_can( $post_type_object-&gt;cap-&gt;publish_posts );
-                $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
-                $hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page';
-                $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;$hclass inline-edit-$screen-&gt;post_type &quot;;
-                        echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$hclass bulk-edit-$screen-&gt;post_type&quot; : &quot;quick-edit-row quick-edit-row-$hclass inline-edit-$screen-&gt;post_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 ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
-
-
-        &lt;?php
-
-        if ( post_type_supports( $screen-&gt;post_type, 'title' ) ) :
-                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;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;?php endif; // $bulk
-        endif; // post_type_supports title ?&gt;
-
-        &lt;?php if ( !$bulk ) : ?&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
-
-                if ( post_type_supports( $screen-&gt;post_type, 'author' ) ) :
-                        $authors_dropdown = '';
-
-                        if ( is_super_admin() || current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) :
-                                $users_opt = array(
-                                        'name' =&gt; 'post_author',
-                                        'class'=&gt; 'authors',
-                                        'multi' =&gt; 1,
-                                        'echo' =&gt; 0
-                                );
-                                if ( $bulk )
-                                        $users_opt['show_option_none'] = __( '&amp;mdash; No Change &amp;mdash;' );
-                                $authors_dropdown  = '&lt;label&gt;';
-                                $authors_dropdown .= '&lt;span class=&quot;title&quot;&gt;' . __( 'Author' ) . '&lt;/span&gt;';
-                                $authors_dropdown .= wp_dropdown_users( $users_opt );
-                                $authors_dropdown .= '&lt;/label&gt;';
-                        endif; // authors
-        ?&gt;
-
-        &lt;?php if ( !$bulk ) echo $authors_dropdown;
-        endif; // post_type_supports author
-
-        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( '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
-                                        /* translators: Between password field and private checkbox on post quick edit interface */
-                                        echo __( '&amp;ndash;OR&amp;ndash;' );
-                                        ?&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 __( 'Private' ); ?&gt;&lt;/span&gt;
-                                &lt;/label&gt;
-                        &lt;/div&gt;
-
-        &lt;?php endif; ?&gt;
-
-                &lt;/div&gt;&lt;/fieldset&gt;
-
-        &lt;?php if ( count( $hierarchical_taxonomies ) &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;?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?&gt;
-
-                        &lt;span class=&quot;title inline-edit-categories-label&quot;&gt;&lt;?php echo esc_html( $taxonomy-&gt;labels-&gt;name ) ?&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;input type=&quot;hidden&quot; name=&quot;&lt;?php echo ( $taxonomy-&gt;name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy-&gt;name ) . '][]'; ?&gt;&quot; value=&quot;0&quot; /&gt;
-                        &lt;ul class=&quot;cat-checklist &lt;?php echo esc_attr( $taxonomy-&gt;name )?&gt;-checklist&quot;&gt;
-                                &lt;?php wp_terms_checklist( null, array( 'taxonomy' =&gt; $taxonomy-&gt;name ) ) ?&gt;
-                        &lt;/ul&gt;
-
-        &lt;?php endforeach; //$hierarchical_taxonomies as $taxonomy ?&gt;
-
-                &lt;/div&gt;&lt;/fieldset&gt;
-
-        &lt;?php endif; // count( $hierarchical_taxonomies ) &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 ( post_type_supports( $screen-&gt;post_type, 'author' ) &amp;&amp; $bulk )
-                        echo $authors_dropdown;
-        ?&gt;
-
-        &lt;?php if ( $post_type_object-&gt;hierarchical ) : ?&gt;
-
-                        &lt;label&gt;
-                                &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Parent' ); ?&gt;&lt;/span&gt;
-        &lt;?php
-                $dropdown_args = array( 'post_type' =&gt; $post_type_object-&gt;name, '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'] =  __( '&amp;mdash; No Change &amp;mdash;' );
-                $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
-                wp_dropdown_pages( $dropdown_args );
-        ?&gt;
-                        &lt;/label&gt;
-
-        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'page-attributes' ) ) :
-                        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( '&amp;mdash; No Change &amp;mdash;' ); ?&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
-                endif; // post_type_supports page-attributes
-        endif; // $post_type_object-&gt;hierarchical ?&gt;
-
-        &lt;?php if ( count( $flat_taxonomies ) &amp;&amp; !$bulk ) : ?&gt;
-
-        &lt;?php foreach ( $flat_taxonomies as $taxonomy ) : ?&gt;
-
-                        &lt;label class=&quot;inline-edit-tags&quot;&gt;
-                                &lt;span class=&quot;title&quot;&gt;&lt;?php echo esc_html( $taxonomy-&gt;labels-&gt;name ) ?&gt;&lt;/span&gt;
-                                &lt;textarea cols=&quot;22&quot; rows=&quot;1&quot; name=&quot;tax_input[&lt;?php echo esc_attr( $taxonomy-&gt;name )?&gt;]&quot; class=&quot;tax_input_&lt;?php echo esc_attr( $taxonomy-&gt;name )?&gt;&quot;&gt;&lt;/textarea&gt;
-                        &lt;/label&gt;
-
-        &lt;?php endforeach; //$flat_taxonomies as $taxonomy ?&gt;
-
-        &lt;?php endif; // count( $flat_taxonomies ) &amp;&amp; !$bulk  ?&gt;
-
-        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) || post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) :
-                if ( $bulk ) : ?&gt;
-
-                        &lt;div class=&quot;inline-edit-group&quot;&gt;
-                &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) ) : ?&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( '&amp;mdash; No Change &amp;mdash;' ); ?&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;?php endif; if ( post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) : ?&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( '&amp;mdash; No Change &amp;mdash;' ); ?&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;?php endif; ?&gt;
-                        &lt;/div&gt;
-
-        &lt;?php else : // $bulk ?&gt;
-
-                        &lt;div class=&quot;inline-edit-group&quot;&gt;
-                        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) ) : ?&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;?php endif; if ( post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) : ?&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;?php endif; ?&gt;
-                        &lt;/div&gt;
-
-        &lt;?php endif; // $bulk
-        endif; // post_type_supports comments or pings ?&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( '&amp;mdash; No Change &amp;mdash;' ); ?&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( 'Draft' ); ?&gt;&lt;/option&gt;
-                                        &lt;/select&gt;
-                                &lt;/label&gt;
-
-        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'sticky' ) &amp;&amp; $can_publish &amp;&amp; current_user_can( $post_type_object-&gt;cap-&gt;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( '&amp;mdash; No Change &amp;mdash;' ); ?&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 sticky' ); ?&gt;&lt;/span&gt;
-                                &lt;/label&gt;
-
-        &lt;?php        endif; // $bulk ?&gt;
-
-        &lt;?php endif; // post_type_supports(sticky) &amp;&amp; $can_publish &amp;&amp; current_user_can( 'edit_others_cap' ) ?&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, $screen-&gt;post_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 = __( 'Update' );
-                                ?&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 esc_attr( $update_text ); ?&gt;&lt;/a&gt;
-                                &lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; alt=&quot;&quot; /&gt;
-                        &lt;?php } else {
-                                $update_text = __( 'Update' );
-                        ?&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 esc_attr( $update_text ); ?&gt;&quot; /&gt;
-                        &lt;?php } ?&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;post_view&quot; value=&quot;&lt;?php echo esc_attr( $m ); ?&gt;&quot; /&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;screen&quot; value=&quot;&lt;?php echo esc_attr( $screen-&gt;id ); ?&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
-        }
-}
-
</del><span class="cx"> class WP_Media_Table extends WP_List_Table {
</span><span class="cx"> 
</span><span class="cx">         function WP_Media_Table() {
</span></span></pre></div>
<a id="trunkwpadminincludeslisttablepostsphpfromrev15953trunkwpadminincludesdefaultlisttablesphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/includes/list-table-posts.php (from rev 15953, trunk/wp-admin/includes/default-list-tables.php) (0 => 15954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/list-table-posts.php                                (rev 0)
+++ trunk/wp-admin/includes/list-table-posts.php        2010-10-25 00:12:41 UTC (rev 15954)
</span><span class="lines">@@ -0,0 +1,984 @@
</span><ins>+&lt;?php
+/**
+ * List table classes
+ *
+ * Each list-type admin screen has a class that handles the rendering of the list table.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+class WP_Posts_Table extends WP_List_Table {
+
+        /**
+         * Whether the items should be displayed hierarchically or linearly
+         *
+         * @since 3.1.0
+         * @var bool
+         * @access protected
+         */
+        var $hierarchical_display;
+
+        /**
+         * Holds the number of pending comments for each post
+         *
+         * @since 3.1.0
+         * @var bool
+         * @access protected
+         */
+        var $comment_pending_count;
+
+        /**
+         * Holds the number of posts for this user
+         *
+         * @since 3.1.0
+         * @var bool
+         * @access private
+         */
+        var $user_posts_count;
+
+        function WP_Posts_Table() {
+                global $post_type_object, $post_type, $current_screen, $wpdb;
+
+                if ( !isset( $_REQUEST['post_type'] ) )
+                        $post_type = 'post';
+                elseif ( in_array( $_REQUEST['post_type'], get_post_types( array( 'show_ui' =&gt; true ) ) ) )
+                        $post_type = $_REQUEST['post_type'];
+                else
+                        wp_die( __( 'Invalid post type' ) );
+                $_REQUEST['post_type'] = $post_type;
+
+                $post_type_object = get_post_type_object( $post_type );
+
+                if ( !current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) {
+                        $this-&gt;user_posts_count = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;
+                                SELECT COUNT( 1 ) FROM $wpdb-&gt;posts
+                                WHERE post_type = '%s' AND post_status NOT IN ( 'trash', 'auto-draft' )
+                                AND post_author = %d
+                        &quot;, $post_type, get_current_user_id() ) );
+
+                        if ( $this-&gt;user_posts_count &amp;&amp; empty( $_REQUEST['post_status'] ) &amp;&amp; empty( $_REQUEST['all_posts'] ) &amp;&amp; empty( $_REQUEST['author'] ) )
+                                $_GET['author'] = get_current_user_id();
+                }
+
+                parent::WP_List_Table( array(
+                        'screen' =&gt; $current_screen,
+                        'plural' =&gt; 'posts',
+                ) );
+        }
+
+        function check_permissions() {
+                global $post_type_object;
+
+                if ( !current_user_can( $post_type_object-&gt;cap-&gt;edit_posts ) )
+                        wp_die( __( 'Cheatin&amp;#8217; uh?' ) );
+        }
+
+        function prepare_items() {
+                global $post_type_object, $post_type, $avail_post_stati, $wp_query, $per_page, $mode;
+
+                $avail_post_stati = wp_edit_posts_query();
+
+                $this-&gt;hierarchical_display = ( $post_type_object-&gt;hierarchical &amp;&amp; 'menu_order title' == $wp_query-&gt;query['orderby'] );
+
+                $total_items = $this-&gt;hierarchical_display ? $wp_query-&gt;post_count : $wp_query-&gt;found_posts;
+
+                $per_page = $this-&gt;get_items_per_page( 'edit_' . $post_type . '_per_page' );
+                 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
+
+                if ( $this-&gt;hierarchical_display )
+                        $total_pages = ceil( $total_items / $per_page );
+                else
+                        $total_pages = $wp_query-&gt;max_num_pages;
+
+                $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
+
+                $this-&gt;is_trash = isset( $_REQUEST['post_status'] ) &amp;&amp; $_REQUEST['post_status'] == 'trash';
+
+                $this-&gt;set_pagination_args( array(
+                        'total_items' =&gt; $total_items,
+                        'total_pages' =&gt; $total_pages,
+                        'per_page' =&gt; $per_page
+                ) );
+        }
+
+        function has_items() {
+                return have_posts();
+        }
+
+        function no_items() {
+                global $post_type_object;
+
+                if ( isset( $_REQUEST['post_status'] ) &amp;&amp; 'trash' == $_REQUEST['post_status'] )
+                        echo $post_type_object-&gt;labels-&gt;not_found_in_trash;
+                else
+                        echo $post_type_object-&gt;labels-&gt;not_found;
+        }
+
+        function get_views() {
+                global $post_type, $post_type_object, $locked_post_status, $avail_post_stati;
+
+                if ( !empty($locked_post_status) )
+                        return array();
+
+                $status_links = array();
+                $num_posts = wp_count_posts( $post_type, 'readable' );
+                $class = '';
+                $allposts = '';
+
+                $current_user_id = get_current_user_id();
+
+                if ( $this-&gt;user_posts_count ) {
+                        if ( isset( $_GET['author'] ) &amp;&amp; ( $_GET['author'] == $current_user_id ) )
+                                $class = ' class=&quot;current&quot;';
+                        $status_links['mine'] = &quot;&lt;li&gt;&lt;a href='edit.php?post_type=$post_type&amp;author=$current_user_id'$class&gt;&quot; . sprintf( _nx( 'Mine &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Mine &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $this-&gt;user_posts_count, 'posts' ), number_format_i18n( $this-&gt;user_posts_count ) ) . '&lt;/a&gt;';
+                        $allposts = '&amp;all_posts=1';
+                }
+
+                $total_posts = array_sum( (array) $num_posts );
+
+                // Subtract post types that are not included in the admin all list.
+                foreach ( get_post_stati( array('show_in_admin_all_list' =&gt; false) ) as $state )
+                        $total_posts -= $num_posts-&gt;$state;
+
+                $class = empty($class) &amp;&amp; empty($_REQUEST['post_status']) ? ' class=&quot;current&quot;' : '';
+                $status_links['all'] = &quot;&lt;li&gt;&lt;a href='edit.php?post_type=$post_type{$allposts}'$class&gt;&quot; . sprintf( _nx( '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, 'posts' ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
+
+                foreach ( get_post_stati(array('show_in_admin_status_list' =&gt; true), 'objects') as $status ) {
+                        $class = '';
+
+                        $status_name = $status-&gt;name;
+
+                        if ( !in_array( $status_name, $avail_post_stati ) )
+                                continue;
+
+                        if ( empty( $num_posts-&gt;$status_name ) )
+                                continue;
+
+                        if ( isset($_REQUEST['post_status']) &amp;&amp; $status_name == $_REQUEST['post_status'] )
+                                $class = ' class=&quot;current&quot;';
+
+                        $status_links[$status_name] = &quot;&lt;li&gt;&lt;a href='edit.php?post_status=$status_name&amp;amp;post_type=$post_type'$class&gt;&quot; . sprintf( _n( $status-&gt;label_count[0], $status-&gt;label_count[1], $num_posts-&gt;$status_name ), number_format_i18n( $num_posts-&gt;$status_name ) ) . '&lt;/a&gt;';
+                }
+
+                return $status_links;
+        }
+
+        function get_bulk_actions() {
+                $actions = array();
+
+                if ( $this-&gt;is_trash )
+                        $actions['untrash'] = __( 'Restore' );
+                else
+                        $actions['edit'] = __( 'Edit' );
+
+                if ( $this-&gt;is_trash || !EMPTY_TRASH_DAYS )
+                        $actions['delete'] = __( 'Delete Permanently' );
+                else
+                        $actions['trash'] = __( 'Move to Trash' );
+
+                return $actions;
+        }
+
+        function extra_tablenav( $which ) {
+                global $post_type, $post_type_object, $cat;
+
+                if ( 'top' == $which &amp;&amp; !is_singular() ) {
+?&gt;
+                &lt;div class=&quot;alignleft actions&quot;&gt;
+&lt;?php
+                        $this-&gt;months_dropdown( $post_type );
+
+                        if ( is_object_in_taxonomy( $post_type, 'category' ) ) {
+                                $dropdown_options = array(
+                                        'show_option_all' =&gt; __( 'View all categories' ),
+                                        'hide_empty' =&gt; 0,
+                                        'hierarchical' =&gt; 1,
+                                        'show_count' =&gt; 0,
+                                        'orderby' =&gt; 'name',
+                                        'selected' =&gt; $cat
+                                );
+                                wp_dropdown_categories( $dropdown_options );
+                        }
+                        do_action( 'restrict_manage_posts' );
+?&gt;
+                        &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e( 'Filter' ); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
+                &lt;/div&gt;
+&lt;?php
+                }
+
+                if ( $this-&gt;is_trash &amp;&amp; current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) {
+?&gt;
+                &lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e( 'Empty Trash' ); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
+&lt;?php
+                }
+        }
+
+        function current_action() {
+                if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
+                        return 'delete_all';
+
+                return parent::current_action();
+        }
+
+        function pagination( $which ) {
+                global $post_type_object, $mode;
+
+                parent::pagination( $which );
+
+                if ( 'top' == $which &amp;&amp; !$post_type_object-&gt;hierarchical )
+                        $this-&gt;view_switcher( $mode );
+        }
+
+        function get_table_classes() {
+                global $post_type_object;
+
+                return array( 'widefat', 'fixed', $post_type_object-&gt;hierarchical ? 'pages' : 'posts' );
+        }
+
+        function get_columns() {
+                $screen = $this-&gt;_screen;
+
+                if ( empty( $screen ) )
+                        $post_type = 'post';
+                else
+                        $post_type = $screen-&gt;post_type;
+
+                $posts_columns = array();
+                $posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
+                /* translators: manage posts column name */
+                $posts_columns['title'] = _x( 'Title', 'column name' );
+                $posts_columns['author'] = __( 'Author' );
+                if ( empty( $post_type ) || is_object_in_taxonomy( $post_type, 'category' ) )
+                        $posts_columns['categories'] = __( 'Categories' );
+                if ( empty( $post_type ) || is_object_in_taxonomy( $post_type, 'post_tag' ) )
+                        $posts_columns['tags'] = __( 'Tags' );
+                $post_status = !empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
+                if ( !in_array( $post_status, array( 'pending', 'draft', 'future' ) ) &amp;&amp; ( empty( $post_type ) || post_type_supports( $post_type, 'comments' ) ) )
+                        $posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;Comments&quot; src=&quot;' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '&quot; /&gt;&lt;/div&gt;';
+                $posts_columns['date'] = __( 'Date' );
+
+                if ( 'page' == $post_type )
+                        $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
+                else
+                        $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
+                $posts_columns = apply_filters( &quot;manage_{$post_type}_posts_columns&quot;, $posts_columns );
+
+                return $posts_columns;
+        }
+
+        function get_sortable_columns() {
+                return array(
+                        'title'    =&gt; 'title',
+                        'author'   =&gt; 'author',
+                        'parent'   =&gt; 'parent',
+                        'comments' =&gt; 'comment_count',
+                        'date'     =&gt; 'date',
+                );
+        }
+
+        function display_rows( $posts = array() ) {
+                global $wp_query, $post_type_object, $per_page;
+
+                if ( empty( $posts ) )
+                        $posts = $wp_query-&gt;posts;
+
+                if ( $this-&gt;hierarchical_display ) {
+                        $this-&gt;_display_rows_hierarchical( $posts, $this-&gt;get_pagenum(), $per_page );
+                } else {
+                        $this-&gt;_display_rows( $posts );
+                }
+        }
+
+        function _display_rows( $posts ) {
+                global $post, $mode;
+
+                add_filter( 'the_title','esc_html' );
+
+                // Create array of post IDs.
+                $post_ids = array();
+
+                foreach ( $posts as $a_post )
+                        $post_ids[] = $a_post-&gt;ID;
+
+                $this-&gt;comment_pending_count = get_pending_comments_num( $post_ids );
+
+                foreach ( $posts as $post )
+                        $this-&gt;single_row( $post );
+        }
+
+        function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
+                global $wpdb;
+
+                $level = 0;
+
+                if ( ! $pages ) {
+                        $pages = get_pages( array( 'sort_column' =&gt; 'menu_order' ) );
+
+                        if ( ! $pages )
+                                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.
+                 * 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( $_REQUEST['s'] ) ) {
+
+                        $top_level_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;update( $wpdb-&gt;posts, array( 'post_parent' =&gt; 0 ), array( 'ID' =&gt; $page-&gt;ID ) );
+                                        clean_page_cache( $page-&gt;ID );
+                                }
+
+                                if ( 0 == $page-&gt;post_parent )
+                                        $top_level_pages[] = $page;
+                                else
+                                        $children_pages[ $page-&gt;post_parent ][] = $page;
+                        }
+
+                        $pages = &amp;$top_level_pages;
+                }
+
+                $count = 0;
+                $start = ( $pagenum - 1 ) * $per_page;
+                $end = $start + $per_page;
+
+                foreach ( $pages as $page ) {
+                        if ( $count &gt;= $end )
+                                break;
+
+                        if ( $count &gt;= $start )
+                                echo &quot;\t&quot; . $this-&gt;single_row( $page, $level );
+
+                        $count++;
+
+                        if ( isset( $children_pages ) )
+                                $this-&gt;_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 ){
+                                foreach ( $orphans as $op ) {
+                                        if ( $count &gt;= $end )
+                                                break;
+                                        if ( $count &gt;= $start )
+                                                echo &quot;\t&quot; . $this-&gt;single_row( $op, 0 );
+                                        $count++;
+                                }
+                        }
+                }
+        }
+
+        /**
+         * Given a top level page ID, display the nested hierarchy of sub-pages
+         * together with paging support
+         *
+         * @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;
+
+                $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();
+                                $my_parent = $page-&gt;post_parent;
+                                while ( $my_parent ) {
+                                        $my_parent = get_post( $my_parent );
+                                        $my_parents[] = $my_parent;
+                                        if ( !$my_parent-&gt;post_parent )
+                                                break;
+                                        $my_parent = $my_parent-&gt;post_parent;
+                                }
+                                $num_parents = count( $my_parents );
+                                while ( $my_parent = array_pop( $my_parents ) ) {
+                                        echo &quot;\t&quot; . $this-&gt;single_row( $my_parent, $level - $num_parents );
+                                        $num_parents--;
+                                }
+                        }
+
+                        if ( $count &gt;= $start )
+                                echo &quot;\t&quot; . $this-&gt;single_row( $page, $level );
+
+                        $count++;
+
+                        $this-&gt;_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
+        }
+
+        function single_row( $a_post, $level = 0 ) {
+                global $post, $current_screen, $mode;
+                static $rowclass;
+
+                $global_post = $post;
+                $post = $a_post;
+                setup_postdata( $post );
+
+                $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
+                $post_owner = ( get_current_user_id() == $post-&gt;post_author ? 'self' : 'other' );
+                $edit_link = get_edit_post_link( $post-&gt;ID );
+                $title = _draft_or_post_title();
+                $post_type_object = get_post_type_object( $post-&gt;post_type );
+                $can_edit_post = current_user_can( 'edit_post', $post-&gt;ID );
+        ?&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
+
+                list( $columns, $hidden ) = $this-&gt;get_column_info();
+
+                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':
+                        ?&gt;
+                        &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( $can_edit_post ) { ?&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 'title':
+                                if ( $this-&gt;hierarchical_display ) {
+                                        $attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
+
+                                        if ( 0 == $level &amp;&amp; (int) $post-&gt;post_parent &gt; 0 ) {
+                                                //sent level 0 by accident, by default, or because we don't know the actual level
+                                                $find_main_page = (int) $post-&gt;post_parent;
+                                                while ( $find_main_page &gt; 0 ) {
+                                                        $parent = get_page( $find_main_page );
+
+                                                        if ( is_null( $parent ) )
+                                                                break;
+
+                                                        $level++;
+                                                        $find_main_page = (int) $parent-&gt;post_parent;
+
+                                                        if ( !isset( $parent_name ) )
+                                                                $parent_name = $parent-&gt;post_title;
+                                                }
+                                        }
+
+                                        $post-&gt;post_title = esc_html( $post-&gt;post_title );
+                                        $pad = str_repeat( '&amp;#8212; ', $level );
+?&gt;
+                        &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( $can_edit_post &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( sprintf( __( 'Edit &amp;#8220;%s&amp;#8221;' ), $title ) ); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object-&gt;labels-&gt;parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?&gt;&lt;/strong&gt;
+&lt;?php
+                                }
+                                else {
+                                        $attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
+?&gt;
+                        &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( $can_edit_post &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( sprintf( __( 'Edit &amp;#8220;%s&amp;#8221;' ), $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 ( $can_edit_post &amp;&amp; 'trash' != $post-&gt;post_status ) {
+                                        $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link( $post-&gt;ID, true ) . '&quot; title=&quot;' . esc_attr( __( 'Edit this item' ) ) . '&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt;';
+                                        $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot; title=&quot;' . esc_attr( __( 'Edit this item inline' ) ) . '&quot;&gt;' . __( 'Quick&amp;nbsp;Edit' ) . '&lt;/a&gt;';
+                                }
+                                if ( current_user_can( $post_type_object-&gt;cap-&gt;delete_post, $post-&gt;ID ) ) {
+                                        if ( 'trash' == $post-&gt;post_status )
+                                                $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr( __( 'Restore this item from the Trash' ) ) . &quot;' href='&quot; . wp_nonce_url( admin_url( sprintf( $post_type_object-&gt;_edit_link . '&amp;amp;action=untrash', $post-&gt;ID ) ), 'untrash-' . $post-&gt;post_type . '_' . $post-&gt;ID ) . &quot;'&gt;&quot; . __( 'Restore' ) . &quot;&lt;/a&gt;&quot;;
+                                        elseif ( EMPTY_TRASH_DAYS )
+                                                $actions['trash'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr( __( 'Move this item to the Trash' ) ) . &quot;' href='&quot; . get_delete_post_link( $post-&gt;ID ) . &quot;'&gt;&quot; . __( 'Trash' ) . &quot;&lt;/a&gt;&quot;;
+                                        if ( 'trash' == $post-&gt;post_status || !EMPTY_TRASH_DAYS )
+                                                $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr( __( 'Delete this item permanently' ) ) . &quot;' href='&quot; . get_delete_post_link( $post-&gt;ID, '', true ) . &quot;'&gt;&quot; . __( 'Delete Permanently' ) . &quot;&lt;/a&gt;&quot;;
+                                }
+                                if ( in_array( $post-&gt;post_status, array( 'pending', 'draft' ) ) ) {
+                                        if ( $can_edit_post )
+                                                $actions['view'] = '&lt;a href=&quot;' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post-&gt;ID ) ) ) . '&quot; title=&quot;' . esc_attr( sprintf( __( 'Preview &amp;#8220;%s&amp;#8221;' ), $title ) ) . '&quot; rel=&quot;permalink&quot;&gt;' . __( 'Preview' ) . '&lt;/a&gt;';
+                                } elseif ( 'trash' != $post-&gt;post_status ) {
+                                        $actions['view'] = '&lt;a href=&quot;' . get_permalink( $post-&gt;ID ) . '&quot; title=&quot;' . esc_attr( sprintf( __( 'View &amp;#8220;%s&amp;#8221;' ), $title ) ) . '&quot; rel=&quot;permalink&quot;&gt;' . __( 'View' ) . '&lt;/a&gt;';
+                                }
+
+                                $actions = apply_filters( $this-&gt;hierarchical_display ? 'page_row_actions' : 'post_row_actions', $actions, $post );
+                                echo $this-&gt;row_actions( $actions );
+
+                                get_inline_data( $post );
+                        break;
+
+                        case 'date':
+                                if ( '0000-00-00 00:00:00' == $post-&gt;post_date &amp;&amp; 'date' == $column_name ) {
+                                        $t_time = $h_time = __( 'Unpublished' );
+                                        $time_diff = 0;
+                                } 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 ( $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 ( $time_diff &gt; 0 )
+                                                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 '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[] = sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
+                                                        add_query_arg( array( 'post_type' =&gt; $post-&gt;post_type, 'category_name' =&gt; $c-&gt;slug ), 'edit.php' ),
+                                                        esc_html( sanitize_term_field( 'name', $c-&gt;name, $c-&gt;term_id, 'category', 'display' ) )
+                                                );
+                                        }
+                                        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[] = sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
+                                                        add_query_arg( array( 'post_type' =&gt; $post-&gt;post_type, 'tag' =&gt; $c-&gt;slug ), 'edit.php' ),
+                                                        esc_html( sanitize_term_field( 'name', $c-&gt;name, $c-&gt;term_id, 'tag', 'display' ) )
+                                                );
+                                        }
+                                        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_comments = isset( $this-&gt;comment_pending_count[$post-&gt;ID] ) ? $this-&gt;comment_pending_count[$post-&gt;ID] : 0;
+
+                                $this-&gt;comments_bubble( $post-&gt;ID, $pending_comments );
+                        ?&gt;
+                        &lt;/div&gt;&lt;/td&gt;
+                        &lt;?php
+                        break;
+
+                        case 'author':
+                        ?&gt;
+                        &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;?php
+                                printf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
+                                        add_query_arg( array( 'post_type' =&gt; $post-&gt;post_type, 'author' =&gt; get_the_author_meta( 'ID' ) ), 'edit.php' ),
+                                        get_the_author()
+                                );
+                        ?&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;
+        }
+
+        /**
+         * Outputs the hidden row displayed when inline editing
+         *
+         * @since 3.1.0
+         */
+        function inline_edit() {
+                global $mode;
+
+                $screen = $this-&gt;_screen;
+
+                $post = get_default_post_to_edit( $screen-&gt;post_type );
+                $post_type_object = get_post_type_object( $screen-&gt;post_type );
+
+                $taxonomy_names = get_object_taxonomies( $screen-&gt;post_type );
+                $hierarchical_taxonomies = array();
+                $flat_taxonomies = array();
+                foreach ( $taxonomy_names as $taxonomy_name ) {
+                        $taxonomy = get_taxonomy( $taxonomy_name );
+
+                        if ( !$taxonomy-&gt;show_ui )
+                                continue;
+
+                        if ( $taxonomy-&gt;hierarchical )
+                                $hierarchical_taxonomies[] = $taxonomy;
+                        else
+                                $flat_taxonomies[] = $taxonomy;
+                }
+
+                list( $columns, $hidden ) = $this-&gt;get_column_info();
+
+                $col_count = count( $columns ) - count( $hidden );
+                $m = ( isset( $mode ) &amp;&amp; 'excerpt' == $mode ) ? 'excerpt' : 'list';
+                $can_publish = current_user_can( $post_type_object-&gt;cap-&gt;publish_posts );
+                $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
+                $hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page';
+                $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;$hclass inline-edit-$screen-&gt;post_type &quot;;
+                        echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$hclass bulk-edit-$screen-&gt;post_type&quot; : &quot;quick-edit-row quick-edit-row-$hclass inline-edit-$screen-&gt;post_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 ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
+
+
+        &lt;?php
+
+        if ( post_type_supports( $screen-&gt;post_type, 'title' ) ) :
+                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;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;?php endif; // $bulk
+        endif; // post_type_supports title ?&gt;
+
+        &lt;?php if ( !$bulk ) : ?&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
+
+                if ( post_type_supports( $screen-&gt;post_type, 'author' ) ) :
+                        $authors_dropdown = '';
+
+                        if ( is_super_admin() || current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) :
+                                $users_opt = array(
+                                        'name' =&gt; 'post_author',
+                                        'class'=&gt; 'authors',
+                                        'multi' =&gt; 1,
+                                        'echo' =&gt; 0
+                                );
+                                if ( $bulk )
+                                        $users_opt['show_option_none'] = __( '&amp;mdash; No Change &amp;mdash;' );
+                                $authors_dropdown  = '&lt;label&gt;';
+                                $authors_dropdown .= '&lt;span class=&quot;title&quot;&gt;' . __( 'Author' ) . '&lt;/span&gt;';
+                                $authors_dropdown .= wp_dropdown_users( $users_opt );
+                                $authors_dropdown .= '&lt;/label&gt;';
+                        endif; // authors
+        ?&gt;
+
+        &lt;?php if ( !$bulk ) echo $authors_dropdown;
+        endif; // post_type_supports author
+
+        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( '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
+                                        /* translators: Between password field and private checkbox on post quick edit interface */
+                                        echo __( '&amp;ndash;OR&amp;ndash;' );
+                                        ?&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 __( 'Private' ); ?&gt;&lt;/span&gt;
+                                &lt;/label&gt;
+                        &lt;/div&gt;
+
+        &lt;?php endif; ?&gt;
+
+                &lt;/div&gt;&lt;/fieldset&gt;
+
+        &lt;?php if ( count( $hierarchical_taxonomies ) &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;?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?&gt;
+
+                        &lt;span class=&quot;title inline-edit-categories-label&quot;&gt;&lt;?php echo esc_html( $taxonomy-&gt;labels-&gt;name ) ?&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;input type=&quot;hidden&quot; name=&quot;&lt;?php echo ( $taxonomy-&gt;name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy-&gt;name ) . '][]'; ?&gt;&quot; value=&quot;0&quot; /&gt;
+                        &lt;ul class=&quot;cat-checklist &lt;?php echo esc_attr( $taxonomy-&gt;name )?&gt;-checklist&quot;&gt;
+                                &lt;?php wp_terms_checklist( null, array( 'taxonomy' =&gt; $taxonomy-&gt;name ) ) ?&gt;
+                        &lt;/ul&gt;
+
+        &lt;?php endforeach; //$hierarchical_taxonomies as $taxonomy ?&gt;
+
+                &lt;/div&gt;&lt;/fieldset&gt;
+
+        &lt;?php endif; // count( $hierarchical_taxonomies ) &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 ( post_type_supports( $screen-&gt;post_type, 'author' ) &amp;&amp; $bulk )
+                        echo $authors_dropdown;
+        ?&gt;
+
+        &lt;?php if ( $post_type_object-&gt;hierarchical ) : ?&gt;
+
+                        &lt;label&gt;
+                                &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Parent' ); ?&gt;&lt;/span&gt;
+        &lt;?php
+                $dropdown_args = array( 'post_type' =&gt; $post_type_object-&gt;name, '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'] =  __( '&amp;mdash; No Change &amp;mdash;' );
+                $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
+                wp_dropdown_pages( $dropdown_args );
+        ?&gt;
+                        &lt;/label&gt;
+
+        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'page-attributes' ) ) :
+                        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( '&amp;mdash; No Change &amp;mdash;' ); ?&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
+                endif; // post_type_supports page-attributes
+        endif; // $post_type_object-&gt;hierarchical ?&gt;
+
+        &lt;?php if ( count( $flat_taxonomies ) &amp;&amp; !$bulk ) : ?&gt;
+
+        &lt;?php foreach ( $flat_taxonomies as $taxonomy ) : ?&gt;
+
+                        &lt;label class=&quot;inline-edit-tags&quot;&gt;
+                                &lt;span class=&quot;title&quot;&gt;&lt;?php echo esc_html( $taxonomy-&gt;labels-&gt;name ) ?&gt;&lt;/span&gt;
+                                &lt;textarea cols=&quot;22&quot; rows=&quot;1&quot; name=&quot;tax_input[&lt;?php echo esc_attr( $taxonomy-&gt;name )?&gt;]&quot; class=&quot;tax_input_&lt;?php echo esc_attr( $taxonomy-&gt;name )?&gt;&quot;&gt;&lt;/textarea&gt;
+                        &lt;/label&gt;
+
+        &lt;?php endforeach; //$flat_taxonomies as $taxonomy ?&gt;
+
+        &lt;?php endif; // count( $flat_taxonomies ) &amp;&amp; !$bulk  ?&gt;
+
+        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) || post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) :
+                if ( $bulk ) : ?&gt;
+
+                        &lt;div class=&quot;inline-edit-group&quot;&gt;
+                &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) ) : ?&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( '&amp;mdash; No Change &amp;mdash;' ); ?&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;?php endif; if ( post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) : ?&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( '&amp;mdash; No Change &amp;mdash;' ); ?&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;?php endif; ?&gt;
+                        &lt;/div&gt;
+
+        &lt;?php else : // $bulk ?&gt;
+
+                        &lt;div class=&quot;inline-edit-group&quot;&gt;
+                        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) ) : ?&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;?php endif; if ( post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) : ?&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;?php endif; ?&gt;
+                        &lt;/div&gt;
+
+        &lt;?php endif; // $bulk
+        endif; // post_type_supports comments or pings ?&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( '&amp;mdash; No Change &amp;mdash;' ); ?&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( 'Draft' ); ?&gt;&lt;/option&gt;
+                                        &lt;/select&gt;
+                                &lt;/label&gt;
+
+        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'sticky' ) &amp;&amp; $can_publish &amp;&amp; current_user_can( $post_type_object-&gt;cap-&gt;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( '&amp;mdash; No Change &amp;mdash;' ); ?&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 sticky' ); ?&gt;&lt;/span&gt;
+                                &lt;/label&gt;
+
+        &lt;?php        endif; // $bulk ?&gt;
+
+        &lt;?php endif; // post_type_supports(sticky) &amp;&amp; $can_publish &amp;&amp; current_user_can( 'edit_others_cap' ) ?&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, $screen-&gt;post_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 = __( 'Update' );
+                                ?&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 esc_attr( $update_text ); ?&gt;&lt;/a&gt;
+                                &lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; alt=&quot;&quot; /&gt;
+                        &lt;?php } else {
+                                $update_text = __( 'Update' );
+                        ?&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 esc_attr( $update_text ); ?&gt;&quot; /&gt;
+                        &lt;?php } ?&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;post_view&quot; value=&quot;&lt;?php echo esc_attr( $m ); ?&gt;&quot; /&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;screen&quot; value=&quot;&lt;?php echo esc_attr( $screen-&gt;id ); ?&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
+        }
+}
+
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminincludeslisttablephp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/includes/list-table.php (15953 => 15954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/list-table.php        2010-10-24 21:45:35 UTC (rev 15953)
+++ trunk/wp-admin/includes/list-table.php        2010-10-25 00:12:41 UTC (rev 15954)
</span><span class="lines">@@ -1,829 +0,0 @@
</span><del>-&lt;?php
-
-/**
- * Base class for displaying a list of items as an ajaxified html table
- *
- * @package WordPress
- * @since 3.1.0
- */
-class WP_List_Table {
-
-        /**
-         * The current list of items
-         *
-         * @since 3.1.0
-         * @var array
-         * @access protected
-         */
-        var $items;
-
-        /**
-         * Various information about the current table
-         *
-         * @since 3.1.0
-         * @var array
-         * @access private
-         */
-        var $_args;
-
-        /**
-         * Various information needed for displaying the pagination
-         *
-         * @since 3.1.0
-         * @var array
-         * @access private
-         */
-        var $_pagination_args = array();
-
-        /**
-         * The current screen
-         *
-         * @since 3.1.0
-         * @var object
-         * @access private
-         */
-        var $_screen;
-
-        /**
-         * Cached bulk actions
-         *
-         * @since 3.1.0
-         * @var array
-         * @access private
-         */
-        var $_actions;
-
-        /**
-         * Cached pagination output
-         *
-         * @since 3.1.0
-         * @var string
-         * @access private
-         */
-        var $_pagination;
-
-        /**
-         * Constructor. The child class should call this constructor from it's own constructor
-         *
-         * @param array $args An associative array with information about the current table
-         * @access protected
-         */
-        function WP_List_Table( $args ) {
-                $args = wp_parse_args( $args, array(
-                        'screen' =&gt; '',
-                        'plural' =&gt; '',
-                        'singular' =&gt; '',
-                        'ajax' =&gt; true
-                ) );
-
-                $this-&gt;_screen = $args['screen'];
-
-                if ( is_string( $this-&gt;_screen ) )
-                        $this-&gt;_screen = convert_to_screen( $this-&gt;_screen );
-
-                add_filter( 'manage_' . $this-&gt;_screen-&gt;id . '_columns', array( $this, 'get_columns' ), 0 );
-
-                if ( !$args['plural'] )
-                        $args['plural'] = $this-&gt;_screen-&gt;base;
-
-                $this-&gt;_args = $args;
-
-                if ( $args['ajax'] ) {
-                        wp_enqueue_script( 'list-table' );
-                        add_action( 'admin_footer', array( $this, '_js_vars' ) );
-                }
-        }
-
-        /**
-         * Checks the current user's permissions
-         * @uses wp_die()
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function check_permissions() {
-                die( 'function WP_List_Table::check_permissions() must be over-ridden in a sub-class.' );
-        }
-
-        /**
-         * Prepares the list of items for displaying.
-         * @uses WP_List_Table::set_pagination_args()
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function prepare_items() {
-                die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
-        }
-
-        /**
-         * An internal method that sets all the necessary pagination arguments
-         *
-         * @param array $args An associative array with information about the pagination
-         * @access protected
-         */
-        function set_pagination_args( $args ) {
-                $args = wp_parse_args( $args, array(
-                        'query_var' =&gt; 'paged',
-                        'total_items' =&gt; 0,
-                        'total_pages' =&gt; 0,
-                        'per_page' =&gt; 0,
-                ) );
-
-                if ( !$args['total_pages'] &amp;&amp; $args['per_page'] &gt; 0 )
-                        $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
-
-                $this-&gt;_pagination_args = $args;
-        }
-
-        /**
-         * Access the pagination args
-         *
-         * @since 3.1.0
-         * @access public
-         *
-         * @param string $key
-         * @return array
-         */
-        function get_pagination_arg( $key ) {
-                if ( 'page' == $key )
-                        return $this-&gt;get_pagenum();
-
-                if ( isset( $this-&gt;_pagination_args[$key] ) )
-                        return $this-&gt;_pagination_args[$key];
-        }
-
-        /**
-         * Whether the table has items to display or not
-         *
-         * @since 3.1.0
-         * @access public
-         *
-         * @return bool
-         */
-        function has_items() {
-                return !empty( $this-&gt;items );
-        }
-
-        /**
-         * Message to be displayed when there are no items
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function no_items() {
-                _e( 'No items found.' );
-        }
-
-        /**
-         * Get an associative array ( id =&gt; link ) with the list
-         * of views available on this table.
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return array
-         */
-        function get_views() {
-                return array();
-        }
-
-        /**
-         * Display the bulk actions dropdown.
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function views() {
-                $views = $this-&gt;get_views();
-                $views = apply_filters( 'views_' . $this-&gt;_screen-&gt;base, $views );
-
-                if ( empty( $views ) )
-                        return;
-
-                echo &quot;&lt;ul class='subsubsub'&gt;\n&quot;;
-                echo implode( &quot; |&lt;/li&gt;\n&quot;, $views ) . &quot;&lt;/li&gt;\n&quot;;
-                echo &quot;&lt;/ul&gt;&quot;;
-        }
-
-        /**
-         * Get an associative array ( option_name =&gt; option_title ) with the list
-         * of bulk actions available on this table.
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return array
-         */
-        function get_bulk_actions() {
-                return array();
-        }
-
-        /**
-         * Display the bulk actions dropdown.
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function bulk_actions() {
-
-                if ( is_null( $this-&gt;_actions ) ) {
-                        $this-&gt;_actions = $this-&gt;get_bulk_actions();
-                        $this-&gt;_actions = apply_filters( 'bulk_actions-' . $this-&gt;_screen-&gt;base, $this-&gt;_actions );
-                        $two = '';
-                }
-                else {
-                        $two = '2';
-                }
-
-                if ( empty( $this-&gt;_actions ) )
-                        return;
-
-                echo &quot;&lt;select name='action$two'&gt;\n&quot;;
-                echo &quot;&lt;option value='-1' selected='selected'&gt;&quot; . __( 'Bulk Actions' ) . &quot;&lt;/option&gt;\n&quot;;
-                foreach ( $this-&gt;_actions as $name =&gt; $title )
-                        echo &quot;\t&lt;option value='$name'&gt;$title&lt;/option&gt;\n&quot;;
-                echo &quot;&lt;/select&gt;\n&quot;;
-
-                echo &quot;&lt;input type='submit' value='&quot; . esc_attr__( 'Apply' ) . &quot;' name='doaction$two' id='doaction$two' class='button-secondary action' /&gt;\n&quot;;
-        }
-
-        /**
-         * Get the current action selected from the bulk actions dropdown.
-         *
-         * @since 3.1.0
-         * @access public
-         *
-         * @return string|bool The action name or False if no action was selected
-         */
-        function current_action() {
-                if ( isset( $_REQUEST['action'] ) &amp;&amp; -1 != $_REQUEST['action'] )
-                        return $_REQUEST['action'];
-
-                if ( isset( $_REQUEST['action2'] ) &amp;&amp; -1 != $_REQUEST['action2'] )
-                        return $_REQUEST['action2'];
-
-                return false;
-        }
-
-        /**
-         * Generate row actions div
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @param array $actions The list of actions
-         * @param bool $always_visible Wether the actions should be always visible
-         * @return string
-         */
-        function row_actions( $actions, $always_visible = false ) {
-                $action_count = count( $actions );
-                $i = 0;
-
-                if ( !$action_count )
-                        return '';
-
-                $out = '&lt;div class=&quot;' . ( $always_visible ? 'row-actions-visible' : '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;';
-
-                return $out;
-        }
-
-        /**
-         * Display a monthly dropdown for filtering items
-         *
-         * @since 3.1.0
-         * @access protected
-         */
-        function months_dropdown( $post_type ) {
-                global $wpdb, $wp_locale;
-
-                $months = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;
-                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
-                        FROM $wpdb-&gt;posts
-                        WHERE post_type = %s
-                        ORDER BY post_date DESC
-                &quot;, $post_type ) );
-
-                $month_count = count( $months );
-
-                if ( !$month_count || ( 1 == $month_count &amp;&amp; 0 == $months[0]-&gt;month ) )
-                        return;
-
-                $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
-?&gt;
-                &lt;select name='m'&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 ( $months as $arc_row ) {
-                        if ( 0 == $arc_row-&gt;year )
-                                continue;
-
-                        $month = zeroise( $arc_row-&gt;month, 2 );
-                        $year = $arc_row-&gt;year;
-
-                        printf( &quot;&lt;option %s value='%s'&gt;%s&lt;/option&gt;\n&quot;,
-                                selected( $m, $year . $month, false ),
-                                esc_attr( $arc_row-&gt;year . $month ),
-                                $wp_locale-&gt;get_month( $month ) . &quot; $year&quot;
-                        );
-                }
-?&gt;
-                &lt;/select&gt;
-&lt;?php
-        }
-
-        /**
-         * Display a view switcher
-         *
-         * @since 3.1.0
-         * @access protected
-         */
-        function view_switcher( $current_mode ) {
-                $modes = array(
-                        'list'    =&gt; __( 'List View' ),
-                        'excerpt' =&gt; __( 'Excerpt View' )
-                );
-
-?&gt;
-                &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo esc_attr( $current_mode ); ?&gt;&quot; /&gt;
-                &lt;div class=&quot;view-switch&quot;&gt;
-&lt;?php
-                        foreach ( $modes as $mode =&gt; $title ) {
-                                $class = ( $current_mode == $mode ) ? 'class=&quot;current&quot;' : '';
-                                echo &quot;&lt;a href='&quot; . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . &quot;' $class&gt;&lt;img id='view-switch-$mode' src='&quot; . esc_url( includes_url( 'images/blank.gif' ) ) . &quot;' width='20' height='20' title='$title' alt='$title' /&gt;&lt;/a&gt;\n&quot;;
-                        }
-                ?&gt;
-                &lt;/div&gt;
-&lt;?php
-        }
-
-        /**
-         * Display a comment count bubble
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @param int $post_id
-         * @param int $pending_comments
-         */
-        function comments_bubble( $post_id, $pending_comments ) {
-                $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
-
-                if ( $pending_comments )
-                        echo '&lt;strong&gt;';
-
-                $link = &quot;&lt;a href='&quot; . add_query_arg( 'p', $post_id, admin_url('edit-comments.php') ) . &quot;' title='$pending_phrase' class='post-com-count'&gt;&lt;span class='comment-count'&gt;%s&lt;/span&gt;&lt;/a&gt;&quot;;
-
-                comments_number(
-                        sprintf( $link, /* translators: comment count link */ _x( '0', 'comment count' ) ),
-                        sprintf( $link, /* translators: comment count link */ _x( '1', 'comment count' ) ),
-                        sprintf( $link, /* translators: comment count link: % will be substituted by comment count */ _x( '%', 'comment count' ) )
-                );
-
-                if ( $pending_comments )
-                        echo '&lt;/strong&gt;';
-        }
-
-        /**
-         * Get the current page number
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return int
-         */
-        function get_pagenum( $query_var = 'paged' ) {
-                $pagenum = isset( $_REQUEST[$query_var] ) ? absint( $_REQUEST[$query_var] ) : 0;
-
-                return max( 1, $pagenum );
-        }
-
-        /**
-         * Get number of items to display on a single page
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return int
-         */
-        function get_items_per_page( $option, $default = 20 ) {
-                $per_page = (int) get_user_option( $option );
-                if ( empty( $per_page ) || $per_page &lt; 1 )
-                        $per_page = $default;
-
-                return (int) apply_filters( $option, $per_page );
-        }
-
-        /**
-         * Display the pagination.
-         *
-         * @since 3.1.0
-         * @access protected
-         */
-        function pagination() {
-                if ( $this-&gt;_pagination ) {
-                        echo $this-&gt;_pagination;
-                        return;
-                }
-
-                if ( empty( $this-&gt;_pagination_args ) )
-                        return;
-
-                extract( $this-&gt;_pagination_args );
-
-                if ( $total_pages &lt; 2 )
-                        return;
-
-                $output = '&lt;span class=&quot;displaying-num&quot;&gt;' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '&lt;/span&gt;';
-
-                $current = $this-&gt;get_pagenum( $query_var );
-
-                $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
-
-                $page_links = array();
-
-                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
-                        'first-page',
-                        esc_attr__( 'Go to the first page' ),
-                        esc_url( remove_query_arg( $query_var, $current_url ) ),
-                        '&amp;laquo;&amp;laquo;'
-                );
-
-                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
-                        'prev-page',
-                        esc_attr__( 'Go to the previous page' ),
-                        esc_url( add_query_arg( $query_var, max( 1, $current-1 ), $current_url ) ),
-                        '&amp;laquo;'
-                );
-
-                $html_current_page = sprintf( &quot;&lt;input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' /&gt;&quot;,
-                        esc_attr__( 'Current page' ),
-                        esc_attr( $query_var ),
-                        number_format_i18n( $current ),
-                        strlen( $total_pages )
-                );
-                $html_total_pages = sprintf( &quot;&lt;span class='total-pages'&gt;%s&lt;/span&gt;&quot;, number_format_i18n( $total_pages ) );
-                $page_links[] = sprintf( _x( '%s of %s', 'paging' ), $html_current_page, $html_total_pages );
-
-                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
-                        'next-page',
-                        esc_attr__( 'Go to the next page' ),
-                        esc_url( add_query_arg( $query_var, min( $total_pages, $current+1 ), $current_url ) ),
-                        '&amp;raquo;'
-                );
-
-                $page_links[] = sprintf( &quot;&lt;a class='%s' title='%s' href='%s'&gt;%s&lt;/a&gt;&quot;,
-                        'last-page',
-                        esc_attr__( 'Go to the last page' ),
-                        esc_url( add_query_arg( $query_var, $total_pages, $current_url ) ),
-                        '&amp;raquo;&amp;raquo;'
-                );
-
-                $output .= join( &quot;\n&quot;, $page_links );
-
-                $this-&gt;_pagination = &quot;&lt;div class='tablenav-pages'&gt;$output&lt;/div&gt;&quot;;
-
-                echo $this-&gt;_pagination;
-        }
-
-        /**
-         * Get a list of columns. The format is internal_name =&gt; title
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return array
-         */
-        function get_columns() {
-                die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
-        }
-
-        /**
-         * Get a list of sortable columns. The format is internal_name =&gt; orderby
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return array
-         */
-        function get_sortable_columns() {
-                return array();
-        }
-
-        /**
-         * Get a list of all, hidden and sortable columns, with filter applied
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return array
-         */
-        function get_column_info() {
-                if ( !isset( $this-&gt;_column_headers ) ) {
-                        $columns = get_column_headers( $this-&gt;_screen );
-                        $hidden = get_hidden_columns( $this-&gt;_screen );
-                        $sortable = apply_filters( 'manage_' . $this-&gt;_screen-&gt;id . '_sortable_columns', $this-&gt;get_sortable_columns() );
-
-                        $this-&gt;_column_headers = array( $columns, $hidden, $sortable );
-                }
-
-                return $this-&gt;_column_headers;
-        }
-
-        /**
-         * Print column headers, accounting for hidden and sortable columns.
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @param bool $with_id Whether to set the id attribute or not
-         */
-        function print_column_headers( $with_id = true ) {
-                $screen = $this-&gt;_screen;
-
-                list( $columns, $hidden, $sortable ) = $this-&gt;get_column_info();
-
-                $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
-
-                if ( isset( $_GET['orderby'] ) )
-                        $current_orderby = $_GET['orderby'];
-                else
-                        $current_orderby = '';
-
-                if ( isset( $_GET['order'] ) &amp;&amp; 'desc' == $_GET['order'] )
-                        $current_order = 'desc';
-                else
-                        $current_order = 'asc';
-
-                foreach ( $columns as $column_key =&gt; $column_display_name ) {
-                        $class = array( 'manage-column', &quot;column-$column_key&quot; );
-
-                        $style = '';
-                        if ( in_array( $column_key, $hidden ) )
-                                $style = 'display:none;';
-
-                        $style = ' style=&quot;' . $style . '&quot;';
-
-                        if ( 'cb' == $column_key )
-                                $class[] = 'check-column';
-                        elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
-                                $class[] = 'num';
-
-                        if ( isset( $sortable[$column_key] ) ) {
-                                $orderby = $sortable[$column_key];
-                                if ( $current_orderby == $orderby ) {
-                                        $order = 'asc' == $current_order ? 'desc' : 'asc';
-                                        $class[] = &quot;sorted-$current_order&quot;;
-                                } else {
-                                        $order = 'asc';
-                                        $class[] = 'sortable';
-                                }
-                                $column_display_name = '&lt;a href=&quot;' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '&quot;&gt;' . $column_display_name . '&lt;/a&gt;';
-                                $column_display_name .= '&lt;div class=&quot;sorting-indicator&quot;&gt;&lt;/div&gt;';
-                        }
-
-                        $id = $with_id ? &quot;id='$column_key'&quot; : '';
-
-                        if ( !empty( $class ) )
-                                $class = &quot;class='&quot; . join( ' ', $class ) . &quot;'&quot;;
-
-                        echo &quot;&lt;th scope='col' $id $class $style&gt;$column_display_name&lt;/th&gt;&quot;;
-                }
-        }
-
-        /**
-         * Display the table or a message if there are no items
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function display() {
-                if ( $this-&gt;has_items() ) {
-                        $this-&gt;display_table();
-                } else {
-                        echo '&lt;br class=&quot;clear&quot;&gt;';
-                        $this-&gt;extra_tablenav( 'top' );
-                        echo '&lt;br class=&quot;clear&quot;&gt;';
-                        echo '&lt;p&gt;';
-                        $this-&gt;no_items();
-                        echo '&lt;/p&gt;';
-                }
-        }
-
-        /**
-         * Get a list of CSS classes for the &lt;table&gt; tag
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @return array
-         */
-        function get_table_classes() {
-                extract( $this-&gt;_args );
-
-                return array( 'widefat', 'fixed', $plural );
-        }
-
-        /**
-         * Display the full table
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function display_table() {
-                extract( $this-&gt;_args );
-
-                $this-&gt;display_tablenav( 'top' );
-
-?&gt;
-&lt;table class=&quot;&lt;?php echo implode( ' ', $this-&gt;get_table_classes() ); ?&gt;&quot; cellspacing=&quot;0&quot;&gt;
-        &lt;thead&gt;
-        &lt;tr&gt;
-                &lt;?php $this-&gt;print_column_headers(); ?&gt;
-        &lt;/tr&gt;
-        &lt;/thead&gt;
-
-        &lt;tfoot&gt;
-        &lt;tr&gt;
-                &lt;?php $this-&gt;print_column_headers( false ); ?&gt;
-        &lt;/tr&gt;
-        &lt;/tfoot&gt;
-
-        &lt;tbody id=&quot;the-list&quot;&lt;?php if ( $singular ) echo &quot; class='list:$singular'&quot;; ?&gt;&gt;
-                &lt;?php $this-&gt;display_rows(); ?&gt;
-        &lt;/tbody&gt;
-&lt;/table&gt;
-&lt;?php
-
-                $this-&gt;display_tablenav( 'bottom' );
-        }
-
-        /**
-         * Generate the table navigation above or below the table
-         *
-         * @since 3.1.0
-         * @access protected
-         */
-        function display_tablenav( $which ) {
-                if ( 'top' == $which )
-                        wp_nonce_field( 'bulk-' . $this-&gt;_args['plural'] );
-?&gt;
-        &lt;div class=&quot;tablenav&quot;&gt;
-
-                &lt;div class=&quot;alignleft actions&quot;&gt;
-                        &lt;?php $this-&gt;bulk_actions( $which ); ?&gt;
-                &lt;/div&gt;
-
-        &lt;?php
-                $this-&gt;extra_tablenav( $which );
-                $this-&gt;pagination( $which );
-        ?&gt;
-
-                &lt;br class=&quot;clear&quot;&gt;
-        &lt;/div&gt;
-
-        &lt;br class=&quot;clear&quot;&gt;
-&lt;?php
-        }
-
-        /**
-         * Extra controls to be displayed between bulk actions and pagination
-         *
-         * @since 3.1.0
-         * @access protected
-         */
-        function extra_tablenav( $which ) {}
-
-        /**
-         * Generate the &lt;tbody&gt; part of the table
-         *
-         * @since 3.1.0
-         * @access protected
-         */
-        function display_rows() {
-                foreach ( $this-&gt;items as $item )
-                        $this-&gt;single_row( $item );
-        }
-
-        /**
-         * Generates content for a single row of the table
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @param $object $item The current item
-         */
-        function single_row( $item ) {
-                static $row_class = '';
-                $row_class = ( $row_class == '' ? ' class=&quot;alternate&quot;' : '' );
-
-                echo '&lt;tr' . $row_class . '&gt;';
-                echo $this-&gt;single_row_columns( $item );
-                echo '&lt;/tr&gt;';
-        }
-
-        /**
-         * Generates the columns for a single row of the table
-         *
-         * @since 3.1.0
-         * @access protected
-         *
-         * @param $object $item The current item
-         */
-        function single_row_columns( $item ) {
-                list( $columns, $hidden ) = $this-&gt;get_column_info();
-
-                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;;
-
-                        if ( 'cb' == $column_name ) {
-                                echo '&lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;';
-                                echo $this-&gt;column_cb( $item );
-                                echo '&lt;/th&gt;';
-                        }
-                        elseif ( method_exists( $this, 'column_' . $column_name ) ) {
-                                echo &quot;&lt;td $attributes&gt;&quot;;
-                                echo call_user_func( array( $this, 'column_' . $column_name ), $item );
-                                echo &quot;&lt;/td&gt;&quot;;
-                        }
-                        else {
-                                echo &quot;&lt;td $attributes&gt;&quot;;
-                                echo $this-&gt;column_default( $item, $column_name );
-                                echo &quot;&lt;/td&gt;&quot;;
-                        }
-                }
-        }
-
-        /**
-         * Handle an incoming ajax request (called from admin-ajax.php)
-         *
-         * @since 3.1.0
-         * @access public
-         */
-        function ajax_response() {
-                $this-&gt;check_permissions();
-                $this-&gt;prepare_items();
-
-                extract( $this-&gt;_args );
-                extract( $this-&gt;_pagination_args );
-
-                ob_start();
-                $this-&gt;display_rows();
-                $rows = ob_get_clean();
-
-                $response = array( 'rows' =&gt; $rows );
-
-                if ( isset( $total_items ) )
-                        $response['total_items'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );
-
-                if ( isset( $total_pages ) )
-                        $response['total_pages'] = $total_pages;
-
-                die( json_encode( $response ) );
-        }
-
-        /**
-         * Send required variables to JavaScript land
-         *
-         * @access private
-         */
-        function _js_vars() {
-                extract( $this-&gt;_args );
-
-                $class = get_class( $this );
-
-                printf( &quot;&lt;script type='text/javascript'&gt;list_args = %s;&lt;/script&gt;\n&quot;,
-                        json_encode( compact( 'screen', 'class' ) )
-                );
-        }
-}
-
-/**
- * Fetch an instance of a WP_List_Table class
- *
- * @since 3.1.0
- *
- * @param string $type The type of the list table
- * @return object
- */
-function get_list_table( $type ) {
-        require_once( ABSPATH . '/wp-admin/includes/default-list-tables.php' );
-
-        $class = 'WP_' . strtr( ucwords( strtr( $type, '-', ' ') ), ' ', '_' ) . '_Table';
-        $class = apply_filters( &quot;get_list_table_$type&quot;, $class );
-
-        return new $class;
-}
-
</del></span></pre>
</div>
</div>

</body>
</html>