X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0f29eadd474473203a1182f52af1aa82721cecbd..9c40b4d36daed9e28e48a5fe9205c32557195a4b:/wp-admin/edit.php diff --git a/wp-admin/edit.php b/wp-admin/edit.php index df86317e..eb6b9f1c 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -1,300 +1,300 @@ 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); + } + break; + } + + $sendback = wp_get_referer(); + if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php'); + elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php'); + if ( isset($done) ) { + $done['updated'] = count( $done['updated'] ); + $done['skipped'] = count( $done['skipped'] ); + $done['locked'] = count( $done['locked'] ); + $sendback = add_query_arg( $done, $sendback ); + } + if ( isset($deleted) ) + $sendback = add_query_arg('deleted', $deleted, $sendback); + wp_redirect($sendback); + 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; +} + +if ( empty($title) ) + $title = __('Edit Posts'); $parent_file = 'edit.php'; -$list_js = true; +wp_enqueue_script('inline-edit-post'); + +list($post_stati, $avail_post_stati) = wp_edit_posts_query(); + require_once('admin-header.php'); -$_GET['m'] = (int) $_GET['m']; +if ( !isset( $_GET['paged'] ) ) + $_GET['paged'] = 1; -$drafts = get_users_drafts( $user_ID ); -$other_drafts = get_others_drafts( $user_ID); +if ( empty($_GET['mode']) ) + $mode = 'list'; +else + $mode = esc_attr($_GET['mode']); ?> -if ($drafts || $other_drafts) { -?>
- -

- post_title = stripslashes($draft->post_title); - if ($draft->post_title == '') - $draft->post_title = sprintf(__('Post #%s'), $draft->ID); - echo "$draft->post_title"; - ++$i; - } - ?> - .

- + +

' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?> +

- -

- post_title = stripslashes($draft->post_title); - if ($draft->post_title == '') - $draft->post_title = sprintf(__('Post #%s'), $draft->ID); - echo "$draft->post_title"; - ++$i; - } - ?> - .

+ +

|

+ + + +

+ +if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) + unset($_GET['skipped']); -

+if ( isset($_GET['locked']) && (int) $_GET['locked'] ) { + printf( _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) ); + unset($_GET['locked']); +} + +if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) { + printf( _n( 'Post deleted.', '%s posts 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'] ); +?> +

-
-

+
+ +

+ - -
- - - -
- + -get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_date != '0000-00-00 00:00:00' ORDER BY post_date DESC"); - -if ( count($arc_result) ) { ?> - -
-
- - - -
-
- - + + + + -
+ +
'display name' -$posts_columns = array( - 'id' => __('ID'), - 'date' => __('When'), - 'title' => __('Title'), - 'categories' => __('Categories'), - 'comments' => __('Comments'), - 'author' => __('Author') -); -$posts_columns = apply_filters('manage_posts_columns', $posts_columns); - -// you can not edit these at the moment -$posts_columns['control_view'] = ''; -$posts_columns['control_edit'] = ''; -$posts_columns['control_delete'] = ''; +$page_links = paginate_links( array( + 'base' => add_query_arg( 'paged', '%#%' ), + 'format' => '', + 'prev_text' => __('«'), + 'next_text' => __('»'), + 'total' => $wp_query->max_num_pages, + 'current' => $_GET['paged'] +)); ?> - - +
+ + + - -
- +posts WHERE post_type = 'post' ORDER BY post_date DESC"; - - - +$arc_result = $wpdb->get_results( $arc_query ); -$column_display_name) { - - switch($column_name) { - - case 'id': - ?> - - - - - - - - - - - - - - - - - - - - mmonth ) ) { +$m = isset($_GET['m']) ? (int)$_GET['m'] : 0; ?> - + - - + + + -
g:i:s a'); ?> - post_status) _e(' - Private'); ?> - - ID) ) { echo "" . __('Edit') . ""; } ?>ID) ) { echo "ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post "%s".\\n"OK" to delete, "Cancel" to stop."), js_escape(get_the_title())) . "' );\">" . __('Delete') . ""; } ?>
+$dropdown_options = array('show_option_all' => __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1, + 'show_count' => 0, 'orderby' => 'name', 'selected' => $cat); +wp_dropdown_categories($dropdown_options); +do_action('restrict_manage_posts'); +?> + -
+ +
+ + +
' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), + number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), + number_format_i18n( $wp_query->found_posts ), + $page_links +); echo $page_links_text; ?>
+ + +
+ id="view-switch-list" src="../wp-includes/images/blank.gif" width="20" height="20" title="" alt="" /> + id="view-switch-excerpt" src="../wp-includes/images/blank.gif" width="20" height="20" title="" alt="" /> +
- +
+ + + +
+ $page_links_text
"; +?> + +
+ + +
+
+
+
+ + +
+

+ + + + + + +
+ +
+ + - $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); - if ($comments) { - ?> -

-
    comment_ID); -?> - -
  1. > - - @ - - ID) ) { - echo "[ comment_ID."\">" . __('Edit') . ""; - echo ' - " . __('Delete') . ' '; - - if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { - if ('approved' == wp_get_comment_status($comment->comment_ID)) { - echo ' - ' . __('Unapprove') . ' '; - } else { - echo ' - ' . __('Approve') . ' '; - } - } - echo "]"; - } // end if any comments to show - ?> -
    - - - ( - - / - - ) (IP: - - ) - - -
  2. - -'; - }//end if comments - ?> - - - +include('admin-footer.php');