post_type == 'attachment' ) if ( ! wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strpos($sendback, 'media.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/media.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Media Library'); $parent_file = 'edit.php'; wp_enqueue_script( 'admin-forms' ); if ( 1 == $_GET['c'] ) wp_enqueue_script( 'admin-comments' ); require_once('admin-header.php'); if ( isset($_GET['paged']) && $start = ( intval($_GET['paged']) - 1 ) * 15 ) add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 15';" ) ); list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); $wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra ) if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; ?>