Changeset 54553 for branches/5.7/src/wp-includes/post.php
- Timestamp:
- 10/17/2022 05:53:05 PM (3 years ago)
- Location:
- branches/5.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.7
- Property svn:mergeinfo changed
/trunk merged: 54521-54530,54541
- Property svn:mergeinfo changed
-
branches/5.7/src/wp-includes/post.php
r52466 r54553 7591 7591 7592 7592 /** 7593 * Filters the SQL clauses of an attachment query to include filenames.7594 *7595 * @since 4.7.07596 * @access private7597 *7598 * @global wpdb $wpdb WordPress database abstraction object.7599 *7600 * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,7601 * DISTINCT, fields (SELECT), and LIMITS clauses.7602 * @return string[] The modified array of clauses.7603 */7604 function _filter_query_attachment_filenames( $clauses ) {7605 global $wpdb;7606 remove_filter( 'posts_clauses', __FUNCTION__ );7607 7608 // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.7609 $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";7610 7611 $clauses['groupby'] = "{$wpdb->posts}.ID";7612 7613 $clauses['where'] = preg_replace(7614 "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",7615 '$0 OR ( sq1.meta_value $1 $2 )',7616 $clauses['where']7617 );7618 7619 return $clauses;7620 }7621 7622 /**7623 7593 * Sets the last changed time for the 'posts' cache group. 7624 7594 *
Note: See TracChangeset
for help on using the changeset viewer.