WordPress.org

Make WordPress Core

Ticket #14254: 14524.diff

File 14524.diff, 766 bytes (added by wonderboymusic, 6 years ago)
  • wp-includes/meta.php

    diff --git wp-includes/meta.php wp-includes/meta.php
    index 22b0315..9cab5a4 100644
    function update_meta_cache($meta_type, $object_ids) { 
    537537                $object_ids = explode(',', $object_ids);
    538538        }
    539539
     540        $meta_cache_limit = apply_filters( 'meta_cache_limit', 1000 );
     541        if ( count( $object_ids ) > $meta_cache_limit )
     542                return false;
     543
    540544        $object_ids = array_map('intval', $object_ids);
    541545
    542546        $cache_key = $meta_type . '_meta';
    class WP_Meta_Query { 
    720724                                $key_only_queries[$k] = $q;
    721725                                unset( $this->queries[$k] );
    722726                        }
    723                 }               
    724                
     727                }
     728
    725729                // Split out the meta_key only queries (we can only do this for OR)
    726730                if ( 'OR' == $this->relation ) {
    727731                        foreach ( $this->queries as $k => $q ) {