IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 2403 | 2403 | |
| 2404 | 2404 | // Filter query clauses to include filenames. |
| 2405 | 2405 | if ( isset( $query['s'] ) ) { |
| 2406 | | add_filter( 'posts_clauses', '_filter_query_attachment_filenames' ); |
| | 2406 | add_filter( 'posts_clauses', '_filter_query_attachment_meta' ); |
| 2407 | 2407 | } |
| 2408 | 2408 | |
| 2409 | 2409 | /** |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 1148 | 1148 | |
| 1149 | 1149 | // Filter query clauses to include filenames. |
| 1150 | 1150 | if ( isset( $q['s'] ) ) { |
| 1151 | | add_filter( 'posts_clauses', '_filter_query_attachment_filenames' ); |
| | 1151 | add_filter( 'posts_clauses', '_filter_query_attachment_meta' ); |
| 1152 | 1152 | } |
| 1153 | 1153 | |
| 1154 | 1154 | return $q; |
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | /** |
| 1158 | | * Filter the SQL clauses of an attachment query to include filenames. |
| | 1158 | * Filter the SQL clauses of an attachment query to include meta (filename/alt). |
| 1159 | 1159 | * |
| 1160 | 1160 | * @since 4.7.0 |
| 1161 | 1161 | * @access private |
| … |
… |
|
| 1166 | 1166 | * DISTINCT, fields (SELECT), and LIMITS clauses. |
| 1167 | 1167 | * @return array The modified clauses. |
| 1168 | 1168 | */ |
| 1169 | | function _filter_query_attachment_filenames( $clauses ) { |
| | 1169 | function _filter_query_attachment_meta( $clauses ) { |
| 1170 | 1170 | global $wpdb; |
| 1171 | 1171 | remove_filter( 'posts_clauses', __FUNCTION__ ); |
| 1172 | 1172 | |
| 1173 | 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' )"; |
| | 1174 | $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND ( sq1.meta_key = '_wp_attached_file' OR sq1.meta_key = '_wp_attachment_image_alt' ) )"; |
| 1175 | 1175 | |
| 1176 | 1176 | $clauses['groupby'] = "{$wpdb->posts}.ID"; |
| 1177 | 1177 | |