Changeset 39629 for branches/4.7/src/wp-admin/includes/post.php
- Timestamp:
- 12/21/2016 05:18:24 AM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/src/wp-admin/includes/post.php
r39391 r39629 1153 1153 1154 1154 return $q; 1155 }1156 1157 /**1158 * Filter the SQL clauses of an attachment query to include filenames.1159 *1160 * @since 4.7.01161 * @access private1162 *1163 * @global wpdb $wpdb WordPress database abstraction object.1164 *1165 * @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,1166 * DISTINCT, fields (SELECT), and LIMITS clauses.1167 * @return array The modified clauses.1168 */1169 function _filter_query_attachment_filenames( $clauses ) {1170 global $wpdb;1171 remove_filter( 'posts_clauses', __FUNCTION__ );1172 1173 // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.1174 $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";1175 1176 $clauses['groupby'] = "{$wpdb->posts}.ID";1177 1178 $clauses['where'] = preg_replace(1179 "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",1180 "$0 OR ( sq1.meta_value $1 $2 )",1181 $clauses['where'] );1182 1183 return $clauses;1184 1155 } 1185 1156
Note: See TracChangeset
for help on using the changeset viewer.