X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..88550bc3400cc7c035ff590ecb007c7938041ded:/wp-admin/edit.php diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 241b8fbd..b5c4cde6 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -25,7 +25,7 @@ if ( ! $post_type_object ) wp_die( __( 'Invalid post type' ) ); if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) - wp_die( __( 'Cheatin’ uh?' ) ); + wp_die( __( 'Cheatin’ uh?' ), 403 ); $wp_list_table = _get_list_table('WP_Posts_List_Table'); $pagenum = $wp_list_table->get_pagenum(); @@ -62,9 +62,12 @@ if ( $doaction ) { $sendback = admin_url($post_new_file); if ( 'delete_all' == $doaction ) { + // Prepare for deletion of all posts with a specified post status (i.e. Empty trash). $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']); - if ( get_post_status_object($post_status) ) // Check the post status exists first + // Validate the post status exists. + if ( get_post_status_object( $post_status ) ) { $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) ); + } $doaction = 'delete'; } elseif ( isset( $_REQUEST['media'] ) ) { $post_ids = $_REQUEST['media']; @@ -158,6 +161,7 @@ if ( $doaction ) { $wp_list_table->prepare_items(); wp_enqueue_script('inline-edit-post'); +wp_enqueue_script('heartbeat'); $title = $post_type_object->labels->name;