Make WordPress Core

Ticket #35075: 35075.2.diff

File 35075.2.diff, 3.7 KB (added by boonebgorges, 9 years ago)
  • src/wp-includes/class-wp-comment-query.php

    diff --git src/wp-includes/class-wp-comment-query.php src/wp-includes/class-wp-comment-query.php
    index ac122a6..11f6861 100644
    class WP_Comment_Query { 
    135135         *
    136136         * Sets up the comment query, based on the query vars passed.
    137137         *
     138         * The main comment query is cached, using a key that is generated using the WP_Comment_Query query vars.
     139         * In order to minimize cache misses, arguments that are not defined in the `$query_var_defaults` array are
     140         * ignored when generating the cache key. If you are passing custom query arguments to WP_Comment_Query, and
     141         * you need the query cache to be sensitive to these arguments, add them to the defaults array using the
     142         * {@see 'comment_query_defaults'} filter.
     143         *
    138144         * @since 4.2.0
    139145         * @since 4.4.0 `$parent__in` and `$parent__not_in` were added.
    140146         * @since 4.4.0 Order by `comment__in` was added. `$update_comment_meta_cache`, `$no_found_rows`,
    class WP_Comment_Query { 
    245251         * }
    246252         */
    247253        public function __construct( $query = '' ) {
    248                 $this->query_var_defaults = array(
     254                $defaults = array(
    249255                        'author_email' => '',
    250256                        'author_url' => '',
    251257                        'author__in' => '',
    class WP_Comment_Query { 
    289295                        'update_comment_post_cache' => false,
    290296                );
    291297
     298                /**
     299                 * Filters the default comment query arguments.
     300                 *
     301                 * @since 4.5.0
     302                 *
     303                 * @param array $defaults Array of default WP_Comment_Query arguments.
     304                 */
     305                $this->query_var_defaults = apply_filters( 'comment_query_defaults', $defaults );
     306
    292307                if ( ! empty( $query ) ) {
    293308                        $this->query( $query );
    294309                }
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index cc8e843..e33eecb 100644
    function get_page_uri( $page ) { 
    43194319/**
    43204320 * Retrieve a list of pages.
    43214321 *
     4322 * SQL queries in get_pages() are cached, using a key that is generated using the `$args` array. In order to
     4323 * minimize cache misses, arguments that are not defined in the `$defaults` array are ignored when generating the
     4324 * cache key. If you are passing custom parameters as part of the `$args` array, and you need the query cache to be
     4325 * sensitive to these parameters, add them to the `$defaults` array using the {@see 'get_pages_defaults'} filter.
     4326 *
     4327 *
    43224328 * @global wpdb $wpdb WordPress database abstraction object.
    43234329 *
    43244330 * @since 1.5.0
    function get_pages( $args = array() ) { 
    43714377                'post_type' => 'page', 'post_status' => 'publish',
    43724378        );
    43734379
     4380        /**
     4381         * Filters the default page query arguments.
     4382         *
     4383         * @since 4.5.0
     4384         *
     4385         * @param array $defaults Array of default get_pages() arguments.
     4386         */
     4387        $defaults = apply_filters( 'get_pages_defaults', $defaults );
     4388
    43744389        $r = wp_parse_args( $args, $defaults );
    43754390
    43764391        $number = (int) $r['number'];
  • src/wp-includes/taxonomy.php

    diff --git src/wp-includes/taxonomy.php src/wp-includes/taxonomy.php
    index 5f5127a..8e5cfbf 100644
    function get_term_to_edit( $id, $taxonomy ) { 
    10521052 * The {@see 'list_terms_exclusions'} filter passes the compiled exclusions along with
    10531053 * the $args.
    10541054 *
     1055 * SQL queries in get_terms() are cached, using a key that is generated using the `$args` array. In order to
     1056 * minimize cache misses, arguments that are not defined in the `$defaults` array are ignored when generating the
     1057 * cache key. If you are passing custom parameters as part of the `$args` array, and you need the query cache to be
     1058 * sensitive to these parameters, add them to the `$defaults` array using the {@see 'get_terms_defaults'} filter.
     1059 *
    10551060 * The {@see 'get_terms_orderby'} filter passes the `ORDER BY` clause for the query
    10561061 * along with the $args array.
    10571062 *