+ if ( ! current_user_can('edit_' . $post->post_type, $post->ID) )
+ return;
+
+ $title = esc_attr($post->post_title);
+
+ echo '
+<div class="hidden" id="inline_' . $post->ID . '">
+ <div class="post_title">' . $title . '</div>
+ <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
+ <div class="post_author">' . $post->post_author . '</div>
+ <div class="comment_status">' . $post->comment_status . '</div>
+ <div class="ping_status">' . $post->ping_status . '</div>
+ <div class="_status">' . $post->post_status . '</div>
+ <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>
+ <div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div>
+ <div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div>
+ <div class="hh">' . mysql2date( 'H', $post->post_date, false ) . '</div>
+ <div class="mn">' . mysql2date( 'i', $post->post_date, false ) . '</div>
+ <div class="ss">' . mysql2date( 's', $post->post_date, false ) . '</div>
+ <div class="post_password">' . esc_html( $post->post_password ) . '</div>';
+
+ if( $post->post_type == 'page' )
+ echo '
+ <div class="post_parent">' . $post->post_parent . '</div>
+ <div class="page_template">' . esc_html( get_post_meta( $post->ID, '_wp_page_template', true ) ) . '</div>
+ <div class="menu_order">' . $post->menu_order . '</div>';
+
+ if( $post->post_type == 'post' )
+ echo '
+ <div class="tags_input">' . esc_html( str_replace( ',', ', ', get_tags_to_edit($post->ID) ) ) . '</div>
+ <div class="post_category">' . implode( ',', wp_get_post_categories( $post->ID ) ) . '</div>
+ <div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
+
+ echo '</div>';
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $posts
+ */
+function post_rows( $posts = array() ) {
+ global $wp_query, $post, $mode;
+
+ add_filter('the_title','esc_html');
+
+ // Create array of post IDs.
+ $post_ids = array();
+
+ if ( empty($posts) )
+ $posts = &$wp_query->posts;
+
+ foreach ( $posts as $a_post )
+ $post_ids[] = $a_post->ID;
+
+ $comment_pending_count = get_pending_comments_num($post_ids);
+ if ( empty($comment_pending_count) )
+ $comment_pending_count = array();
+
+ foreach ( $posts as $post ) {
+ if ( empty($comment_pending_count[$post->ID]) )
+ $comment_pending_count[$post->ID] = 0;
+
+ _post_row($post, $comment_pending_count[$post->ID], $mode);
+ }
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $a_post
+ * @param unknown_type $pending_comments
+ * @param unknown_type $mode
+ */
+function _post_row($a_post, $pending_comments, $mode) {
+ global $post, $current_user;
+ static $rowclass;
+
+ $global_post = $post;
+ $post = $a_post;
+ setup_postdata($post);
+
+ $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
+ $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
+ $edit_link = get_edit_post_link( $post->ID );
+ $title = _draft_or_post_title();
+?>
+ <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top">
+<?php
+ $posts_columns = get_column_headers('edit');
+ $hidden = get_hidden_columns('edit');
+ foreach ( $posts_columns as $column_name=>$column_display_name ) {
+ $class = "class=\"$column_name column-$column_name\"";
+
+ $style = '';
+ if ( in_array($column_name, $hidden) )
+ $style = ' style="display:none;"';
+
+ $attributes = "$class$style";
+
+ switch ($column_name) {
+
+ case 'cb':
+ ?>
+ <th scope="row" class="check-column"><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>
+ <?php
+ break;
+
+ case 'date':
+ if ( '0000-00-00 00:00:00' == $post->post_date && '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->post_date;
+ $time = get_post_time('G', true, $post);
+
+ $time_diff = time() - $time;
+
+ if ( $time_diff > 0 && $time_diff < 24*60*60 )
+ $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
+ else
+ $h_time = mysql2date(__('Y/m/d'), $m_time);
+ }
+
+ echo '<td ' . $attributes . '>';
+ if ( 'excerpt' == $mode )
+ echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode);
+ else
+ echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>';
+ echo '<br />';
+ if ( 'publish' == $post->post_status ) {
+ _e('Published');
+ } elseif ( 'future' == $post->post_status ) {
+ if ( $time_diff > 0 )
+ echo '<strong class="attention">' . __('Missed schedule') . '</strong>';
+ else
+ _e('Scheduled');
+ } else {
+ _e('Last Modified');
+ }
+ echo '</td>';
+ break;
+
+ case 'title':
+ $attributes = 'class="post-title column-title"' . $style;
+ ?>
+ <td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_post', $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>
+ <?php
+ if ( 'excerpt' == $mode )
+ the_excerpt();
+
+ $actions = array();
+ if ( current_user_can('edit_post', $post->ID) && 'trash' != $post->post_status ) {
+ $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>';
+ }
+ if ( current_user_can('delete_post', $post->ID) ) {
+ if ( 'trash' == $post->post_status )
+ $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
+ elseif ( EMPTY_TRASH_DAYS )
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
+ }
+ if ( in_array($post->post_status, array('pending', 'draft')) ) {
+ if ( current_user_can('edit_post', $post->ID) )
+ $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
+ } elseif ( 'trash' != $post->post_status ) {
+ $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+ }
+ $actions = apply_filters('post_row_actions', $actions, $post);
+ $action_count = count($actions);
+ $i = 0;
+ echo '<div class="row-actions">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+ echo "<span class='$action'>$link$sep</span>";
+ }
+ echo '</div>';
+
+ get_inline_data($post);
+ ?>
+ </td>
+ <?php
+ break;
+
+ case 'categories':
+ ?>
+ <td <?php echo $attributes ?>><?php
+ $categories = get_the_category();
+ if ( !empty( $categories ) ) {
+ $out = array();
+ foreach ( $categories as $c )
+ $out[] = "<a href='edit.php?category_name=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
+ echo join( ', ', $out );
+ } else {
+ _e('Uncategorized');
+ }
+ ?></td>
+ <?php
+ break;
+
+ case 'tags':
+ ?>
+ <td <?php echo $attributes ?>><?php
+ $tags = get_the_tags($post->ID);
+ if ( !empty( $tags ) ) {
+ $out = array();
+ foreach ( $tags as $c )
+ $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
+ echo join( ', ', $out );
+ } else {
+ _e('No Tags');
+ }
+ ?></td>
+ <?php
+ break;
+
+ case 'comments':
+ ?>
+ <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
+ <?php
+ $pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) );
+ if ( $pending_comments )
+ echo '<strong>';
+ comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
+ if ( $pending_comments )
+ echo '</strong>';
+ ?>
+ </div></td>
+ <?php
+ break;
+
+ case 'author':
+ ?>
+ <td <?php echo $attributes ?>><a href="edit.php?author=<?php the_author_meta('ID'); ?>"><?php the_author() ?></a></td>
+ <?php
+ break;
+
+ case 'control_view':
+ ?>
+ <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
+ <?php
+ break;
+
+ case 'control_edit':
+ ?>
+ <td><?php if ( current_user_can('edit_post', $post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>
+ <?php
+ break;
+
+ case 'control_delete':
+ ?>
+ <td><?php if ( current_user_can('delete_post', $post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>
+ <?php
+ break;
+
+ default:
+ ?>
+ <td <?php echo $attributes ?>><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></td>
+ <?php
+ break;
+ }
+}
+?>
+ </tr>
+<?php
+ $post = $global_post;
+}
+
+/*
+ * display one row if the page doesn't have any children
+ * otherwise, display the row and its children in subsequent rows
+ */
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $page
+ * @param unknown_type $level
+ */
+function display_page_row( $page, $level = 0 ) {
+ global $post;
+ static $rowclass;
+
+ $post = $page;
+ setup_postdata($page);
+
+ if ( 0 == $level && (int)$page->post_parent > 0 ) {
+ //sent level 0 by accident, by default, or because we don't know the actual level
+ $find_main_page = (int)$page->post_parent;
+ while ( $find_main_page > 0 ) {
+ $parent = get_page($find_main_page);
+
+ if ( is_null($parent) )
+ break;
+
+ $level++;
+ $find_main_page = (int)$parent->post_parent;
+
+ if ( !isset($parent_name) )
+ $parent_name = $parent->post_title;
+ }
+ }
+
+ $page->post_title = esc_html( $page->post_title );
+ $pad = str_repeat( '— ', $level );
+ $id = (int) $page->ID;
+ $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
+ $posts_columns = get_column_headers('edit-pages');
+ $hidden = get_hidden_columns('edit-pages');
+ $title = _draft_or_post_title();
+?>
+<tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit">
+<?php
+
+foreach ($posts_columns as $column_name=>$column_display_name) {
+ $class = "class=\"$column_name column-$column_name\"";
+
+ $style = '';
+ if ( in_array($column_name, $hidden) )
+ $style = ' style="display:none;"';
+
+ $attributes = "$class$style";
+
+ switch ($column_name) {
+
+ case 'cb':
+ ?>
+ <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /></th>
+ <?php
+ break;
+ case 'date':
+ if ( '0000-00-00 00:00:00' == $page->post_date && '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 = $page->post_date;
+ $time = get_post_time('G', true);
+
+ $time_diff = time() - $time;
+
+ if ( $time_diff > 0 && $time_diff < 24*60*60 )
+ $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
+ else
+ $h_time = mysql2date(__('Y/m/d'), $m_time);
+ }
+ echo '<td ' . $attributes . '>';
+ echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>';
+ echo '<br />';
+ if ( 'publish' == $page->post_status ) {
+ _e('Published');
+ } elseif ( 'future' == $page->post_status ) {
+ if ( $time_diff > 0 )
+ echo '<strong class="attention">' . __('Missed schedule') . '</strong>';
+ else
+ _e('Scheduled');
+ } else {
+ _e('Last Modified');
+ }
+ echo '</td>';
+ break;
+ case 'title':
+ $attributes = 'class="post-title page-title column-title"' . $style;
+ $edit_link = get_edit_post_link( $page->ID );
+ ?>
+ <td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
+ <?php
+ $actions = array();
+ if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) {
+ $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
+ $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
+ }
+ if ( current_user_can('delete_page', $page->ID) ) {
+ if ( $post->post_status == 'trash' )
+ $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
+ elseif ( EMPTY_TRASH_DAYS )
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
+ if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
+ }
+ if ( in_array($post->post_status, array('pending', 'draft')) ) {
+ if ( current_user_can('edit_page', $page->ID) )
+ $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
+ } elseif ( $post->post_status != 'trash' ) {
+ $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+ }
+ $actions = apply_filters('page_row_actions', $actions, $page);
+ $action_count = count($actions);
+
+ $i = 0;
+ echo '<div class="row-actions">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+ echo "<span class='$action'>$link$sep</span>";
+ }
+ echo '</div>';
+
+ get_inline_data($post);
+ echo '</td>';
+ break;
+
+ case 'comments':
+ ?>
+ <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
+ <?php
+ $left = get_pending_comments_num( $page->ID );
+ $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
+ if ( $left )
+ echo '<strong>';
+ comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
+ if ( $left )
+ echo '</strong>';
+ ?>
+ </div></td>
+ <?php
+ break;
+
+ case 'author':
+ ?>
+ <td <?php echo $attributes ?>><a href="edit-pages.php?author=<?php the_author_meta('ID'); ?>"><?php the_author() ?></a></td>
+ <?php
+ break;
+
+ default:
+ ?>
+ <td <?php echo $attributes ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td>
+ <?php
+ break;
+ }
+}
+?>
+
+</tr>
+
+<?php
+}
+
+/*
+ * displays pages in hierarchical order with paging support
+ */
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $pages
+ * @param unknown_type $pagenum
+ * @param unknown_type $per_page
+ * @return unknown
+ */
+function page_rows($pages, $pagenum = 1, $per_page = 20) {
+ global $wpdb;
+
+ $level = 0;
+
+ if ( ! $pages ) {
+ $pages = get_pages( array('sort_column' => '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($_GET['s']) ) {
+
+ $top_level_pages = array();
+ $children_pages = array();
+
+ foreach ( $pages as $page ) {
+
+ // catch and repair bad pages
+ if ( $page->post_parent == $page->ID ) {
+ $page->post_parent = 0;
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
+ clean_page_cache( $page->ID );
+ }
+
+ if ( 0 == $page->post_parent )
+ $top_level_pages[] = $page;
+ else
+ $children_pages[ $page->post_parent ][] = $page;
+ }
+
+ $pages = &$top_level_pages;
+ }
+
+ $count = 0;
+ $start = ($pagenum - 1) * $per_page;
+ $end = $start + $per_page;
+
+ foreach ( $pages as $page ) {
+ if ( $count >= $end )
+ break;
+
+ if ( $count >= $start )
+ echo "\t" . display_page_row( $page, $level );
+
+ $count++;
+
+ if ( isset($children_pages) )
+ _page_rows( $children_pages, $count, $page->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) && $count < $end ){
+ foreach( $children_pages as $orphans ){
+ foreach ( $orphans as $op ) {
+ if ( $count >= $end )
+ break;
+ if ( $count >= $start )
+ echo "\t" . display_page_row( $op, 0 );
+ $count++;
+ }
+ }
+ }
+}
+
+/*
+ * Given a top level page ID, display the nested hierarchy of sub-pages
+ * together with paging support
+ */
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $children_pages
+ * @param unknown_type $count
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $pagenum
+ * @param unknown_type $per_page
+ */
+function _page_rows( &$children_pages, &$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 >= $end )
+ break;
+
+ // If the page starts in a subtree, print the parents.
+ if ( $count == $start && $page->post_parent > 0 ) {
+ $my_parents = array();
+ $my_parent = $page->post_parent;
+ while ( $my_parent) {
+ $my_parent = get_post($my_parent);
+ $my_parents[] = $my_parent;
+ if ( !$my_parent->post_parent )
+ break;
+ $my_parent = $my_parent->post_parent;
+ }
+ $num_parents = count($my_parents);
+ while( $my_parent = array_pop($my_parents) ) {
+ echo "\t" . display_page_row( $my_parent, $level - $num_parents );
+ $num_parents--;
+ }
+ }
+
+ if ( $count >= $start )
+ echo "\t" . display_page_row( $page, $level );
+
+ $count++;
+
+ _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
+ }
+
+ unset( $children_pages[$parent] ); //required in order to keep track of orphans
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $user_object
+ * @param unknown_type $style
+ * @param unknown_type $role
+ * @return unknown
+ */
+function user_row( $user_object, $style = '', $role = '' ) {
+ global $wp_roles;
+
+ $current_user = wp_get_current_user();
+
+ if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
+ $user_object = new WP_User( (int) $user_object );
+ $user_object = sanitize_user_object($user_object, 'display');
+ $email = $user_object->user_email;
+ $url = $user_object->user_url;
+ $short_url = str_replace( 'http://', '', $url );
+ $short_url = str_replace( 'www.', '', $short_url );
+ if ('/' == substr( $short_url, -1 ))
+ $short_url = substr( $short_url, 0, -1 );
+ if ( strlen( $short_url ) > 35 )
+ $short_url = substr( $short_url, 0, 32 ).'...';
+ $numposts = get_usernumposts( $user_object->ID );
+ $checkbox = '';
+ // Check if the user for this row is editable
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
+ // Set up the user editing link
+ // TODO: make profile/user-edit determination a seperate function
+ if ($current_user->ID == $user_object->ID) {
+ $edit_link = 'profile.php';
+ } else {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
+ }
+ $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
+
+ // Set up the hover actions for this user
+ $actions = array();
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
+ if ( $current_user->ID != $user_object->ID )
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "'>" . __('Delete') . "</a>";
+ $actions = apply_filters('user_row_actions', $actions, $user_object);
+ $action_count = count($actions);
+ $i = 0;
+ $edit .= '<div class="row-actions">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+ $edit .= "<span class='$action'>$link$sep</span>";
+ }
+ $edit .= '</div>';
+
+ // Set up the checkbox (because the user is editable, otherwise its empty)
+ $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
+
+ } else {
+ $edit = '<strong>' . $user_object->user_login . '</strong>';
+ }
+ $role_name = isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : __('None');
+ $r = "<tr id='user-$user_object->ID'$style>";
+ $columns = get_column_headers('users');
+ $hidden = get_hidden_columns('users');
+ $avatar = get_avatar( $user_object->ID, 32 );
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $class = "class=\"$column_name column-$column_name\"";
+
+ $style = '';
+ if ( in_array($column_name, $hidden) )
+ $style = ' style="display:none;"';
+
+ $attributes = "$class$style";
+
+ switch ($column_name) {
+ case 'cb':
+ $r .= "<th scope='row' class='check-column'>$checkbox</th>";
+ break;
+ case 'username':
+ $r .= "<td $attributes>$avatar $edit</td>";
+ break;
+ case 'name':
+ $r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>";
+ break;
+ case 'email':
+ $r .= "<td $attributes><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td>";
+ break;
+ case 'role':
+ $r .= "<td $attributes>$role_name</td>";
+ break;
+ case 'posts':
+ $attributes = 'class="posts column-posts num"' . $style;
+ $r .= "<td $attributes>";
+ if ( $numposts > 0 ) {
+ $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
+ $r .= $numposts;
+ $r .= '</a>';
+ } else {
+ $r .= 0;
+ }
+ $r .= "</td>";
+ break;
+ default:
+ $r .= "<td $attributes>";
+ $r .= apply_filters('manage_users_custom_column', '', $column_name, $user_object->ID);
+ $r .= "</td>";
+ }
+ }
+ $r .= '</tr>';
+
+ return $r;
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param string $status Comment status (approved, spam, trash, etc)
+ * @param string $s Term to search for
+ * @param int $start Offset to start at for pagination
+ * @param int $num Maximum number of comments to return
+ * @param int $post Post ID or 0 to return all comments
+ * @param string $type Comment type (comment, trackback, pingback, etc)
+ * @return array [0] contains the comments and [1] contains the total number of comments that match (ignoring $start and $num)
+ */
+function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
+ global $wpdb;
+
+ $start = abs( (int) $start );
+ $num = (int) $num;
+ $post = (int) $post;
+ $count = wp_count_comments();
+ $index = '';
+
+ if ( 'moderated' == $status ) {
+ $approved = "c.comment_approved = '0'";
+ $total = $count->moderated;
+ } elseif ( 'approved' == $status ) {
+ $approved = "c.comment_approved = '1'";
+ $total = $count->approved;
+ } elseif ( 'spam' == $status ) {
+ $approved = "c.comment_approved = 'spam'";
+ $total = $count->spam;
+ } elseif ( 'trash' == $status ) {
+ $approved = "c.comment_approved = 'trash'";
+ $total = $count->trash;
+ } else {
+ $approved = "( c.comment_approved = '0' OR c.comment_approved = '1' )";
+ $total = $count->moderated + $count->approved;
+ $index = 'USE INDEX (c.comment_date_gmt)';
+ }
+
+ if ( $post ) {
+ $total = '';
+ $post = " AND c.comment_post_ID = '$post'";
+ } else {
+ $post = '';
+ }
+
+ $orderby = "ORDER BY c.comment_date_gmt DESC LIMIT $start, $num";
+
+ if ( 'comment' == $type )
+ $typesql = "AND c.comment_type = ''";
+ elseif ( 'pings' == $type )
+ $typesql = "AND ( c.comment_type = 'pingback' OR c.comment_type = 'trackback' )";
+ elseif ( 'all' == $type )
+ $typesql = '';
+ elseif ( !empty($type) )
+ $typesql = $wpdb->prepare("AND c.comment_type = %s", $type);
+ else
+ $typesql = '';
+
+ if ( !empty($type) )
+ $total = '';
+
+ $query = "FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ";
+ if ( $s ) {
+ $total = '';
+ $s = $wpdb->escape($s);
+ $query .= "AND
+ (c.comment_author LIKE '%$s%' OR
+ c.comment_author_email LIKE '%$s%' OR
+ c.comment_author_url LIKE ('%$s%') OR
+ c.comment_author_IP LIKE ('%$s%') OR
+ c.comment_content LIKE ('%$s%') ) AND
+ $approved
+ $typesql";
+ } else {
+ $query .= "AND $approved $post $typesql";
+ }
+
+ $comments = $wpdb->get_results("SELECT * $query $orderby");
+ if ( '' === $total )
+ $total = $wpdb->get_var("SELECT COUNT(c.comment_ID) $query");
+
+ update_comment_cache($comments);
+
+ return array($comments, $total);
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $comment_id
+ * @param unknown_type $mode
+ * @param unknown_type $comment_status
+ * @param unknown_type $checkbox
+ */
+function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
+ global $comment, $post, $_comment_pending_count;
+ $comment = get_comment( $comment_id );
+ $post = get_post($comment->comment_post_ID);
+ $the_comment_status = wp_get_comment_status($comment->comment_ID);
+ $user_can = current_user_can('edit_post', $post->ID);
+
+ $author_url = get_comment_author_url();
+ if ( 'http://' == $author_url )
+ $author_url = '';
+ $author_url_display = preg_replace('|http://(www\.)?|i', '', $author_url);
+ if ( strlen($author_url_display) > 50 )
+ $author_url_display = substr($author_url_display, 0, 49) . '...';
+
+ $ptime = date('G', strtotime( $comment->comment_date ) );
+ if ( ( abs(time() - $ptime) ) < 86400 )
+ $ptime = sprintf( __('%s ago'), human_time_diff( $ptime ) );
+ else
+ $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );
+
+ if ( $user_can ) {
+ $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
+ $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
+
+ $comment_url = esc_url(get_comment_link($comment->comment_ID));
+ $approve_url = esc_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" );
+ $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" );
+ $spam_url = esc_url( "comment.php?action=spamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $unspam_url = esc_url( "comment.php?action=unspamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $trash_url = esc_url( "comment.php?action=trashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $untrash_url = esc_url( "comment.php?action=untrashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $delete_url = esc_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ }
+
+ echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
+ $columns = get_column_headers('edit-comments');
+ $hidden = get_hidden_columns('edit-comments');
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $class = "class=\"$column_name column-$column_name\"";
+
+ $style = '';
+ if ( in_array($column_name, $hidden) )
+ $style = ' style="display:none;"';
+
+ $attributes = "$class$style";
+
+ switch ($column_name) {
+ case 'cb':
+ if ( !$checkbox ) break;
+ echo '<th scope="row" class="check-column">';
+ if ( $user_can ) echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
+ echo '</th>';
+ break;
+ case 'comment':
+ echo "<td $attributes>";
+ echo '<div id="submitted-on">';
+ printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>'), $comment_url, get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia')));
+ echo '</div>';
+ comment_text();
+ if ( $user_can ) { ?>
+ <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
+ <textarea class="comment" rows="1" cols="1"><?php echo htmlspecialchars( apply_filters('comment_edit_pre', $comment->comment_content), ENT_QUOTES ); ?></textarea>
+ <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
+ <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
+ <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
+ <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
+ </div>
+ <?php
+ }
+
+ if ( $user_can ) {
+ // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
+ $actions = array(
+ 'approve' => '', 'unapprove' => '',
+ 'reply' => '',
+ 'quickedit' => '',
+ 'edit' => '',
+ 'spam' => '', 'unspam' => '',
+ 'trash' => '', 'untrash' => '', 'delete' => ''
+ );
+
+ if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
+ if ( 'approved' == $the_comment_status )
+ $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ else if ( 'unapproved' == $the_comment_status )
+ $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ } else {
+ $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ }
+
+ if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
+ $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
+ } elseif ( 'spam' == $the_comment_status ) {
+ $actions['unspam'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . __( 'Not Spam' ) . '</a>';
+ } elseif ( 'trash' == $the_comment_status ) {
+ $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
+ }
+
+ if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
+ } else {
+ $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
+ }
+
+ if ( 'trash' != $the_comment_status ) {
+ $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>". __('Edit') . '</a>';
+ $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.esc_attr__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
+ if ( 'spam' != $the_comment_status )
+ $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.esc_attr__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
+ }
+
+ $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
+
+ $i = 0;
+ echo '<div class="row-actions">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
+
+ // Reply and quickedit need a hide-if-no-js span when not added with ajax
+ if ( ('reply' == $action || 'quickedit' == $action) && ! $from_ajax )
+ $action .= ' hide-if-no-js';
+ elseif ( ($action == 'untrash' && $the_comment_status == 'trash') || ($action == 'unspam' && $the_comment_status == 'spam') ) {
+ if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true))
+ $action .= ' approve';
+ else
+ $action .= ' unapprove';
+ }
+
+ echo "<span class='$action'>$sep$link</span>";
+ }
+ echo '</div>';
+ }
+
+ echo '</td>';
+ break;
+ case 'author':
+ echo "<td $attributes><strong>"; comment_author(); echo '</strong><br />';
+ if ( !empty($author_url) )
+ echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
+ if ( $user_can ) {
+ if ( !empty($comment->comment_author_email) ) {
+ comment_author_email_link();
+ echo '<br />';
+ }
+ echo '<a href="edit-comments.php?s=';
+ comment_author_IP();
+ echo '&mode=detail';
+ if ( 'spam' == $comment_status )
+ echo '&comment_status=spam';
+ echo '">';
+ comment_author_IP();
+ echo '</a>';
+ } //current_user_can
+ echo '</td>';
+ break;
+ case 'date':
+ echo "<td $attributes>" . get_comment_date(__('Y/m/d \a\t g:ia')) . '</td>';
+ break;
+ case 'response':
+ if ( 'single' !== $mode ) {
+ if ( isset( $_comment_pending_count[$post->ID] ) ) {
+ $pending_comments = absint( $_comment_pending_count[$post->ID] );
+ } else {
+ $_comment_pending_count_temp = (array) get_pending_comments_num( array( $post->ID ) );
+ $pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID];
+ }
+ if ( $user_can ) {
+ $post_link = "<a href='" . get_edit_post_link($post->ID) . "'>";
+ $post_link .= get_the_title($post->ID) . '</a>';
+ } else {
+ $post_link = get_the_title($post->ID);
+ }
+ echo "<td $attributes>\n";
+ echo '<div class="response-links"><span class="post-com-count-wrapper">';
+ echo $post_link . '<br />';
+ $pending_phrase = esc_attr(sprintf( __('%s pending'), number_format( $pending_comments ) ));
+ if ( $pending_comments )
+ echo '<strong>';
+ comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
+ if ( $pending_comments )
+ echo '</strong>';
+ echo '</span> ';
+ echo "<a href='" . get_permalink( $post->ID ) . "'>#</a>";
+ echo '</div>';
+ if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) )
+ echo $thumb;
+ echo '</td>';
+ }
+ break;
+ default:
+ echo "<td $attributes>\n";
+ do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
+ echo "</td>\n";
+ break;
+ }
+ }
+ echo "</tr>\n";
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $position
+ * @param unknown_type $checkbox
+ * @param unknown_type $mode
+ */
+function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) {
+ global $current_user;
+
+ // allow plugin to replace the popup content
+ $content = apply_filters( 'wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode) );
+
+ if ( ! empty($content) ) {
+ echo $content;
+ return;
+ }
+
+ $columns = get_column_headers('edit-comments');
+ $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns('edit-comments') ) );
+ $col_count = count($columns) - count($hidden);
+
+?>
+<form method="get" action="">
+<?php if ( $table_row ) : ?>
+<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $col_count; ?>">
+<?php else : ?>
+<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
+<?php endif; ?>
+ <div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div>
+
+ <div id="edithead" style="display:none;">
+ <div class="inside">
+ <label for="author"><?php _e('Name') ?></label>
+ <input type="text" name="newcomment_author" size="50" value="" tabindex="101" id="author" />
+ </div>
+
+ <div class="inside">
+ <label for="author-email"><?php _e('E-mail') ?></label>
+ <input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" />
+ </div>
+
+ <div class="inside">
+ <label for="author-url"><?php _e('URL') ?></label>
+ <input type="text" id="author-url" name="newcomment_author_url" size="103" value="" tabindex="103" />
+ </div>
+ <div style="clear:both;"></div>
+ </div>
+
+ <div id="replycontainer"><textarea rows="8" cols="40" name="replycontent" tabindex="104" id="replycontent"></textarea></div>
+
+ <p id="replysubmit" class="submit">
+ <a href="#comments-form" class="cancel button-secondary alignleft" tabindex="106"><?php _e('Cancel'); ?></a>
+ <a href="#comments-form" class="save button-primary alignright" tabindex="104">
+ <span id="savebtn" style="display:none;"><?php _e('Update Comment'); ?></span>
+ <span id="replybtn" style="display:none;"><?php _e('Submit Reply'); ?></span></a>
+ <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" />
+ <span class="error" style="display:none;"></span>
+ <br class="clear" />
+ </p>
+
+ <input type="hidden" name="user_ID" id="user_ID" value="<?php echo $current_user->ID; ?>" />
+ <input type="hidden" name="action" id="action" value="" />
+ <input type="hidden" name="comment_ID" id="comment_ID" value="" />
+ <input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />
+ <input type="hidden" name="status" id="status" value="" />
+ <input type="hidden" name="position" id="position" value="<?php echo $position; ?>" />
+ <input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" />
+ <input type="hidden" name="mode" id="mode" value="<?php echo esc_attr($mode); ?>" />
+ <?php wp_nonce_field( 'replyto-comment', '_ajax_nonce', false ); ?>
+ <?php wp_comment_form_unfiltered_html_nonce(); ?>
+<?php if ( $table_row ) : ?>
+</td></tr></tbody></table>
+<?php else : ?>
+</div></div>
+<?php endif; ?>
+</form>
+<?php
+}
+
+/**
+ * Output 'undo move to trash' text for comments
+ *
+ * @since 2.9.0
+ */
+function wp_comment_trashnotice() {
+?>
+<div class="hidden" id="trash-undo-holder">
+ <div class="trash-undo-inside"><?php printf(__('Comment by %s moved to the trash.'), '<strong></strong>'); ?> <span class="undo untrash"><a href="#"><?php _e('Undo'); ?></a></span></div>
+</div>
+<div class="hidden" id="spam-undo-holder">
+ <div class="spam-undo-inside"><?php printf(__('Comment by %s marked as spam.'), '<strong></strong>'); ?> <span class="undo unspam"><a href="#"><?php _e('Undo'); ?></a></span></div>
+</div>
+<?php
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $currentcat
+ * @param unknown_type $currentparent
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $categories
+ * @return unknown
+ */
+function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
+ if (!$categories )
+ $categories = get_categories( array('hide_empty' => 0) );
+
+ if ( $categories ) {
+ foreach ( $categories as $category ) {
+ if ( $currentcat != $category->term_id && $parent == $category->parent) {
+ $pad = str_repeat( '– ', $level );
+ $category->name = esc_html( $category->name );
+ echo "\n\t<option value='$category->term_id'";
+ if ( $currentparent == $category->term_id )
+ echo " selected='selected'";
+ echo ">$pad$category->name</option>";
+ wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
+ }
+ }
+ } else {
+ return false;
+ }
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $meta
+ */
+function list_meta( $meta ) {
+ // Exit if no meta
+ if ( ! $meta ) {
+ echo '
+<table id="list-table" style="display: none;">
+ <thead>
+ <tr>
+ <th class="left">' . __( 'Name' ) . '</th>
+ <th>' . __( 'Value' ) . '</th>
+ </tr>
+ </thead>
+ <tbody id="the-list" class="list:meta">
+ <tr><td></td></tr>
+ </tbody>
+</table>'; //TBODY needed for list-manipulation JS
+ return;
+ }
+ $count = 0;
+?>
+<table id="list-table">
+ <thead>
+ <tr>
+ <th class="left"><?php _e( 'Name' ) ?></th>
+ <th><?php _e( 'Value' ) ?></th>
+ </tr>
+ </thead>
+ <tbody id='the-list' class='list:meta'>
+<?php
+ foreach ( $meta as $entry )
+ echo _list_meta_row( $entry, $count );
+?>
+ </tbody>
+</table>
+<?php
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param unknown_type $entry
+ * @param unknown_type $count
+ * @return unknown
+ */
+function _list_meta_row( $entry, &$count ) {
+ static $update_nonce = false;
+ if ( !$update_nonce )
+ $update_nonce = wp_create_nonce( 'add-meta' );
+
+ $r = '';
+ ++ $count;
+ if ( $count % 2 )
+ $style = 'alternate';
+ else
+ $style = '';
+ if ('_' == $entry['meta_key'] { 0 } )
+ $style .= ' hidden';