wp_redirect($location); exit(); break; default: $title = __('Create New Post'); require_once ('./admin-header.php'); ?> <?php if ( isset($_GET['posted']) ) : ?> <div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?> »</a></p></div> <?php endif; ?> <?php if ( current_user_can('edit_posts') ) { $action = 'post'; get_currentuserinfo(); if ( $drafts = get_users_drafts( $user_ID ) ) { ?> <div class="wrap"> <p><strong><?php _e('Your Drafts:') ?></strong> <?php $num_drafts = count($drafts); if ( $num_drafts > 15 ) $num_drafts = 15; for ( $i = 0; $i < $num_drafts; $i++ ) { $draft = $drafts[$i]; if ( 0 != $i ) echo ', '; $draft->post_title = stripslashes($draft->post_title); if ( empty($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>"; }
* MANAGE MENU */ 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"';
_e('Post saved.'); ?> </strong> <a href="<?php echo get_permalink($_GET['posted']); ?> "><?php _e('View post »'); ?> </a></p></div> <?php } ?> <?php $my_drafts = get_users_drafts($user_ID); $pending = get_others_pending($user_ID); $others_drafts = get_others_drafts($user_ID); $nag_posts_limit = (int) apply_filters('nag_posts_limit', 3); $nag_posts = array(array('my_drafts', __('Your Drafts:'), 'edit.php?post_status=draft&author=' . $user_ID, count($my_drafts)), array('pending', __('Pending Review:'), 'edit.php?post_status=pending', count($pending)), array('others_drafts', __('Others’ Drafts:'), 'edit.php?post_status=draft&author=-' . $user_ID, count($others_drafts))); if (!empty($my_drafts) || !empty($pending) || !empty($others_drafts)) { echo '<div class="wrap" id="draft-nag">'; foreach ($nag_posts as $nag) { if (${$nag[0]}) { echo '<p><strong>' . wp_specialchars($nag[1]) . '</strong> '; $i = 0; foreach (${$nag[0]} as $post) { $i++; if ($i > $nag_posts_limit) { break; }
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; }
$parent = 'edit-pages'; } else { global $user_ID; 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'; } switch ($_GET['post_status']) { case 'draft': $page_header = function_exists('_c') ? _c('Drafts|manage posts header') : __('Drafts'); $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;