Changeset 54548 for branches/5.8/src/wp-includes/post.php
- Timestamp:
- 10/17/2022 05:46:39 PM (14 months ago)
- Location:
- branches/5.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
- Property svn:mergeinfo changed
/trunk merged: 54397,54521-54530,54541
- Property svn:mergeinfo changed
-
branches/5.8/src/wp-includes/post.php
r52465 r54548 7696 7696 7697 7697 /** 7698 * Filters the SQL clauses of an attachment query to include filenames.7699 *7700 * @since 4.7.07701 * @access private7702 *7703 * @global wpdb $wpdb WordPress database abstraction object.7704 *7705 * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,7706 * DISTINCT, fields (SELECT), and LIMITS clauses.7707 * @return string[] The modified array of clauses.7708 */7709 function _filter_query_attachment_filenames( $clauses ) {7710 global $wpdb;7711 remove_filter( 'posts_clauses', __FUNCTION__ );7712 7713 // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.7714 $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";7715 7716 $clauses['groupby'] = "{$wpdb->posts}.ID";7717 7718 $clauses['where'] = preg_replace(7719 "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",7720 '$0 OR ( sq1.meta_value $1 $2 )',7721 $clauses['where']7722 );7723 7724 return $clauses;7725 }7726 7727 /**7728 7698 * Sets the last changed time for the 'posts' cache group. 7729 7699 *
Note: See TracChangeset
for help on using the changeset viewer.