Open bruno-barros opened 4 years ago
hummm seems to be impossible. I have may own class to query results. If you allow any class with a XYZ method to retrieve the total would be awesome.
$total = null;
if ($query instanceof \WP_Query) {
$total = $query->found_posts;
} elseif ($query instanceof \WP_User_Query) {
$total = $query->total_users;
}
This way it works.
if ($query instanceof \WP_Query) {
$total = $query->found_posts;
} elseif ($query instanceof \WP_User_Query) {
$total = $query->total_users;
} else if(method_exists($resolver, 'get_total_records')){
$total = $resolver->get_total_records();
}
I'm implementing a custom connector to read data from tables that are not from default WP tables. I'm getting the data, but I have no clue on how to pass propper data to do offset pagination. Can you give me a tip? Thanks