mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Remove drafts from Write page.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
89bc5d972f
commit
62298aa7c7
@ -19,9 +19,6 @@ $messages[3] = __('Custom field deleted.');
|
||||
<h2><?php _e('Write Post') ?></h2>
|
||||
<?php
|
||||
|
||||
if ( !empty( $draft_div ) )
|
||||
echo $draft_div;
|
||||
|
||||
if (!isset($post_ID) || 0 == $post_ID) {
|
||||
$form_action = 'post';
|
||||
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
|
||||
|
@ -32,55 +32,6 @@ endif;
|
||||
|
||||
|
||||
<?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))
|
||||
);
|
||||
|
||||
$draft_div = '';
|
||||
if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) {
|
||||
$draft_div = '<div class="wrap" id="draft-nag">';
|
||||
|
||||
foreach ( $nag_posts as $nag ) {
|
||||
if ( ${$nag[0]} ) {
|
||||
$draft_div .= '<p><strong>' . wp_specialchars($nag[1]) . '</strong> ';
|
||||
$i = 0;
|
||||
foreach ( ${$nag[0]} as $post ) {
|
||||
$i++;
|
||||
if ( $i > $nag_posts_limit )
|
||||
break;
|
||||
$draft_div .= '<a href="post.php?action=edit&post=' . $post->ID . '">';
|
||||
$draft_div .= ( '' == the_title('', '', FALSE) ) ? sprintf( __('Post #%s'), $post->ID ) : get_the_title();
|
||||
$draft_div .= '</a>';
|
||||
if ( $i < min($nag[3], $nag_posts_limit) )
|
||||
$draft_div .= ', ';
|
||||
}
|
||||
if ( $nag[3] > $nag_posts_limit )
|
||||
$draft_div .= sprintf(__(', and <a href="%s">%d more</a>'), $nag[2], $nag[3] - $nag_posts_limit);
|
||||
$draft_div .= '.</p>';
|
||||
}
|
||||
}
|
||||
$draft_div .= "</div>\n";
|
||||
}
|
||||
|
||||
// Show post form.
|
||||
$post = get_default_post_to_edit();
|
||||
|
Loading…
Reference in New Issue
Block a user