set_found_posts example


        }

        if ( 'ids' === $q['fields'] ) {
            if ( null === $this->posts ) {
                $this->posts = $wpdb->get_col( $this->request );
            }

            /** @var int[] */
            $this->posts      = array_map( 'intval', $this->posts );
            $this->post_count = count( $this->posts );
            $this->set_found_posts( $q$limits );

            if ( $q['cache_results'] && $id_query_is_cacheable ) {
                $cache_value = array(
                    'posts'         => $this->posts,
                    'found_posts'   => $this->found_posts,
                    'max_num_pages' => $this->max_num_pages,
                );

                wp_cache_set( $cache_key$cache_value, 'post-queries' );
            }

            
Home | Imprint | This part of the site doesn't use cookies.