Opened 11 months ago

Closed 9 months ago

#21147 closed defect (bug) (duplicate)

Found posts not filled correctly

Reported by: Rahe Owned by:
Priority: normal Milestone:
Component: Query Version: 3.4
Severity: minor Keywords:
Cc:

Description

Hi,

When i perform a custom WP_Query with the query 'fields'=>'ids' the found_posts is always 0 even if i have multiple pages of content like :

$q = new WP_Query( 
  array( 
   'posts_per_page' => 1,
   'fields' => 'ids'
  ) 
); 

var_dump( $q->found_posts );

If i just remove the fields index, the found_posts is correct.

Attachments (1)

fields-found-rows.diff (1.8 KB) - added by wonderboymusic 9 months ago.

Download all attachments as: .zip

Change History (4)

closed #21733 as a dupe. Patch handles all cases anyways. Attached.

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Sergey's patch on #14426 does the same thing

Note: See TracTickets for help on using tickets.