<?php require_once 'admin.php'; $title = __('Posts'); $parent_file = 'edit.php'; wp_enqueue_script(1 == $_GET['c'] ? 'admin-comments' : 'listman'); require_once 'admin-header.php'; $_GET['m'] = (int) $_GET['m']; $drafts = get_users_drafts($user_ID); $other_drafts = get_others_drafts($user_ID); if ($drafts || $other_drafts) { ?> <div class="wrap"> <?php if ($drafts) { ?> <p><strong><?php _e('Your Drafts:'); ?> </strong> <?php $i = 0; foreach ($drafts as $draft) { if (0 != $i) { echo ', '; } $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title)); if ($draft->post_title == '') { $draft->post_title = sprintf(__('Post #%s'), $draft->ID); } echo "<a href='post.php?action=edit&post={$draft->ID}' title='" . __('Edit this draft') . "'>{$draft->post_title}</a>";
function get_drafts() { global $current_user; $my_drafts = get_users_drafts($current_user->id); $my_scheduled = $this->get_users_future($current_user->id); $pending = get_others_pending($current_user->id); $others_drafts = get_others_drafts($current_user->id); $drafts_struct = array(array(__('Your Drafts:', 'shareadraft'), count($my_drafts), $my_drafts), array(__('Your Scheduled Posts:', 'shareadraft'), count($my_scheduled), $my_scheduled), array(__('Pending Review:', 'shareadraft'), count($pending), $pending), array(__('Others’ Drafts:', 'shareadraft'), count($others_drafts), $others_drafts)); return $drafts_struct; }
if ($can_edit_posts || $can_edit_pages || $can_edit_categories) { echo '<h2 class="accessible">' . __('Manage') . "</h2>\n"; echo '<ul id="managemenu" title="' . __('Manage') . '"'; if ($goto == 'managemenu' && $this->iscompat) { echo ' selected="true"'; } echo ">\n"; if (file_exists(ABSPATH . 'wp-admin/includes/admin.php')) { require_once ABSPATH . 'wp-admin/includes/admin.php'; } else { require_once ABSPATH . 'wp-admin/admin-db.php'; } $count_info = array(); $count_info[20] = count(get_users_drafts($userdata->ID)); $count_info[30] = function_exists('get_others_pending') ? count(get_others_pending($userdata->ID)) : 0; $count_info[40] = function_exists('get_others_drafts') ? count(get_others_drafts($userdata->ID)) : 0; // Allows plugin developers to add or overwrite the count info $count_info = apply_filters('wphone_managemenu_countlist', $count_info); $this->show_submenu('manage', $count_info, FALSE); echo "</ul>\n"; } /** * USER MENU */ if ($can_edit_users) { echo '<h2 class="accessible">' . __('Users') . "</h2>\n"; echo '<ul id="usersmenu" title="' . __('Users') . '"'; if ($goto == 'usersmenu' && $this->iscompat) { echo ' selected="true"'; } $this->show_submenu('users');
$author = (int) $_GET['author']; if (0 < $author) { $limit = 50; // get_users_drafts does not support offset $entries = get_users_drafts($user_ID); if ($author == '-' . $user_ID) { // author exclusion $page_header .= ' ' . __('by other authors'); } else { $author_user = get_userdata($author); $page_header .= ' ' . sprintf(__('by %s'), wp_specialchars($author_user->display_name)); } } else { $limit = 50; // get_others_drafts does not support offset $entries = get_others_drafts($user_ID); } break; case 'pending': $limit = 50; // get_others_pending does not support offset $entries = get_others_pending($user_ID); $page_header = __('Pending Review'); break; default: $entries = get_posts('numberposts=' . $query_limit . "&offset={$offset}&order=DESC"); $page_header = __('Posts'); } $previous_caption = __('« Previous Entries'); $next_caption = __('Next Entries »'); $more_caption = __('More Entries', 'wphone');