Changeset 54534 for branches/6.0/src/wp-includes/post.php
- Timestamp:
- 10/17/2022 12:24:45 PM (4 years ago)
- Location:
- branches/6.0
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0
-
branches/6.0/src/wp-includes/post.php
r53300 r54534 7920 7920 7921 7921 /** 7922 * Filters the SQL clauses of an attachment query to include filenames.7923 *7924 * @since 4.7.07925 * @access private7926 *7927 * @global wpdb $wpdb WordPress database abstraction object.7928 *7929 * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,7930 * DISTINCT, fields (SELECT), and LIMITS clauses.7931 * @return string[] The modified array of clauses.7932 */7933 function _filter_query_attachment_filenames( $clauses ) {7934 global $wpdb;7935 remove_filter( 'posts_clauses', __FUNCTION__ );7936 7937 // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.7938 $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";7939 7940 $clauses['groupby'] = "{$wpdb->posts}.ID";7941 7942 $clauses['where'] = preg_replace(7943 "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",7944 '$0 OR ( sq1.meta_value $1 $2 )',7945 $clauses['where']7946 );7947 7948 return $clauses;7949 }7950 7951 /**7952 7922 * Sets the last changed time for the 'posts' cache group. 7953 7923 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)