mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
Trash status updates for posts, pages, comments and attachments, props caesarsgrunt, see #4529
git-svn-id: http://svn.automattic.com/wordpress/trunk@11749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
190a148e6b
commit
39e4f05a15
@ -181,18 +181,27 @@ function _wp_ajax_delete_comment_response( $comment_id ) {
|
||||
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
|
||||
switch ( $action = $_POST['action'] ) :
|
||||
case 'delete-comment' : // On success, die with time() instead of 1
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
if ( !$comment = get_comment( $id ) )
|
||||
die( (string) time() );
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
die('-1');
|
||||
|
||||
if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
|
||||
check_ajax_referer( "trash-comment_$id" );
|
||||
if ( 'trash' == wp_get_comment_status( $comment->comment_ID ) )
|
||||
die( (string) time() );
|
||||
$r = wp_trash_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
|
||||
check_ajax_referer( "untrash-comment_$id" );
|
||||
$r = wp_untrash_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) )
|
||||
die( (string) time() );
|
||||
$r = wp_set_comment_status( $comment->comment_ID, 'spam' );
|
||||
} else {
|
||||
$r = wp_set_comment_status( $comment->comment_ID, 'delete' );
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
$r = wp_delete_comment( $comment->comment_ID );
|
||||
}
|
||||
if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
|
||||
_wp_ajax_delete_comment_response( $comment->comment_ID );
|
||||
|
@ -44,8 +44,8 @@ case 'editcomment' :
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ( 'deleted' == $comment->comment_status )
|
||||
comment_footer_die( __('This comment has been deleted. Please move it out of the Trash if you want to edit it.') );
|
||||
if ( 'trash' == $comment->comment_status )
|
||||
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
|
||||
|
||||
$comment = get_comment_to_edit( $comment_id );
|
||||
|
||||
@ -166,6 +166,35 @@ case 'deletecomment' :
|
||||
die;
|
||||
break;
|
||||
|
||||
case 'trashcomment' :
|
||||
case 'untrashcomment' :
|
||||
$comment_id = absint( $_REQUEST['c'] );
|
||||
$noredir = isset($_REQUEST['noredir']);
|
||||
|
||||
if (!$comment = get_comment($comment_id))
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
|
||||
if (!current_user_can('edit_post', $comment->comment_post_ID ))
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ($action == 'trashcomment') {
|
||||
check_admin_referer( 'trash-comment_' . $comment_id );
|
||||
wp_trash_comment($comment_id);
|
||||
}
|
||||
else {
|
||||
check_admin_referer( 'untrash-comment_' . $comment_id );
|
||||
wp_untrash_comment($comment_id);
|
||||
}
|
||||
|
||||
if ('' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ))
|
||||
wp_redirect( wp_get_referer() );
|
||||
else if ('' != wp_get_original_referer() && false == $noredir)
|
||||
wp_redirect(wp_get_original_referer());
|
||||
else
|
||||
wp_redirect(admin_url('edit-comments.php'));
|
||||
|
||||
die;
|
||||
break;
|
||||
|
||||
case 'unapprovecomment' :
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
check_admin_referer( 'unapprove-comment_' . $comment_id );
|
||||
|
@ -28,12 +28,18 @@ add_filter('the_title','esc_html');
|
||||
$alt = '';
|
||||
$posts_columns = get_column_headers('upload');
|
||||
$hidden = get_hidden_columns('upload');
|
||||
while (have_posts()) : the_post();
|
||||
|
||||
while ( have_posts() ) : the_post();
|
||||
|
||||
if ( $is_trash && $post->post_status != 'trash' )
|
||||
continue;
|
||||
elseif ( !$is_trash && $post->post_status == 'trash' )
|
||||
continue;
|
||||
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
$att_title = _draft_or_post_title();
|
||||
|
||||
?>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
|
||||
|
||||
@ -60,13 +66,15 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) {
|
||||
if ( $is_trash ) echo $thumb;
|
||||
else {
|
||||
?>
|
||||
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>">
|
||||
<?php echo $thumb; ?>
|
||||
</a>
|
||||
|
||||
<?php }
|
||||
}
|
||||
?></td>
|
||||
<?php
|
||||
// TODO
|
||||
@ -74,16 +82,21 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
|
||||
case 'media':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
|
||||
<td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong><br />
|
||||
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
|
||||
<p>
|
||||
<?php
|
||||
$actions = array();
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||
if ( current_user_can('delete_post', $post->ID) )
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
if ( $is_trash && current_user_can('delete_post', $post->ID) ) {
|
||||
$actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
} else {
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||
if ( current_user_can('delete_post', $post->ID) )
|
||||
$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
}
|
||||
$action_count = count($actions);
|
||||
$i = 0;
|
||||
echo '<div class="row-actions">';
|
||||
|
@ -14,20 +14,20 @@ enqueue_comment_hotkeys_js();
|
||||
|
||||
$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
|
||||
|
||||
if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['destroy_all']) || isset($_REQUEST['destroy_all2']) ) {
|
||||
if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
|
||||
check_admin_referer('bulk-comments');
|
||||
|
||||
if ((isset($_REQUEST['destroy_all']) || isset($_REQUEST['destroy_all2'])) && !empty($_REQUEST['pagegen_timestamp'])) {
|
||||
if ((isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp'])) {
|
||||
$comment_status = $wpdb->escape($_REQUEST['comment_status']);
|
||||
$delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']);
|
||||
$comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
|
||||
$doaction = 'destroy';
|
||||
$doaction = 'delete';
|
||||
} elseif (($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) && isset($_REQUEST['delete_comments'])) {
|
||||
$comment_ids = $_REQUEST['delete_comments'];
|
||||
$doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
|
||||
} else wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
|
||||
$approved = $unapproved = $spammed = $deleted = $destroyed = 0;
|
||||
$approved = $unapproved = $spammed = $trashed = $untrashed = $deleted = 0;
|
||||
|
||||
foreach ($comment_ids as $comment_id) { // Check the permissions on each
|
||||
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );
|
||||
@ -48,18 +48,22 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R
|
||||
wp_set_comment_status($comment_id, 'spam');
|
||||
$spammed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_set_comment_status($comment_id, 'delete');
|
||||
$deleted++;
|
||||
case 'trash' :
|
||||
wp_trash_comment($comment_id);
|
||||
$trashed++;
|
||||
break;
|
||||
case 'destroy' :
|
||||
wp_set_comment_status($comment_id, 'delete');
|
||||
$destroyed++;
|
||||
case 'untrash' :
|
||||
wp_untrash_comment($comment_id);
|
||||
$untrashed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_delete_comment($comment_id);
|
||||
$deleted++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$redirect_to = 'edit-comments.php?approved=' . $approved . '&unapproved=' . $unapproved . '&spam=' . $spammed . '&deleted=' . $deleted . '&destroyed=' . $destroyed;
|
||||
$redirect_to = 'edit-comments.php?approved=' . $approved . '&unapproved=' . $unapproved . '&spam=' . $spammed . '&trashed=' . $trashed . '&untrashed=' . $untrashed . '&deleted=' . $deleted;
|
||||
if ( $post_id )
|
||||
$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
|
||||
if ( isset($_REQUEST['apage']) )
|
||||
@ -86,7 +90,7 @@ require_once('admin-header.php');
|
||||
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
|
||||
|
||||
$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all';
|
||||
if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'deleted')) )
|
||||
if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) )
|
||||
$comment_status = 'all';
|
||||
|
||||
$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
|
||||
@ -102,13 +106,14 @@ if ( isset($_GET['s']) && $_GET['s'] )
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['destroyed'] ) || isset( $_GET['spam'] ) ) {
|
||||
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
|
||||
$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
|
||||
$destroyed = isset( $_GET['destroyed'] ) ? (int) $_GET['destroyed'] : 0;
|
||||
$spam = isset( $_GET['spam'] ) ? (int) $_GET['spam'] : 0;
|
||||
if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spam']) ) {
|
||||
$approved = isset($_GET['approved']) ? (int) $_GET['approved'] : 0;
|
||||
$deleted = isset($_GET['deleted']) ? (int) $_GET['deleted'] : 0;
|
||||
$trashed = isset($_GET['trashed']) ? (int) $_GET['trashed'] : 0;
|
||||
$untrashed = isset($_GET['untrashed']) ? (int) $_GET['untrashed'] : 0;
|
||||
$spam = isset($_GET['spam']) ? (int) $_GET['spam'] : 0;
|
||||
|
||||
if ( $approved > 0 || $deleted > 0 || $destroyed > 0 || $spam > 0 ) {
|
||||
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spam > 0 ) {
|
||||
echo '<div id="moderated" class="updated fade"><p>';
|
||||
|
||||
if ( $approved > 0 ) {
|
||||
@ -119,12 +124,16 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['de
|
||||
printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $deleted > 0 ) {
|
||||
printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
|
||||
if ( $trashed > 0 ) {
|
||||
printf( _n( '%s comment moved to the trash', '%s comments moved to the trash', $trashed ), $trashed );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $destroyed > 0 ) {
|
||||
printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $destroyed ), $destroyed );
|
||||
if ( $untrashed > 0 ) {
|
||||
printf( _n( '%s comment removed from the trash', '%s comments removed from the trash', $untrashed ), $untrashed );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $deleted > 0 ) {
|
||||
printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
@ -145,7 +154,7 @@ $stati = array(
|
||||
'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
|
||||
'approved' => _n_noop('Approved', 'Approved'), // singular not used
|
||||
'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
|
||||
'deleted' => _n_noop('Trash <span class="count">(<span class="deleted-count">%s</span>)</span>', 'Trash <span class="count">(<span class="deleted-count">%s</span>)</span>')
|
||||
'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
|
||||
);
|
||||
$link = 'edit-comments.php';
|
||||
if ( !empty($comment_type) && 'all' != $comment_type )
|
||||
@ -256,13 +265,13 @@ $page_links = paginate_links( array(
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
|
||||
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'deleted' == $comment_status ): ?>
|
||||
<option value="unapprove"><?php _e('Return to Pending'); ?></option>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'deleted' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="destroy"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php if ( 'trash' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="delete"><?php _e('Move to Trash'); ?></option>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
@ -289,12 +298,12 @@ $page_links = paginate_links( array(
|
||||
<input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
|
||||
<?php }
|
||||
|
||||
if ( ( 'spam' == $comment_status || 'deleted' == $comment_status) && current_user_can ('moderate_comments') ) {
|
||||
if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) {
|
||||
wp_nonce_field('bulk-destroy', '_destroy_nonce');
|
||||
if ( 'spam' == $comment_status ) { ?>
|
||||
<input type="submit" name="destroy_all" id="destroy_all" value="<?php esc_attr_e('Permanently Delete All'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'deleted' == $comment_status ) { ?>
|
||||
<input type="submit" name="destroy_all" id="destroy_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-primary apply" />
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'trash' == $comment_status ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php }
|
||||
} ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
@ -352,21 +361,21 @@ if ( $page_links )
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
|
||||
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'deleted' == $comment_status ): ?>
|
||||
<option value="unapprove"><?php _e('Return to Pending'); ?></option>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'deleted' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="destroy"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php if ( 'trash' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="delete"><?php _e('Move to Trash'); ?></option>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
<input type="submit" name="doaction2" id="doaction2" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
|
||||
<?php if ( 'spam' == $comment_status ) { ?>
|
||||
<input type="submit" name="destroy_all2" id="destroy_all2" value="<?php esc_attr_e('Empty Quarantine'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'deleted' == $comment_status ) { ?>
|
||||
<input type="submit" name="destroy_all2" id="destroy_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'trash' == $comment_status ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
|
@ -229,7 +229,7 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID); ?>"><?php _e('Move to Trash'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
@ -64,7 +64,7 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<div id="delete-action">
|
||||
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . esc_js(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ){return true;}return false;\">" . __('Delete') . "</a>\n"; ?>
|
||||
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . __('Move to Trash') . "</a>\n"; ?>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
|
||||
|
@ -216,7 +216,7 @@ endif; ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=trash&post=$post->ID", 'trash-page_' . $post->ID); ?>"><?php _e('Move to Trash'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
@ -10,44 +10,70 @@
|
||||
require_once('admin.php');
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
|
||||
if (isset($_GET['delete_all']) || isset($_GET['delete_all2'])) {
|
||||
$post_status = $wpdb->escape($_GET['post_status']);
|
||||
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = '$post_status'" );
|
||||
$doaction = 'delete';
|
||||
} elseif (($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['post'])) {
|
||||
$post_ids = $_GET['post'];
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to move this page to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to remove this page from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in removing from trash...') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
$deleted = 0;
|
||||
foreach( (array) $_GET['post'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_page', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this page.') );
|
||||
if ( !current_user_can('delete_page', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this page.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -62,6 +88,10 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
|
||||
}
|
||||
if ( isset($deleted) )
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
elseif ( isset($trashed) )
|
||||
$sendback = add_query_arg('trashed', $trashed, $sendback);
|
||||
elseif ( isset($untrashed) )
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
@ -79,7 +109,8 @@ $post_stati = array( // array( adj, noun )
|
||||
'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>', 'page')),
|
||||
'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>', 'page')),
|
||||
'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>', 'page')),
|
||||
'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page'))
|
||||
'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page')),
|
||||
'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', 'page'))
|
||||
);
|
||||
|
||||
$post_stati = apply_filters('page_stati', $post_stati);
|
||||
@ -111,28 +142,33 @@ if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<div id="message" class="updated fade"><p>
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
unset($_GET['updated']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) {
|
||||
printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
unset($_GET['skipped']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
unset($_GET['locked']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Page removed from the trash.', '%s pages removed from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
|
||||
unset($_GET['untrashed']);
|
||||
}
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
</p></div>
|
||||
<?php } ?>
|
||||
@ -150,7 +186,7 @@ $avail_post_stati = get_available_post_statuses('page');
|
||||
if ( empty($locked_post_status) ) :
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts('page', 'readable');
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
|
||||
$class = empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
foreach ( $post_stati as $status => $label ) {
|
||||
@ -212,11 +248,19 @@ if ( $page_links ) : ?>
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ($_GET['post_status'] == 'trash') { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-pages'); ?>
|
||||
<?php if ($_GET['post_status'] == 'trash') { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
@ -251,10 +295,18 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ($_GET['post_status'] == 'trash') { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php if ($_GET['post_status'] == 'trash') { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
|
@ -18,44 +18,74 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag
|
||||
}
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
if (isset($_GET['delete_all']) || isset($_GET['delete_all2'])) {
|
||||
$post_status = $wpdb->escape($_GET['post_status']);
|
||||
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = '$post_status'" );
|
||||
$doaction = 'delete';
|
||||
} elseif (($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['post'])) {
|
||||
$post_ids = $_GET['post'];
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = & get_post($post_id);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to move this post to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = & get_post($post_id);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to remove this post from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in removing from trash...') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
$deleted = 0;
|
||||
foreach( (array) $_GET['post'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -70,6 +100,10 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
|
||||
}
|
||||
if ( isset($deleted) )
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
elseif ( isset($trashed) )
|
||||
$sendback = add_query_arg('trashed', $trashed, $sendback);
|
||||
elseif ( isset($untrashed) )
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
@ -107,7 +141,7 @@ if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<div id="message" class="updated fade"><p>
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
@ -123,10 +157,20 @@ if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
}
|
||||
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Post removed from the trash.', '%s posts removed from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
|
||||
unset($_GET['undeleted']);
|
||||
}
|
||||
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
</p></div>
|
||||
@ -139,7 +183,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'
|
||||
if ( empty($locked_post_status) ) :
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts( 'post', 'readable' );
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
|
||||
$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit.php' $class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
|
||||
@ -190,8 +234,13 @@ $page_links = paginate_links( array(
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ($_GET['post_status'] == 'trash') { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-posts'); ?>
|
||||
@ -235,7 +284,8 @@ wp_dropdown_categories($dropdown_options);
|
||||
do_action('restrict_manage_posts');
|
||||
?>
|
||||
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
|
||||
|
||||
<?php } if ( $_GET['post_status'] == 'trash' ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -270,10 +320,18 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $_GET['post_status'] == 'trash' ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php if ( $_GET['post_status'] == 'trash' ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<br class="clear" />
|
||||
|
@ -480,7 +480,7 @@ function wp_dashboard_recent_comments() {
|
||||
$comments = array();
|
||||
$start = 0;
|
||||
|
||||
while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT $start, 50" ) ) {
|
||||
while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
|
||||
|
||||
foreach ( $possible as $comment ) {
|
||||
if ( count( $comments ) >= 5 )
|
||||
|
@ -1166,15 +1166,13 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
'extra_rows' => array(),
|
||||
);
|
||||
|
||||
$delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id);
|
||||
$delete_href = wp_nonce_url("post.php?action=trash&post=$attachment_id", 'delete-post_' . $attachment_id);
|
||||
if ( $send )
|
||||
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
|
||||
if ( $delete )
|
||||
$delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a>";
|
||||
$delete = "<a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Move to Trash') . "</a>";
|
||||
if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
|
||||
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete
|
||||
<div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Continue') . "</a>
|
||||
<a href=\"#\" class=\"del-link\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div></td></tr>\n");
|
||||
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete</td></tr>\n");
|
||||
|
||||
$hidden_fields = array();
|
||||
|
||||
|
@ -795,6 +795,7 @@ function wp_edit_posts_query( $q = false ) {
|
||||
'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
|
||||
'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
|
||||
'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
|
||||
'trash' => array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>')),
|
||||
);
|
||||
|
||||
$post_stati = apply_filters('post_stati', $post_stati);
|
||||
@ -858,7 +859,7 @@ function wp_edit_attachments_query( $q = false ) {
|
||||
$q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
|
||||
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
|
||||
$q['post_type'] = 'attachment';
|
||||
$q['post_status'] = 'any';
|
||||
$q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'any';
|
||||
$media_per_page = get_user_option('upload_per_page');
|
||||
if ( empty($media_per_page) )
|
||||
$media_per_page = 20;
|
||||
|
@ -1433,24 +1433,29 @@ function _post_row($a_post, $pending_comments, $mode) {
|
||||
case 'title':
|
||||
$attributes = 'class="post-title column-title"' . $style;
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><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>
|
||||
<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) ) {
|
||||
$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) ) {
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</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>';
|
||||
if ( 'trash' == $post->post_status && current_user_can('delete_post', $post->ID) ) {
|
||||
$actions['untrash'] = "<a title='" . esc_attr(__('Remove this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
|
||||
$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>";
|
||||
} else {
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
if ( current_user_can('edit_post', $post->ID) ) {
|
||||
$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) ) {
|
||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</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>';
|
||||
} else {
|
||||
$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);
|
||||
@ -1651,21 +1656,26 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
|
||||
$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 ) ) { ?><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>
|
||||
<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) ) {
|
||||
$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) ) {
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</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>';
|
||||
if ($post->post_status == 'trash' && current_user_can('delete_page', $page->ID)) {
|
||||
$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>";
|
||||
$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>";
|
||||
} else {
|
||||
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
if ( current_user_can('edit_page', $page->ID) ) {
|
||||
$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) ) {
|
||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . wp_nonce_url("page.php?action=trash&post=$page->ID", 'trash-page_' . $page->ID) . "'>" . __('Trash') . "</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>';
|
||||
} else {
|
||||
$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);
|
||||
@ -1981,7 +1991,7 @@ function user_row( $user_object, $style = '', $role = '' ) {
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param string $status Comment status (approved, spam, deleted, etc)
|
||||
* @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
|
||||
@ -1999,62 +2009,63 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0
|
||||
$index = '';
|
||||
|
||||
if ( 'moderated' == $status ) {
|
||||
$approved = "comment_approved = '0'";
|
||||
$approved = "c.comment_approved = '0'";
|
||||
$total = $count->moderated;
|
||||
} elseif ( 'approved' == $status ) {
|
||||
$approved = "comment_approved = '1'";
|
||||
$approved = "c.comment_approved = '1'";
|
||||
$total = $count->approved;
|
||||
} elseif ( 'spam' == $status ) {
|
||||
$approved = "comment_approved = 'spam'";
|
||||
$approved = "c.comment_approved = 'spam'";
|
||||
$total = $count->spam;
|
||||
} elseif ( 'deleted' == $status ) {
|
||||
$approved = "comment_approved = 'deleted'";
|
||||
$total = $count->deleted;
|
||||
} elseif ( 'trash' == $status ) {
|
||||
$approved = "c.comment_approved = 'trash'";
|
||||
$total = $count->trash;
|
||||
} else {
|
||||
$approved = "( comment_approved = '0' OR comment_approved = '1' )";
|
||||
$approved = "( c.comment_approved = '0' OR c.comment_approved = '1' )";
|
||||
$total = $count->moderated + $count->approved;
|
||||
$index = 'USE INDEX (comment_date_gmt)';
|
||||
$index = 'USE INDEX (c.comment_date_gmt)';
|
||||
}
|
||||
|
||||
if ( $post ) {
|
||||
$total = '';
|
||||
$post = " AND comment_post_ID = '$post'";
|
||||
$orderby = "ORDER BY comment_date_gmt ASC LIMIT $start, $num";
|
||||
$post = " AND c.comment_post_ID = '$post'";
|
||||
$orderby = "ORDER BY c.comment_date_gmt ASC LIMIT $start, $num";
|
||||
} else {
|
||||
$post = '';
|
||||
$orderby = "ORDER BY comment_date_gmt DESC LIMIT $start, $num";
|
||||
$orderby = "ORDER BY c.comment_date_gmt DESC LIMIT $start, $num";
|
||||
}
|
||||
|
||||
if ( 'comment' == $type )
|
||||
$typesql = "AND comment_type = ''";
|
||||
$typesql = "AND c.comment_type = ''";
|
||||
elseif ( 'pings' == $type )
|
||||
$typesql = "AND ( comment_type = 'pingback' OR comment_type = 'trackback' )";
|
||||
$typesql = "AND ( c.comment_type = 'pingback' OR c.comment_type = 'trackback' )";
|
||||
elseif ( !empty($type) )
|
||||
$typesql = $wpdb->prepare("AND comment_type = %s", $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 = "FROM $wpdb->comments WHERE
|
||||
(comment_author LIKE '%$s%' OR
|
||||
comment_author_email LIKE '%$s%' OR
|
||||
comment_author_url LIKE ('%$s%') OR
|
||||
comment_author_IP LIKE ('%$s%') OR
|
||||
comment_content LIKE ('%$s%') ) AND
|
||||
$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 = "FROM $wpdb->comments $index WHERE $approved $post $typesql";
|
||||
$query .= "AND $approved $post $typesql";
|
||||
}
|
||||
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * $query $orderby");
|
||||
if ( '' === $total )
|
||||
$total = $wpdb->get_var("SELECT COUNT(comment_ID) $query");
|
||||
$total = $wpdb->get_var("SELECT COUNT(c.comment_ID) $query");
|
||||
|
||||
update_comment_cache($comments);
|
||||
|
||||
@ -2095,6 +2106,8 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
$approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
|
||||
$unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
|
||||
$spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||
$trash_url = esc_url( wp_nonce_url( "comment.php?action=trashcomment&p=$post->ID&c=$comment->comment_ID", "trash-comment_$comment->comment_ID" ) );
|
||||
$untrash_url = esc_url( wp_nonce_url( "comment.php?action=untrashcomment&p=$post->ID&c=$comment->comment_ID", "untrash-comment_$comment->comment_ID" ) );
|
||||
|
||||
echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
|
||||
$columns = get_column_headers('edit-comments');
|
||||
@ -2134,9 +2147,9 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
$actions = array();
|
||||
|
||||
if ( $user_can ) {
|
||||
if ( 'deleted' == $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='" . __( 'Return this comment to Unapproved status' ) . "'>" . __( 'Return to Pending' ) . '</a>';
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::deleted=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
|
||||
if ( 'trash' == $the_comment_status ) {
|
||||
$actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID::untrash=1 vim-t vim-destructive''>" . __( 'Restore' ) . '</a>';
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete Permanently') . '</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='" . __( '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='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
@ -2152,10 +2165,10 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
}
|
||||
|
||||
if ( 'spam' == $the_comment_status ) {
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::deleted=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
|
||||
} else {
|
||||
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Move to Trash') . '</a>';
|
||||
$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-t vim-destructive'>" . __('Trash') . '</a>';
|
||||
}
|
||||
|
||||
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
|
||||
@ -2176,6 +2189,15 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
// 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') {
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if (is_array($trash_meta) && isset($trash_meta['comments'][$comment_id]['status'])) {
|
||||
if ($trash_meta['comments'][$comment_id]['status'] == '1')
|
||||
$action .= ' approve';
|
||||
else
|
||||
$action .= ' unapprove';
|
||||
}
|
||||
}
|
||||
|
||||
echo "<span class='$action'>$sep$link</span>";
|
||||
}
|
||||
|
@ -154,16 +154,6 @@ jQuery(document).ready( function($) {
|
||||
$('div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error').addClass('below-h2');
|
||||
$('div.updated, div.error').not('.below-h2').insertAfter('div.wrap h2:first');
|
||||
|
||||
// show warnings
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name="action"]').val() == 'destroy' || $('select[name="action2"]').val() == 'destroy' ) {
|
||||
return showNotice.warn();
|
||||
}
|
||||
});
|
||||
$('#destroy_all, #destroy_all2').click(function(){
|
||||
return showNotice.warn();
|
||||
});
|
||||
|
||||
// screen settings tab
|
||||
$('#show-settings-link').click(function () {
|
||||
if ( ! $('#screen-options-wrap').hasClass('screen-options-open') ) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -38,9 +38,6 @@ setCommentsList = function() {
|
||||
settings.data._page = pageInput.val();
|
||||
settings.data._url = document.location.href;
|
||||
|
||||
if ( 'undefined' != showNotice && settings.data.action && settings.data.action == 'delete-comment' && settings.data.deleted)
|
||||
return showNotice.warn() ? settings : false;
|
||||
|
||||
return settings;
|
||||
};
|
||||
|
||||
@ -101,17 +98,15 @@ setCommentsList = function() {
|
||||
a.html(n);
|
||||
});
|
||||
|
||||
$('span.deleted-count').each( function() {
|
||||
$('span.trash-count').each( function() {
|
||||
var a = $(this), n;
|
||||
n = a.html().replace(/[ ,.]+/g, '');
|
||||
n = parseInt(n,10);
|
||||
if ( isNaN(n) ) return;
|
||||
if ( $(settings.target).parents( 'span.delete' ).size() && $('#' + settings.element).is('.deleted,.spam') ) { // we destroyed a deleted or spam comment
|
||||
n--;
|
||||
} else if ( $(settings.target).parents( 'span.delete' ).size() ) { // we deleted a comment
|
||||
n++;
|
||||
} else if ( $('#' + settings.element).is('.deleted') ) { // we approved or spammed a deleted comment
|
||||
n--;
|
||||
if ( $(settings.target).parents( 'span.trash' ).size() ) { // we trashed a comment
|
||||
n = n + 1;
|
||||
} else if ( $('#' + settings.element).is('.trash') ) { // we deleted or untrashed a trash comment
|
||||
n = n - 1;
|
||||
}
|
||||
if ( n < 0 ) { n = 0; }
|
||||
n = n.toString();
|
||||
|
File diff suppressed because one or more lines are too long
@ -58,6 +58,9 @@ case 'edit' :
|
||||
|
||||
$att = get_post($att_id);
|
||||
|
||||
if ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?') );
|
||||
if ( $att->post_status == 'trash' ) wp_die( __('You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') );
|
||||
|
||||
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
|
||||
|
||||
wp_enqueue_script( 'wp-ajax-response' );
|
||||
|
@ -83,6 +83,7 @@ case 'edit':
|
||||
$post = get_post_to_edit($page_ID);
|
||||
|
||||
if ( empty($post->ID) ) wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') );
|
||||
if ( $post->post_status == 'trash' ) wp_die( __('You can’t edit this page because it is in the Trash. Please move it out of the Trash and try again.') );
|
||||
|
||||
if ( 'page' != $post->post_type ) {
|
||||
wp_redirect( get_edit_post_link( $post_ID, 'url' ) );
|
||||
@ -140,6 +141,46 @@ case 'editpost':
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'trash':
|
||||
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
|
||||
check_admin_referer('trash-page_' . $post_id);
|
||||
|
||||
$post = & get_post($post_id);
|
||||
|
||||
if ( !current_user_can('delete_page', $page_id) )
|
||||
wp_die( __('You are not allowed to move this page to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in removing from trash...') );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?trashed=1');
|
||||
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
|
||||
else $sendback = add_query_arg('trashed', 1, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'untrash':
|
||||
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
|
||||
check_admin_referer('untrash-page_' . $post_id);
|
||||
|
||||
$post = & get_post($post_id);
|
||||
|
||||
if ( !current_user_can('delete_page', $page_id) )
|
||||
wp_die( __('You are not allowed to remove this page form the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in removing from trash...') );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?untrashed=1');
|
||||
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
|
||||
else $sendback = add_query_arg('untrashed', 1, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
|
||||
check_admin_referer('delete-page_' . $page_id);
|
||||
|
@ -116,6 +116,7 @@ case 'edit':
|
||||
$post = get_post($post_ID);
|
||||
|
||||
if ( empty($post->ID) ) wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') );
|
||||
if ( $post->post_status == 'trash' ) wp_die( __('You can’t edit this post because it is in the Trash. Please move it out of the Trash and try again.') );
|
||||
|
||||
if ( 'post' != $post->post_type ) {
|
||||
wp_redirect( get_edit_post_link( $post->ID, 'url' ) );
|
||||
@ -181,6 +182,46 @@ case 'editpost':
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'trash':
|
||||
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
|
||||
check_admin_referer('trash-post_' . $post_id);
|
||||
|
||||
$post = & get_post($post_id);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to move this post to the trash.') );
|
||||
|
||||
if ( ! wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?trashed=1');
|
||||
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
|
||||
else $sendback = add_query_arg('trashed', 1, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'untrash':
|
||||
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
|
||||
check_admin_referer('untrash-post_' . $post_id);
|
||||
|
||||
$post = & get_post($post_id);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to remove this post from the trash.') );
|
||||
|
||||
if ( ! wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in removing from trash...') );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?untrashed=1');
|
||||
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
|
||||
else $sendback = add_query_arg('untrashed', 1, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
|
||||
check_admin_referer('delete-post_' . $post_id);
|
||||
|
@ -67,33 +67,60 @@ if ( isset($_GET['find_detached'] ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
} elseif ( isset($_GET['action']) && isset($_GET['media']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
} elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
check_admin_referer('bulk-media');
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
if ( 'delete' == $doaction ) {
|
||||
foreach( (array) $_GET['media'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' )
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
|
||||
$location = 'upload.php';
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos($referer, 'upload.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
$location = add_query_arg('message', 2, $location);
|
||||
$location = remove_query_arg('posted', $location);
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
|
||||
if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['media']) ) {
|
||||
$post_ids = $_GET['media'];
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else
|
||||
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
|
||||
$location = 'upload.php';
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos($referer, 'upload.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to move this post to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
}
|
||||
$location = add_query_arg('message', 4, $location);
|
||||
break;
|
||||
case 'untrash':
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to remove this post from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in restoring from trash...') );
|
||||
}
|
||||
$location = add_query_arg('message', 5, $location);
|
||||
break;
|
||||
case 'delete':
|
||||
foreach( (array) $post_ids as $post_id_del ) {
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
|
||||
if ( !wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$location = add_query_arg('message', 2, $location);
|
||||
break;
|
||||
}
|
||||
|
||||
$location = remove_query_arg('posted', $location);
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
@ -115,7 +142,7 @@ if ( isset($_GET['detached']) ) {
|
||||
$orphans = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN ($lost) LIMIT $start, 50" );
|
||||
} else {
|
||||
$start = ( $_GET['paged'] - 1 ) * 25;
|
||||
$orphans = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent < 1 LIMIT $start, 25" );
|
||||
$orphans = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT $start, 25" );
|
||||
$page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / 25);
|
||||
}
|
||||
|
||||
@ -135,6 +162,8 @@ if ( isset($_GET['detached']) ) {
|
||||
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
|
||||
}
|
||||
|
||||
$is_trash = ( isset($_GET['status']) && $_GET['status'] == 'trash' );
|
||||
|
||||
wp_enqueue_script('media');
|
||||
require_once('admin-header.php'); ?>
|
||||
|
||||
@ -153,6 +182,8 @@ if ( isset($_GET['attached']) && (int) $_GET['attached'] ) {
|
||||
$messages[1] = __('Media attachment updated.');
|
||||
$messages[2] = __('Media deleted.');
|
||||
$messages[3] = __('Error saving media attachment.');
|
||||
$messages[4] = __('Media moved to Trash.');
|
||||
$messages[5] = __('Media removed from Trash.');
|
||||
|
||||
if ( isset($_GET['message']) && (int) $_GET['message'] ) {
|
||||
$message = $messages[$_GET['message']];
|
||||
@ -180,13 +211,13 @@ if ( isset($message) ) { ?>
|
||||
<?php
|
||||
$type_links = array();
|
||||
$_num_posts = (array) wp_count_attachments();
|
||||
$_total_posts = array_sum( $_num_posts );
|
||||
$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
|
||||
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
|
||||
foreach ( $matches as $type => $reals )
|
||||
foreach ( $reals as $real )
|
||||
$num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
|
||||
|
||||
$class = empty($_GET['post_mime_type']) && ! isset($_GET['detached']) ? ' class="current"' : '';
|
||||
$class = ( empty($_GET['post_mime_type']) && !isset($_GET['detached']) && !isset($_GET['status']) ) ? ' class="current"' : '';
|
||||
$type_links[] = "<li><a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
|
||||
foreach ( $post_mime_types as $mime_type => $label ) {
|
||||
$class = '';
|
||||
@ -199,8 +230,8 @@ foreach ( $post_mime_types as $mime_type => $label ) {
|
||||
|
||||
$type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
|
||||
}
|
||||
$class = isset($_GET['detached']) ? ' class="current"' : '';
|
||||
$type_links[] = '<li><a href="upload.php?detached=1"' . $class . '>' . __('Unattached') . '</a>';
|
||||
$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . __('Unattached') . '</a>';
|
||||
$type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
|
||||
|
||||
echo implode( " |</li>\n", $type_links) . '</li>';
|
||||
unset($type_links);
|
||||
@ -242,8 +273,12 @@ if ( $page_links ) : ?>
|
||||
<div class="alignleft actions">
|
||||
<select name="action" class="select-action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
<?php if ( isset($orphans) ) { ?>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } if ( isset($orphans) ) { ?>
|
||||
<option value="attach"><?php _e('Attach to a post'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
@ -251,7 +286,7 @@ if ( $page_links ) : ?>
|
||||
<?php wp_nonce_field('bulk-media'); ?>
|
||||
|
||||
<?php
|
||||
if ( ! is_singular() && ! isset($_GET['detached']) ) {
|
||||
if ( !is_singular() && !isset($_GET['detached']) && !$is_trash ) {
|
||||
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
|
||||
|
||||
$arc_result = $wpdb->get_results( $arc_query );
|
||||
@ -286,6 +321,8 @@ foreach ($arc_result as $arc_row) {
|
||||
|
||||
<?php if ( isset($_GET['detached']) ) { ?>
|
||||
<input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e('Scan for lost attachments'); ?>" class="button-secondary" />
|
||||
<?php } elseif ( isset($_GET['status']) && $_GET['status'] == 'trash' ) { ?>
|
||||
<input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
@ -341,7 +378,7 @@ foreach ($arc_result as $arc_row) {
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||
if ( current_user_can('delete_post', $post->ID) )
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||
$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;">'.__('Attach').'</a>';
|
||||
@ -398,12 +435,20 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2" class="select-action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
<?php if ( isset($orphans) ) { ?>
|
||||
<?php if ($is_trash) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } if (isset($orphans)) { ?>
|
||||
<option value="attach"><?php _e('Attach to a post'); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
|
||||
<?php if ( isset($_GET['status']) && $_GET['status'] == 'trash' ) { ?>
|
||||
<input type="submit" id="delete_all2" name="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
|
@ -409,7 +409,8 @@ a.button-secondary {
|
||||
}
|
||||
|
||||
#doaction,
|
||||
#doaction2 {
|
||||
#doaction2,
|
||||
#post-query-submit {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
@ -444,7 +445,9 @@ a.button-secondary {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.unapproved .approve, .spam .approve, .deleted .approve {
|
||||
.unapproved .approve,
|
||||
.spam .approve,
|
||||
.trash .approve {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
@ -1231,7 +1231,7 @@ list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?>
|
||||
log_app('Status','204: No Content');
|
||||
header('Content-Type: text/plain');
|
||||
status_header('204');
|
||||
echo "Deleted.";
|
||||
echo "Moved to Trash.";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -208,8 +208,8 @@ function get_comments( $args = '' ) {
|
||||
$approved = "comment_approved = '1'";
|
||||
elseif ( 'spam' == $status )
|
||||
$approved = "comment_approved = 'spam'";
|
||||
elseif ( 'deleted' == $status )
|
||||
$approved = "comment_approved = 'deleted'";
|
||||
elseif ( 'trash' == $status )
|
||||
$approved = "comment_approved = 'trash'";
|
||||
else
|
||||
$approved = "( comment_approved = '0' OR comment_approved = '1' )";
|
||||
|
||||
@ -694,14 +694,15 @@ function wp_count_comments( $post_id = 0 ) {
|
||||
if ( false !== $count )
|
||||
return $count;
|
||||
|
||||
$where = '';
|
||||
$where = 'WHERE ';
|
||||
if( $post_id > 0 )
|
||||
$where = $wpdb->prepare( "WHERE comment_post_ID = %d", $post_id );
|
||||
$where .= $wpdb->prepare( "c.comment_post_ID = %d AND ", $post_id );
|
||||
$where .= "p.post_status <> 'trash'";
|
||||
|
||||
$count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A );
|
||||
$count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} c LEFT JOIN {$wpdb->posts} p ON c.comment_post_ID = p.ID {$where} GROUP BY comment_approved", ARRAY_A );
|
||||
|
||||
$total = 0;
|
||||
$approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'deleted' => 'deleted');
|
||||
$approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash');
|
||||
$known_types = array_keys( $approved );
|
||||
foreach( (array) $count as $row_num => $row ) {
|
||||
$total += $row['num_comments'];
|
||||
@ -737,15 +738,20 @@ function wp_count_comments( $post_id = 0 ) {
|
||||
* @return bool False if delete comment query failure, true on success.
|
||||
*/
|
||||
function wp_delete_comment($comment_id) {
|
||||
if (wp_get_comment_status($comment_id) != 'deleted' && wp_get_comment_status($comment_id) != 'spam')
|
||||
return wp_set_comment_status($comment_id, 'delete');
|
||||
|
||||
global $wpdb;
|
||||
if (!$comment = get_comment($comment_id))
|
||||
return false;
|
||||
|
||||
if (wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0)
|
||||
return wp_trash_comment($comment_id);
|
||||
|
||||
do_action('delete_comment', $comment_id);
|
||||
|
||||
wp_unschedule_comment_delete($comment_id);
|
||||
|
||||
$comment = get_comment($comment_id);
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if (is_array($trash_meta) && isset($trash_meta['comments'][$comment_id])) {
|
||||
unset($trash_meta['comments'][$comment_id]);
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
}
|
||||
|
||||
if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
|
||||
return false;
|
||||
@ -768,13 +774,73 @@ function wp_delete_comment($comment_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves a comment to the Trash
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @uses do_action() on 'trash_comment' before trashing
|
||||
* @uses do_action() on 'trashed_comment' after trashing
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @return mixed False on failure
|
||||
*/
|
||||
function wp_trash_comment($comment_id = 0) {
|
||||
if (EMPTY_TRASH_DAYS == 0)
|
||||
return wp_delete_comment($comment_id);
|
||||
|
||||
if (!$comment = get_comment($comment_id))
|
||||
return false;
|
||||
|
||||
do_action('trash_comment', $comment_id);
|
||||
|
||||
$trash_meta = get_option('wp_trash_meta', array());
|
||||
$trash_meta['comments'][$comment_id]['status'] = $comment->comment_approved;
|
||||
$trash_meta['comments'][$comment_id]['time'] = time();
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
|
||||
wp_set_comment_status($comment_id, 'trash');
|
||||
|
||||
do_action('trashed_comment', $comment_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a comment from the Trash
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @uses do_action() on 'untrash_comment' before undeletion
|
||||
* @uses do_action() on 'untrashed_comment' after undeletion
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @return mixed False on failure
|
||||
*/
|
||||
function wp_untrash_comment($comment_id = 0) {
|
||||
do_action('untrash_comment', $comment_id);
|
||||
|
||||
$comment = array('comment_ID'=>$comment_id, 'comment_approved'=>'0');
|
||||
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if (is_array($trash_meta) && isset($trash_meta['comments'][$comment_id])) {
|
||||
$comment['comment_approved'] = $trash_meta['comments'][$comment_id]['status'];
|
||||
unset($trash_meta['comments'][$comment_id]);
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
}
|
||||
|
||||
wp_update_comment($comment);
|
||||
|
||||
do_action('untrashed_comment', $comment_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The status of a comment by ID.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param int $comment_id Comment ID
|
||||
* @return string|bool Status might be 'deleted', 'approved', 'unapproved', 'spam'. False on failure.
|
||||
* @return string|bool Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
|
||||
*/
|
||||
function wp_get_comment_status($comment_id) {
|
||||
$comment = get_comment($comment_id);
|
||||
@ -784,15 +850,15 @@ function wp_get_comment_status($comment_id) {
|
||||
$approved = $comment->comment_approved;
|
||||
|
||||
if ( $approved == NULL )
|
||||
return 'deleted';
|
||||
return false;
|
||||
elseif ( $approved == '1' )
|
||||
return 'approved';
|
||||
elseif ( $approved == '0' )
|
||||
return 'unapproved';
|
||||
elseif ( $approved == 'spam' )
|
||||
return 'spam';
|
||||
elseif ( $approved == 'deleted' )
|
||||
return 'deleted';
|
||||
elseif ( $approved == 'trash' )
|
||||
return 'trash';
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@ -1037,8 +1103,7 @@ function wp_new_comment( $commentdata ) {
|
||||
*/
|
||||
function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
|
||||
global $wpdb;
|
||||
wp_unschedule_comment_delete($comment_id);
|
||||
|
||||
|
||||
$status = '0';
|
||||
switch ( $comment_status ) {
|
||||
case 'hold':
|
||||
@ -1054,11 +1119,8 @@ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false)
|
||||
case 'spam':
|
||||
$status = 'spam';
|
||||
break;
|
||||
case 'delete':
|
||||
if (wp_get_comment_status($comment_id) == 'deleted' || wp_get_comment_status($comment_id) == 'spam')
|
||||
return wp_delete_comment($comment_id);
|
||||
$status = 'deleted';
|
||||
wp_schedule_comment_delete($comment_id);
|
||||
case 'trash':
|
||||
$status = 'trash';
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -1083,42 +1145,6 @@ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules a comment for destruction in 30 days.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @return void
|
||||
*/
|
||||
function wp_schedule_comment_delete($comment_id) {
|
||||
$to_delete = get_option('wp_scheduled_delete');
|
||||
if ( !is_array($to_delete) )
|
||||
$to_delete = array();
|
||||
|
||||
$to_delete['comments'][$comment_id] = time();
|
||||
|
||||
update_option('wp_scheduled_delete', $to_delete);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unschedules a comment for destruction.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @return void
|
||||
*/
|
||||
function wp_unschedule_comment_delete($comment_id) {
|
||||
$to_delete = get_option('wp_scheduled_delete');
|
||||
if ( !is_array($to_delete) )
|
||||
return;
|
||||
|
||||
unset($to_delete['comments'][$comment_id]);
|
||||
|
||||
update_option('wp_scheduled_delete', $to_delete);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing comment in the database.
|
||||
*
|
||||
|
@ -3339,28 +3339,29 @@ function _cleanup_header_comment($str) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Permanently deletes comments that have been scheduled for deleting.
|
||||
* Will do the same for posts, pages, etc in the future.
|
||||
* Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function wp_scheduled_delete() {
|
||||
$to_delete = get_option('wp_scheduled_delete');
|
||||
if (!is_array($to_delete))
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if ( !is_array($trash_meta) )
|
||||
return;
|
||||
|
||||
if ( !isset($to_delete['comments']) || !is_array($to_delete['comments']) )
|
||||
$to_delete['comments'] = array();
|
||||
$delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS);
|
||||
|
||||
$delete_delay = defined('EMPTY_TRASH_TIMEOUT') ? (int) EMPTY_TRASH_TIMEOUT : (60*60*24*30);
|
||||
$deletetimestamp = time() - $delete_delay;
|
||||
foreach ($to_delete['comments'] as $comment_id => $timestamp) {
|
||||
if ($timestamp < $deletetimestamp) {
|
||||
wp_delete_comment($comment_id);
|
||||
unset($to_delete['comments'][$comment_id]);
|
||||
foreach ( $trash_meta['comments'] as $id => $meta ) {
|
||||
if ( $meta['time'] < $delete_timestamp ) {
|
||||
wp_delete_comment($id);
|
||||
unset($trash_meta['comments'][$id]);
|
||||
}
|
||||
}
|
||||
foreach ( $trash_meta['posts'] as $id => $meta ) {
|
||||
if ( $meta['time'] < $delete_timestamp ) {
|
||||
wp_delete_post($id);
|
||||
unset($to_delete['posts'][$id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -998,7 +998,7 @@ function wp_count_posts( $type = 'post', $perm = '' ) {
|
||||
|
||||
$count = $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A );
|
||||
|
||||
$stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0 );
|
||||
$stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0, 'trash' => 0 );
|
||||
foreach( (array) $count as $row_num => $row ) {
|
||||
$stats[$row['post_status']] = $row['num_posts'];
|
||||
}
|
||||
@ -1027,12 +1027,13 @@ function wp_count_attachments( $mime_type = '' ) {
|
||||
global $wpdb;
|
||||
|
||||
$and = wp_post_mime_type_where( $mime_type );
|
||||
$count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' $and GROUP BY post_mime_type", ARRAY_A );
|
||||
$count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A );
|
||||
|
||||
$stats = array( );
|
||||
foreach( (array) $count as $row ) {
|
||||
$stats[$row['post_mime_type']] = $row['num_posts'];
|
||||
}
|
||||
$stats['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and");
|
||||
|
||||
return (object) $stats;
|
||||
}
|
||||
@ -1140,10 +1141,19 @@ function wp_delete_post($postid = 0) {
|
||||
if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) )
|
||||
return $post;
|
||||
|
||||
if ( 'attachment' == $post->post_type )
|
||||
if ( ($post->post_type == 'post' || $post->post_type == 'page') && get_post_status($postid) != 'trash' && EMPTY_TRASH_DAYS > 0 )
|
||||
return wp_trash_post($postid);
|
||||
|
||||
if ( $post->post_type == 'attachment' )
|
||||
return wp_delete_attachment($postid);
|
||||
|
||||
do_action('delete_post', $postid);
|
||||
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if ( is_array($trash_meta) && isset($trash_meta['posts'][$postid]) ) {
|
||||
unset($trash_meta['posts'][$postid]);
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
}
|
||||
|
||||
/** @todo delete for pluggable post taxonomies too */
|
||||
wp_delete_object_term_relationships($postid, array('category', 'post_tag'));
|
||||
@ -1204,6 +1214,72 @@ function wp_delete_post($postid = 0) {
|
||||
return $post;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves a post or page to the Trash
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @uses do_action() on 'trash_post' before trashing
|
||||
* @uses do_action() on 'trashed_post' after trashing
|
||||
*
|
||||
* @param int $postid Post ID.
|
||||
* @return mixed False on failure
|
||||
*/
|
||||
function wp_trash_post($postid = 0) {
|
||||
if ( EMPTY_TRASH_DAYS == 0 )
|
||||
return wp_delete_post($postid);
|
||||
|
||||
if ( !$post = wp_get_single_post($postid, ARRAY_A) )
|
||||
return $post;
|
||||
|
||||
do_action('trash_post', $postid);
|
||||
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if ( !is_array($trash_meta) )
|
||||
$trash_meta = array();
|
||||
$trash_meta['posts'][$postid]['status'] = $post['post_status'];
|
||||
$trash_meta['posts'][$postid]['time'] = time();
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
|
||||
$post['post_status'] = 'trash';
|
||||
wp_insert_post($post);
|
||||
|
||||
do_action('trashed_post', $postid);
|
||||
|
||||
return $post;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a post or page from the Trash
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @uses do_action() on 'untrash_post' before undeletion
|
||||
* @uses do_action() on 'untrashed_post' after undeletion
|
||||
*
|
||||
* @param int $postid Post ID.
|
||||
* @return mixed False on failure
|
||||
*/
|
||||
function wp_untrash_post($postid = 0) {
|
||||
if (!$post = wp_get_single_post($postid, ARRAY_A))
|
||||
return $post;
|
||||
|
||||
do_action('untrash_post', $postid);
|
||||
|
||||
$post['post_status'] = 'draft';
|
||||
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if (is_array($trash_meta) && isset($trash_meta['posts'][$postid])) {
|
||||
$post['post_status'] = $trash_meta['posts'][$postid]['status'];
|
||||
unset($trash_meta['posts'][$postid]);
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
}
|
||||
|
||||
wp_insert_post($post);
|
||||
|
||||
do_action('untrashed_post', $postid);
|
||||
|
||||
return $post;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of categories for a post.
|
||||
*
|
||||
@ -2586,6 +2662,15 @@ function wp_delete_attachment($postid) {
|
||||
|
||||
if ( 'attachment' != $post->post_type )
|
||||
return false;
|
||||
|
||||
if ( 'trash' != $post->post_status )
|
||||
return wp_trash_post($postid);
|
||||
|
||||
$trash_meta = get_option('wp_trash_meta');
|
||||
if ( is_array($trash_meta) && isset($trash_meta['posts'][$postid]) ) {
|
||||
unset($trash_meta['posts'][$postid]);
|
||||
update_option('wp_trash_meta', $trash_meta);
|
||||
}
|
||||
|
||||
$meta = wp_get_attachment_metadata( $postid );
|
||||
$file = get_attached_file( $postid );
|
||||
|
@ -2099,6 +2099,8 @@ class WP_Query {
|
||||
$p_status[] = "$wpdb->posts.post_status = 'private'";
|
||||
if ( in_array( 'publish', $q_status ) )
|
||||
$r_status[] = "$wpdb->posts.post_status = 'publish'";
|
||||
if ( in_array( 'trash', $q_status ) )
|
||||
$r_status[] = "$wpdb->posts.post_status = 'trash'";
|
||||
|
||||
if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
|
||||
$r_status = array_merge($r_status, $p_status);
|
||||
|
@ -60,7 +60,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
|
||||
|
||||
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090720' );
|
||||
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090730' );
|
||||
$scripts->add_data( 'common', 'group', 1 );
|
||||
$scripts->localize( 'common', 'commonL10n', array(
|
||||
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
|
||||
@ -204,7 +204,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'upload_stopped' => __('Upload stopped.'),
|
||||
'dismiss' => __('Dismiss'),
|
||||
'crunching' => __('Crunching…'),
|
||||
'deleted' => __('Deleted'),
|
||||
'deleted' => __('Moved to Trash'),
|
||||
'l10n_print_after' => 'try{convertEntities(swfuploadL10n);}catch(e){};'
|
||||
) );
|
||||
|
||||
@ -248,7 +248,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20090514' );
|
||||
$scripts->add_data( 'user-profile', 'group', 1 );
|
||||
|
||||
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090720' );
|
||||
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090730' );
|
||||
$scripts->add_data( 'admin-comments', 'group', 1 );
|
||||
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
|
||||
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
|
||||
|
@ -534,6 +534,12 @@ force_ssl_login(FORCE_SSL_LOGIN);
|
||||
if ( !defined( 'AUTOSAVE_INTERVAL' ) )
|
||||
define( 'AUTOSAVE_INTERVAL', 60 );
|
||||
|
||||
/**
|
||||
* It is possible to define this in wp-config.php
|
||||
* @since 2.9.0
|
||||
*/
|
||||
if ( !defined( 'EMPTY_TRASH_DAYS' ) )
|
||||
define( 'EMPTY_TRASH_DAYS', 30 );
|
||||
|
||||
require (ABSPATH . WPINC . '/vars.php');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user