WordPress.org

Make WordPress Core

Ticket #39004: 39004.2.patch

File 39004.2.patch, 2.0 KB (added by rommelxcastro, 3 years ago)

function name refactor

  • wp-admin/includes/ajax-actions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    24032403
    24042404        // Filter query clauses to include filenames.
    24052405        if ( isset( $query['s'] ) ) {
    2406                 add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
     2406                add_filter( 'posts_clauses', '_filter_query_attachment_meta' );
    24072407        }
    24082408
    24092409        /**
  • wp-admin/includes/post.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    11481148
    11491149        // Filter query clauses to include filenames.
    11501150        if ( isset( $q['s'] ) ) {
    1151                 add_filter( 'posts_clauses', '_filter_query_attachment_filenames' );
     1151                add_filter( 'posts_clauses', '_filter_query_attachment_meta' );
    11521152        }
    11531153
    11541154        return $q;
    11551155}
    11561156
    11571157/**
    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).
    11591159 *
    11601160 * @since 4.7.0
    11611161 * @access private
     
    11661166 *                       DISTINCT, fields (SELECT), and LIMITS clauses.
    11671167 * @return array The modified clauses.
    11681168 */
    1169 function _filter_query_attachment_filenames( $clauses ) {
     1169function _filter_query_attachment_meta( $clauses ) {
    11701170        global $wpdb;
    11711171        remove_filter( 'posts_clauses', __FUNCTION__ );
    11721172
    11731173        // 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'  ) )";
    11751175
    11761176        $clauses['groupby'] = "{$wpdb->posts}.ID";
    11771177