Media: Remove scan for lost attachments.

This hasn't been worked for 4 years.

fixes #29169.

Built from https://develop.svn.wordpress.org/trunk@29550


git-svn-id: http://core.svn.wordpress.org/trunk@29326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling
2014-08-20 17:09:15 +00:00
parent d4d1fcda0f
commit 048b96f80d
2 changed files with 6 additions and 31 deletions

View File

@@ -89,21 +89,6 @@ if ( $doaction ) {
}
switch ( $doaction ) {
case 'find_detached':
if ( !current_user_can('edit_posts') )
wp_die( __('You are not allowed to scan for lost attachments.') );
$lost = $wpdb->get_col( "
SELECT ID FROM $wpdb->posts
WHERE post_type = 'attachment' AND post_parent > '0'
AND post_parent NOT IN (
SELECT ID FROM $wpdb->posts
WHERE post_type NOT IN ( 'attachment', '" . join( "', '", get_post_types( array( 'public' => false ) ) ) . "' )
)
" );
$_REQUEST['detached'] = 1;
break;
case 'attach':
$parent_id = (int) $_REQUEST['found_post_id'];
if ( !$parent_id )