-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorphaned-media.php
51 lines (43 loc) · 1.35 KB
/
orphaned-media.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/*
Plugin Name: Orphaned Media Import
Plugin URI:
Description: For whatever reason, some times you end up with media in your uploaded content that isn't in the Media Library. This plugin hopes to fix that issue.
Version: 0.01-beta
Author: Shamess
Author URI: http://shamess.info
License: GPL2
*/
require_once ( 'class-orphaned-list-table.php' );
class OrphanedMedia {
function __construct () {
add_action ( 'admin_menu', array ( &$this, 'add_menu' ) );
}
public function add_menu () {
add_submenu_page ( 'upload.php', 'Orphaned Media', 'Orphaned Media', 'upload_files', 'orphaned', array ( &$this, 'draw_admin_page' ) );
}
public function draw_admin_page () {
?>
<style type="text/css">
#preview {
width: 90px;
}
</style>
<div class="wrap">
<div class="icon32" id="icon-upload"><br></div>
<h2>Orphaned Media</h2>
<p>For whatever reason, some times you end up with media in your uploaded content that isn't in the Media Library. This page will show you a list of files which are in your uploads folder, but not in your Media Library.</p>
</div>
<?php
$Data = new OrphanedListTable ();
$Data->prepare_items ();
?><form id="movies-filter" method="get"><?php
$Data->display ();
?>
<input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
</form>
<?php
}
}
$OrphanedMedia = new OrphanedMedia ();
?>