Changeset 54545 for branches/5.9/src/wp-includes/post.php
- Timestamp:
- 10/17/2022 05:39:34 PM (3 years ago)
- Location:
- branches/5.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
- Property svn:mergeinfo changed
/trunk merged: 54397,54521-54530,54541
- Property svn:mergeinfo changed
-
branches/5.9/src/wp-includes/post.php
r52756 r54545 7928 7928 7929 7929 /** 7930 * Filters the SQL clauses of an attachment query to include filenames.7931 *7932 * @since 4.7.07933 * @access private7934 *7935 * @global wpdb $wpdb WordPress database abstraction object.7936 *7937 * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,7938 * DISTINCT, fields (SELECT), and LIMITS clauses.7939 * @return string[] The modified array of clauses.7940 */7941 function _filter_query_attachment_filenames( $clauses ) {7942 global $wpdb;7943 remove_filter( 'posts_clauses', __FUNCTION__ );7944 7945 // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.7946 $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";7947 7948 $clauses['groupby'] = "{$wpdb->posts}.ID";7949 7950 $clauses['where'] = preg_replace(7951 "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",7952 '$0 OR ( sq1.meta_value $1 $2 )',7953 $clauses['where']7954 );7955 7956 return $clauses;7957 }7958 7959 /**7960 7930 * Sets the last changed time for the 'posts' cache group. 7961 7931 *
Note: See TracChangeset
for help on using the changeset viewer.