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' ); list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); if ( is_singular() ) wp_enqueue_script( 'admin-comments' ); require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; ?>