Make WordPress Core

Changeset 29550


Ignore:
Timestamp:
08/20/2014 05:08:41 PM (10 years ago)
Author:
ocean90
Message:

Media: Remove scan for lost attachments.

This hasn't been worked for 4 years.

fixes #29169.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r29460 r29550  
    1212    /**
    1313     * Constructor.
    14      * 
     14     *
    1515     * @since 3.1.0
    1616     * @access public
     
    1919     *
    2020     * @param array $args An associative array of arguments.
    21      */ 
     21     */
    2222    public function __construct( $args = array() ) {
    23         $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
     23        $this->detached = isset( $_REQUEST['detached'] );
    2424
    2525        parent::__construct( array(
     
    3434
    3535    public function prepare_items() {
    36         global $lost, $wp_query, $post_mime_types, $avail_post_mime_types, $mode;
    37 
    38         $q = $_REQUEST;
    39 
    40         if ( !empty( $lost ) )
    41             $q['post__in'] = implode( ',', $lost );
    42 
    43         list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $q );
     36        global $wp_query, $post_mime_types, $avail_post_mime_types, $mode;
     37
     38        list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST );
    4439
    4540        $this->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status'];
     
    108103        }
    109104
    110         if ( $this->detached ) {
    111             submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false );
    112         } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
     105        if ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
    113106            submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
    114107        } ?>
     
    118111
    119112    public function current_action() {
    120         if ( isset( $_REQUEST['find_detached'] ) )
    121             return 'find_detached';
    122 
    123113        if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) )
    124114            return 'attach';
  • trunk/src/wp-admin/upload.php

    r29280 r29550  
    9090
    9191    switch ( $doaction ) {
    92         case 'find_detached':
    93             if ( !current_user_can('edit_posts') )
    94                 wp_die( __('You are not allowed to scan for lost attachments.') );
    95 
    96             $lost = $wpdb->get_col( "
    97                 SELECT ID FROM $wpdb->posts
    98                 WHERE post_type = 'attachment' AND post_parent > '0'
    99                 AND post_parent NOT IN (
    100                     SELECT ID FROM $wpdb->posts
    101                     WHERE post_type NOT IN ( 'attachment', '" . join( "', '", get_post_types( array( 'public' => false ) ) ) . "' )
    102                 )
    103             " );
    104 
    105             $_REQUEST['detached'] = 1;
    106             break;
    10792        case 'attach':
    10893            $parent_id = (int) $_REQUEST['found_post_id'];
Note: See TracChangeset for help on using the changeset viewer.