Make WordPress Core


Ignore:
Timestamp:
07/03/2019 01:13:21 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Query: Make sure $climits variable in WP_Query::get_posts() is always defined to avoid a PHP notice.

Props juiiee8487, agengineering.
Fixes #47638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r45590 r45591  
    26302630                $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );
    26312631            }
     2632
    26322633            $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    26332634            $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
     2635            $climits  = ( ! empty( $climits ) ) ? $climits : '';
    26342636
    26352637            $comments = (array) $wpdb->get_results( "SELECT $distinct {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits" );
Note: See TracChangeset for help on using the changeset viewer.