Skip to main content
added 13 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251

We have the public properties:

WP_Query->found_posts
WP_Comment_Query->found_comments
WP_Network_Query->found_networks
WP_Site_Query->found_sites

but then comes this private property (that's also made public via magic getter):

WP_User_Query::$total_users

but not found_users as expected, so the confusion is natural :-)

Look into the public get_total() method that and the count_total bool attribute (true by default) in the docs.

We have the public properties:

WP_Query->found_posts
WP_Comment_Query->found_comments
WP_Network_Query->found_networks
WP_Site_Query->found_sites

but then comes this private property (that's also made public via magic getter):

WP_User_Query::$total_users

so the confusion is natural :-)

Look into the public get_total() method that and the count_total bool attribute in the docs.

We have the public properties:

WP_Query->found_posts
WP_Comment_Query->found_comments
WP_Network_Query->found_networks
WP_Site_Query->found_sites

but then comes this private property (that's also made public via magic getter):

WP_User_Query::$total_users

but not found_users as expected, so the confusion is natural :-)

Look into the public get_total() method and the count_total bool attribute (true by default) in the docs.

Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251

We have the public properties:

WP_Query->found_posts
WP_Comment_Query->found_comments
WP_Network_Query->found_networks
WP_Site_Query->found_sites

but then comes this private property (that's also made public via magic getter):

WP_User_Query::$total_users

so the confusion is natural :-)

Look into the public get_total() method that and the count_total bool attribute in the docs.