]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/post.php
WordPress 4.7.1
[autoinstalls/wordpress.git] / wp-admin / includes / post.php
index ab50c27d941a269f49bf7c4e817497292609ca50..eca583a2ecb0b2c59c993c7aa7de315fb64b0393 100644 (file)
@@ -1154,35 +1154,6 @@ function wp_edit_attachments_query_vars( $q = false ) {
        return $q;
 }
 
-/**
- * Filter the SQL clauses of an attachment query to include filenames.
- *
- * @since 4.7.0
- * @access private
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- *
- * @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
- *                       DISTINCT, fields (SELECT), and LIMITS clauses.
- * @return array The modified clauses.
- */
-function _filter_query_attachment_filenames( $clauses ) {
-       global $wpdb;
-       remove_filter( 'posts_clauses', __FUNCTION__ );
-
-       // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.
-       $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";
-
-       $clauses['groupby'] = "{$wpdb->posts}.ID";
-
-       $clauses['where'] = preg_replace(
-               "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",
-               "$0 OR ( sq1.meta_value $1 $2 )",
-               $clauses['where'] );
-
-       return $clauses;
-}
-
 /**
  * Executes a query for attachments. An array of WP_Query arguments
  * can be passed in, which will override the arguments set by this function.